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,