From e7abd856623e8d4a63ef6166bed7781875771701 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 19:30:41 +0000 Subject: [PATCH] feat(api): OpenAPI spec update via Stainless API (#141) --- src/cloudflare/resources/dns/records.py | 108 ++++++++++------- src/cloudflare/resources/pcaps/pcaps.py | 56 ++++----- .../access/applications/applications.py | 68 ++++++----- .../types/dns/record_create_params.py | 19 +-- .../types/dns/record_edit_params.py | 19 +-- .../types/dns/record_update_params.py | 19 +-- src/cloudflare/types/pcap_create_params.py | 26 ++--- .../access/application_create_params.py | 14 +-- .../access/application_update_params.py | 14 +-- tests/api_resources/dns/test_records.py | 110 +++++------------- tests/api_resources/test_pcaps.py | 36 +----- .../zero_trust/access/test_applications.py | 56 ++------- 12 files changed, 234 insertions(+), 311 deletions(-) diff --git a/src/cloudflare/resources/dns/records.py b/src/cloudflare/resources/dns/records.py index 72c5b630e8b..009aa86f2c2 100644 --- a/src/cloudflare/resources/dns/records.py +++ b/src/cloudflare/resources/dns/records.py @@ -58,9 +58,7 @@ def create( self, *, zone_id: str, - data: record_create_params.Data, name: str, - priority: float, type: Literal[ "URI", "TXT", @@ -84,7 +82,10 @@ def create( "A", ], comment: str | NotGiven = NOT_GIVEN, + content: object | NotGiven = NOT_GIVEN, + data: record_create_params.Data | NotGiven = NOT_GIVEN, meta: record_create_params.Meta | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, @@ -110,14 +111,16 @@ def create( name: DNS record name (or @ for the zone apex) in Punycode. - priority: Required for MX, SRV and URI records; unused by other record types. Records with - lower priorities are preferred. - type: Record type. comment: Comments or notes about the DNS record. This field has no effect on DNS responses. + content: Formatted URI content. See 'data' to set URI properties. + + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. + proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -143,12 +146,13 @@ def create( f"/zones/{zone_id}/dns_records", body=maybe_transform( { - "data": data, "name": name, - "priority": priority, "type": type, "comment": comment, + "content": content, + "data": data, "meta": meta, + "priority": priority, "proxied": proxied, "tags": tags, "ttl": ttl, @@ -173,9 +177,7 @@ def update( dns_record_id: str, *, zone_id: str, - data: record_update_params.Data, name: str, - priority: float, type: Literal[ "URI", "TXT", @@ -199,7 +201,10 @@ def update( "A", ], comment: str | NotGiven = NOT_GIVEN, + content: object | NotGiven = NOT_GIVEN, + data: record_update_params.Data | NotGiven = NOT_GIVEN, meta: record_update_params.Meta | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, @@ -226,14 +231,16 @@ def update( name: DNS record name (or @ for the zone apex) in Punycode. - priority: Required for MX, SRV and URI records; unused by other record types. Records with - lower priorities are preferred. - type: Record type. comment: Comments or notes about the DNS record. This field has no effect on DNS responses. + content: Formatted URI content. See 'data' to set URI properties. + + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. + proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -261,12 +268,13 @@ def update( f"/zones/{zone_id}/dns_records/{dns_record_id}", body=maybe_transform( { - "data": data, "name": name, - "priority": priority, "type": type, "comment": comment, + "content": content, + "data": data, "meta": meta, + "priority": priority, "proxied": proxied, "tags": tags, "ttl": ttl, @@ -460,9 +468,7 @@ def edit( dns_record_id: str, *, zone_id: str, - data: record_edit_params.Data, name: str, - priority: float, type: Literal[ "URI", "TXT", @@ -486,7 +492,10 @@ def edit( "A", ], comment: str | NotGiven = NOT_GIVEN, + content: object | NotGiven = NOT_GIVEN, + data: record_edit_params.Data | NotGiven = NOT_GIVEN, meta: record_edit_params.Meta | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, @@ -513,14 +522,16 @@ def edit( name: DNS record name (or @ for the zone apex) in Punycode. - priority: Required for MX, SRV and URI records; unused by other record types. Records with - lower priorities are preferred. - type: Record type. comment: Comments or notes about the DNS record. This field has no effect on DNS responses. + content: Formatted URI content. See 'data' to set URI properties. + + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. + proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -548,12 +559,13 @@ def edit( f"/zones/{zone_id}/dns_records/{dns_record_id}", body=maybe_transform( { - "data": data, "name": name, - "priority": priority, "type": type, "comment": comment, + "content": content, + "data": data, "meta": meta, + "priority": priority, "proxied": proxied, "tags": tags, "ttl": ttl, @@ -783,9 +795,7 @@ async def create( self, *, zone_id: str, - data: record_create_params.Data, name: str, - priority: float, type: Literal[ "URI", "TXT", @@ -809,7 +819,10 @@ async def create( "A", ], comment: str | NotGiven = NOT_GIVEN, + content: object | NotGiven = NOT_GIVEN, + data: record_create_params.Data | NotGiven = NOT_GIVEN, meta: record_create_params.Meta | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, @@ -835,14 +848,16 @@ async def create( name: DNS record name (or @ for the zone apex) in Punycode. - priority: Required for MX, SRV and URI records; unused by other record types. Records with - lower priorities are preferred. - type: Record type. comment: Comments or notes about the DNS record. This field has no effect on DNS responses. + content: Formatted URI content. See 'data' to set URI properties. + + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. + proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -868,12 +883,13 @@ async def create( f"/zones/{zone_id}/dns_records", body=await async_maybe_transform( { - "data": data, "name": name, - "priority": priority, "type": type, "comment": comment, + "content": content, + "data": data, "meta": meta, + "priority": priority, "proxied": proxied, "tags": tags, "ttl": ttl, @@ -898,9 +914,7 @@ async def update( dns_record_id: str, *, zone_id: str, - data: record_update_params.Data, name: str, - priority: float, type: Literal[ "URI", "TXT", @@ -924,7 +938,10 @@ async def update( "A", ], comment: str | NotGiven = NOT_GIVEN, + content: object | NotGiven = NOT_GIVEN, + data: record_update_params.Data | NotGiven = NOT_GIVEN, meta: record_update_params.Meta | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, @@ -951,14 +968,16 @@ async def update( name: DNS record name (or @ for the zone apex) in Punycode. - priority: Required for MX, SRV and URI records; unused by other record types. Records with - lower priorities are preferred. - type: Record type. comment: Comments or notes about the DNS record. This field has no effect on DNS responses. + content: Formatted URI content. See 'data' to set URI properties. + + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. + proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -986,12 +1005,13 @@ async def update( f"/zones/{zone_id}/dns_records/{dns_record_id}", body=await async_maybe_transform( { - "data": data, "name": name, - "priority": priority, "type": type, "comment": comment, + "content": content, + "data": data, "meta": meta, + "priority": priority, "proxied": proxied, "tags": tags, "ttl": ttl, @@ -1185,9 +1205,7 @@ async def edit( dns_record_id: str, *, zone_id: str, - data: record_edit_params.Data, name: str, - priority: float, type: Literal[ "URI", "TXT", @@ -1211,7 +1229,10 @@ async def edit( "A", ], comment: str | NotGiven = NOT_GIVEN, + content: object | NotGiven = NOT_GIVEN, + data: record_edit_params.Data | NotGiven = NOT_GIVEN, meta: record_edit_params.Meta | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, @@ -1238,14 +1259,16 @@ async def edit( name: DNS record name (or @ for the zone apex) in Punycode. - priority: Required for MX, SRV and URI records; unused by other record types. Records with - lower priorities are preferred. - type: Record type. comment: Comments or notes about the DNS record. This field has no effect on DNS responses. + content: Formatted URI content. See 'data' to set URI properties. + + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. + proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -1273,12 +1296,13 @@ async def edit( f"/zones/{zone_id}/dns_records/{dns_record_id}", body=await async_maybe_transform( { - "data": data, "name": name, - "priority": priority, "type": type, "comment": comment, + "content": content, + "data": data, "meta": meta, + "priority": priority, "proxied": proxied, "tags": tags, "ttl": ttl, diff --git a/src/cloudflare/resources/pcaps/pcaps.py b/src/cloudflare/resources/pcaps/pcaps.py index 9c95aa6407b..b22a74ff76c 100644 --- a/src/cloudflare/resources/pcaps/pcaps.py +++ b/src/cloudflare/resources/pcaps/pcaps.py @@ -66,14 +66,14 @@ def create( self, *, account_id: str, - colo_name: str, - destination_conf: str, - packet_limit: float, system: Literal["magic-transit"], time_limit: float, type: Literal["simple", "full"], byte_limit: float | NotGiven = NOT_GIVEN, + colo_name: str | NotGiven = NOT_GIVEN, + destination_conf: str | NotGiven = NOT_GIVEN, filter_v1: pcap_create_params.FilterV1 | NotGiven = NOT_GIVEN, + packet_limit: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -87,14 +87,6 @@ def create( Args: account_id: Identifier - colo_name: The name of the data center used for the packet capture. This can be a specific - colo (ord02) or a multi-colo name (ORD). This field only applies to `full` - packet captures. - - destination_conf: The full URI for the bucket. This field only applies to `full` packet captures. - - packet_limit: The limit of packets contained in a packet capture. - system: The system used to collect packet captures. time_limit: The packet capture duration in seconds. @@ -105,6 +97,14 @@ def create( byte_limit: The maximum number of bytes to capture. This field only applies to `full` packet captures. + colo_name: The name of the data center used for the packet capture. This can be a specific + colo (ord02) or a multi-colo name (ORD). This field only applies to `full` + packet captures. + + destination_conf: The full URI for the bucket. This field only applies to `full` packet captures. + + packet_limit: The limit of packets contained in a packet capture. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -121,14 +121,14 @@ def create( f"/accounts/{account_id}/pcaps", body=maybe_transform( { - "colo_name": colo_name, - "destination_conf": destination_conf, - "packet_limit": packet_limit, "system": system, "time_limit": time_limit, "type": type, "byte_limit": byte_limit, + "colo_name": colo_name, + "destination_conf": destination_conf, "filter_v1": filter_v1, + "packet_limit": packet_limit, }, pcap_create_params.PCAPCreateParams, ), @@ -255,14 +255,14 @@ async def create( self, *, account_id: str, - colo_name: str, - destination_conf: str, - packet_limit: float, system: Literal["magic-transit"], time_limit: float, type: Literal["simple", "full"], byte_limit: float | NotGiven = NOT_GIVEN, + colo_name: str | NotGiven = NOT_GIVEN, + destination_conf: str | NotGiven = NOT_GIVEN, filter_v1: pcap_create_params.FilterV1 | NotGiven = NOT_GIVEN, + packet_limit: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -276,14 +276,6 @@ async def create( Args: account_id: Identifier - colo_name: The name of the data center used for the packet capture. This can be a specific - colo (ord02) or a multi-colo name (ORD). This field only applies to `full` - packet captures. - - destination_conf: The full URI for the bucket. This field only applies to `full` packet captures. - - packet_limit: The limit of packets contained in a packet capture. - system: The system used to collect packet captures. time_limit: The packet capture duration in seconds. @@ -294,6 +286,14 @@ async def create( byte_limit: The maximum number of bytes to capture. This field only applies to `full` packet captures. + colo_name: The name of the data center used for the packet capture. This can be a specific + colo (ord02) or a multi-colo name (ORD). This field only applies to `full` + packet captures. + + destination_conf: The full URI for the bucket. This field only applies to `full` packet captures. + + packet_limit: The limit of packets contained in a packet capture. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -310,14 +310,14 @@ async def create( f"/accounts/{account_id}/pcaps", body=await async_maybe_transform( { - "colo_name": colo_name, - "destination_conf": destination_conf, - "packet_limit": packet_limit, "system": system, "time_limit": time_limit, "type": type, "byte_limit": byte_limit, + "colo_name": colo_name, + "destination_conf": destination_conf, "filter_v1": filter_v1, + "packet_limit": packet_limit, }, pcap_create_params.PCAPCreateParams, ), diff --git a/src/cloudflare/resources/zero_trust/access/applications/applications.py b/src/cloudflare/resources/zero_trust/access/applications/applications.py index 783b2e849b5..7f6392e65b3 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/applications.py +++ b/src/cloudflare/resources/zero_trust/access/applications/applications.py @@ -83,8 +83,6 @@ def with_streaming_response(self) -> ApplicationsWithStreamingResponse: def create( self, *, - domain: object, - type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, @@ -96,6 +94,7 @@ def create( custom_deny_url: str | NotGiven = NOT_GIVEN, custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, custom_pages: List[str] | NotGiven = NOT_GIVEN, + domain: object | NotGiven = NOT_GIVEN, enable_binding_cookie: bool | NotGiven = NOT_GIVEN, http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, logo_url: str | NotGiven = NOT_GIVEN, @@ -108,6 +107,8 @@ def create( session_duration: str | NotGiven = NOT_GIVEN, skip_interstitial: bool | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, + type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"] + | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -119,10 +120,6 @@ def create( Adds a new application to Access. Args: - domain: The URL or domain of the bookmark. - - type: The application type. - account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. @@ -149,6 +146,8 @@ def create( custom_pages: The custom pages that will be displayed when applicable for this application + domain: The URL or domain of the bookmark. + enable_binding_cookie: Enables the binding cookie, which increases security against compromised authorization tokens and CSRF attacks. @@ -178,6 +177,8 @@ def create( tags: The tags you want assigned to an application. Tags are used to filter applications in the App Launcher dashboard. + type: The application type. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -207,8 +208,6 @@ def create( f"/{account_or_zone}/{account_or_zone_id}/access/apps", body=maybe_transform( { - "domain": domain, - "type": type, "allow_authenticate_via_warp": allow_authenticate_via_warp, "allowed_idps": allowed_idps, "app_launcher_visible": app_launcher_visible, @@ -218,6 +217,7 @@ def create( "custom_deny_url": custom_deny_url, "custom_non_identity_deny_url": custom_non_identity_deny_url, "custom_pages": custom_pages, + "domain": domain, "enable_binding_cookie": enable_binding_cookie, "http_only_cookie_attribute": http_only_cookie_attribute, "logo_url": logo_url, @@ -230,6 +230,7 @@ def create( "session_duration": session_duration, "skip_interstitial": skip_interstitial, "tags": tags, + "type": type, }, application_create_params.ApplicationCreateParams, ), @@ -250,8 +251,6 @@ def update( self, app_id: Union[str, str], *, - domain: object, - type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, @@ -263,6 +262,7 @@ def update( custom_deny_url: str | NotGiven = NOT_GIVEN, custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, custom_pages: List[str] | NotGiven = NOT_GIVEN, + domain: object | NotGiven = NOT_GIVEN, enable_binding_cookie: bool | NotGiven = NOT_GIVEN, http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, logo_url: str | NotGiven = NOT_GIVEN, @@ -275,6 +275,8 @@ def update( session_duration: str | NotGiven = NOT_GIVEN, skip_interstitial: bool | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, + type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"] + | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -288,10 +290,6 @@ def update( Args: app_id: Identifier - domain: The URL or domain of the bookmark. - - type: The application type. - account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. @@ -318,6 +316,8 @@ def update( custom_pages: The custom pages that will be displayed when applicable for this application + domain: The URL or domain of the bookmark. + enable_binding_cookie: Enables the binding cookie, which increases security against compromised authorization tokens and CSRF attacks. @@ -347,6 +347,8 @@ def update( tags: The tags you want assigned to an application. Tags are used to filter applications in the App Launcher dashboard. + type: The application type. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -376,8 +378,6 @@ def update( f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}", body=maybe_transform( { - "domain": domain, - "type": type, "allow_authenticate_via_warp": allow_authenticate_via_warp, "allowed_idps": allowed_idps, "app_launcher_visible": app_launcher_visible, @@ -387,6 +387,7 @@ def update( "custom_deny_url": custom_deny_url, "custom_non_identity_deny_url": custom_non_identity_deny_url, "custom_pages": custom_pages, + "domain": domain, "enable_binding_cookie": enable_binding_cookie, "http_only_cookie_attribute": http_only_cookie_attribute, "logo_url": logo_url, @@ -399,6 +400,7 @@ def update( "session_duration": session_duration, "skip_interstitial": skip_interstitial, "tags": tags, + "type": type, }, application_update_params.ApplicationUpdateParams, ), @@ -674,8 +676,6 @@ def with_streaming_response(self) -> AsyncApplicationsWithStreamingResponse: async def create( self, *, - domain: object, - type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, @@ -687,6 +687,7 @@ async def create( custom_deny_url: str | NotGiven = NOT_GIVEN, custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, custom_pages: List[str] | NotGiven = NOT_GIVEN, + domain: object | NotGiven = NOT_GIVEN, enable_binding_cookie: bool | NotGiven = NOT_GIVEN, http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, logo_url: str | NotGiven = NOT_GIVEN, @@ -699,6 +700,8 @@ async def create( session_duration: str | NotGiven = NOT_GIVEN, skip_interstitial: bool | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, + type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"] + | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -710,10 +713,6 @@ async def create( Adds a new application to Access. Args: - domain: The URL or domain of the bookmark. - - type: The application type. - account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. @@ -740,6 +739,8 @@ async def create( custom_pages: The custom pages that will be displayed when applicable for this application + domain: The URL or domain of the bookmark. + enable_binding_cookie: Enables the binding cookie, which increases security against compromised authorization tokens and CSRF attacks. @@ -769,6 +770,8 @@ async def create( tags: The tags you want assigned to an application. Tags are used to filter applications in the App Launcher dashboard. + type: The application type. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -798,8 +801,6 @@ async def create( f"/{account_or_zone}/{account_or_zone_id}/access/apps", body=await async_maybe_transform( { - "domain": domain, - "type": type, "allow_authenticate_via_warp": allow_authenticate_via_warp, "allowed_idps": allowed_idps, "app_launcher_visible": app_launcher_visible, @@ -809,6 +810,7 @@ async def create( "custom_deny_url": custom_deny_url, "custom_non_identity_deny_url": custom_non_identity_deny_url, "custom_pages": custom_pages, + "domain": domain, "enable_binding_cookie": enable_binding_cookie, "http_only_cookie_attribute": http_only_cookie_attribute, "logo_url": logo_url, @@ -821,6 +823,7 @@ async def create( "session_duration": session_duration, "skip_interstitial": skip_interstitial, "tags": tags, + "type": type, }, application_create_params.ApplicationCreateParams, ), @@ -841,8 +844,6 @@ async def update( self, app_id: Union[str, str], *, - domain: object, - type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, @@ -854,6 +855,7 @@ async def update( custom_deny_url: str | NotGiven = NOT_GIVEN, custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, custom_pages: List[str] | NotGiven = NOT_GIVEN, + domain: object | NotGiven = NOT_GIVEN, enable_binding_cookie: bool | NotGiven = NOT_GIVEN, http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, logo_url: str | NotGiven = NOT_GIVEN, @@ -866,6 +868,8 @@ async def update( session_duration: str | NotGiven = NOT_GIVEN, skip_interstitial: bool | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, + type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"] + | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -879,10 +883,6 @@ async def update( Args: app_id: Identifier - domain: The URL or domain of the bookmark. - - type: The application type. - account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. @@ -909,6 +909,8 @@ async def update( custom_pages: The custom pages that will be displayed when applicable for this application + domain: The URL or domain of the bookmark. + enable_binding_cookie: Enables the binding cookie, which increases security against compromised authorization tokens and CSRF attacks. @@ -938,6 +940,8 @@ async def update( tags: The tags you want assigned to an application. Tags are used to filter applications in the App Launcher dashboard. + type: The application type. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -967,8 +971,6 @@ async def update( f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}", body=await async_maybe_transform( { - "domain": domain, - "type": type, "allow_authenticate_via_warp": allow_authenticate_via_warp, "allowed_idps": allowed_idps, "app_launcher_visible": app_launcher_visible, @@ -978,6 +980,7 @@ async def update( "custom_deny_url": custom_deny_url, "custom_non_identity_deny_url": custom_non_identity_deny_url, "custom_pages": custom_pages, + "domain": domain, "enable_binding_cookie": enable_binding_cookie, "http_only_cookie_attribute": http_only_cookie_attribute, "logo_url": logo_url, @@ -990,6 +993,7 @@ async def update( "session_duration": session_duration, "skip_interstitial": skip_interstitial, "tags": tags, + "type": type, }, application_update_params.ApplicationUpdateParams, ), diff --git a/src/cloudflare/types/dns/record_create_params.py b/src/cloudflare/types/dns/record_create_params.py index 682e1e13c71..63af14f3946 100644 --- a/src/cloudflare/types/dns/record_create_params.py +++ b/src/cloudflare/types/dns/record_create_params.py @@ -12,17 +12,9 @@ class RecordCreateParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" - data: Required[Data] - name: Required[str] """DNS record name (or @ for the zone apex) in Punycode.""" - priority: Required[float] - """Required for MX, SRV and URI records; unused by other record types. - - Records with lower priorities are preferred. - """ - type: Required[ Literal[ "URI", @@ -55,8 +47,19 @@ class RecordCreateParams(TypedDict, total=False): This field has no effect on DNS responses. """ + content: object + """Formatted URI content. See 'data' to set URI properties.""" + + data: Data + meta: Meta + priority: float + """Required for MX, SRV and URI records; unused by other record types. + + Records with lower priorities are preferred. + """ + proxied: bool """ Whether the record is receiving the performance and security benefits of diff --git a/src/cloudflare/types/dns/record_edit_params.py b/src/cloudflare/types/dns/record_edit_params.py index 7d8d4627507..da642472ff2 100644 --- a/src/cloudflare/types/dns/record_edit_params.py +++ b/src/cloudflare/types/dns/record_edit_params.py @@ -12,17 +12,9 @@ class RecordEditParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" - data: Required[Data] - name: Required[str] """DNS record name (or @ for the zone apex) in Punycode.""" - priority: Required[float] - """Required for MX, SRV and URI records; unused by other record types. - - Records with lower priorities are preferred. - """ - type: Required[ Literal[ "URI", @@ -55,8 +47,19 @@ class RecordEditParams(TypedDict, total=False): This field has no effect on DNS responses. """ + content: object + """Formatted URI content. See 'data' to set URI properties.""" + + data: Data + meta: Meta + priority: float + """Required for MX, SRV and URI records; unused by other record types. + + Records with lower priorities are preferred. + """ + proxied: bool """ Whether the record is receiving the performance and security benefits of diff --git a/src/cloudflare/types/dns/record_update_params.py b/src/cloudflare/types/dns/record_update_params.py index 6de57b2d3b5..73f9d18024c 100644 --- a/src/cloudflare/types/dns/record_update_params.py +++ b/src/cloudflare/types/dns/record_update_params.py @@ -12,17 +12,9 @@ class RecordUpdateParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" - data: Required[Data] - name: Required[str] """DNS record name (or @ for the zone apex) in Punycode.""" - priority: Required[float] - """Required for MX, SRV and URI records; unused by other record types. - - Records with lower priorities are preferred. - """ - type: Required[ Literal[ "URI", @@ -55,8 +47,19 @@ class RecordUpdateParams(TypedDict, total=False): This field has no effect on DNS responses. """ + content: object + """Formatted URI content. See 'data' to set URI properties.""" + + data: Data + meta: Meta + priority: float + """Required for MX, SRV and URI records; unused by other record types. + + Records with lower priorities are preferred. + """ + proxied: bool """ Whether the record is receiving the performance and security benefits of diff --git a/src/cloudflare/types/pcap_create_params.py b/src/cloudflare/types/pcap_create_params.py index 05be7c6d1a9..f73c38da082 100644 --- a/src/cloudflare/types/pcap_create_params.py +++ b/src/cloudflare/types/pcap_create_params.py @@ -11,19 +11,6 @@ class PCAPCreateParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - colo_name: Required[str] - """The name of the data center used for the packet capture. - - This can be a specific colo (ord02) or a multi-colo name (ORD). This field only - applies to `full` packet captures. - """ - - destination_conf: Required[str] - """The full URI for the bucket. This field only applies to `full` packet captures.""" - - packet_limit: Required[float] - """The limit of packets contained in a packet capture.""" - system: Required[Literal["magic-transit"]] """The system used to collect packet captures.""" @@ -43,8 +30,21 @@ class PCAPCreateParams(TypedDict, total=False): This field only applies to `full` packet captures. """ + colo_name: str + """The name of the data center used for the packet capture. + + This can be a specific colo (ord02) or a multi-colo name (ORD). This field only + applies to `full` packet captures. + """ + + destination_conf: str + """The full URI for the bucket. This field only applies to `full` packet captures.""" + filter_v1: FilterV1 + packet_limit: float + """The limit of packets contained in a packet capture.""" + class FilterV1(TypedDict, total=False): destination_address: str diff --git a/src/cloudflare/types/zero_trust/access/application_create_params.py b/src/cloudflare/types/zero_trust/access/application_create_params.py index 97873dfc3b4..3db5c80e8ea 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_params.py +++ b/src/cloudflare/types/zero_trust/access/application_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List, Union, Iterable -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Literal, TypedDict __all__ = [ "ApplicationCreateParams", @@ -17,12 +17,6 @@ class ApplicationCreateParams(TypedDict, total=False): - domain: Required[object] - """The URL or domain of the bookmark.""" - - type: Required[Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"]] - """The application type.""" - account_id: str """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" @@ -76,6 +70,9 @@ class ApplicationCreateParams(TypedDict, total=False): custom_pages: List[str] """The custom pages that will be displayed when applicable for this application""" + domain: object + """The URL or domain of the bookmark.""" + enable_binding_cookie: bool """ Enables the binding cookie, which increases security against compromised @@ -130,6 +127,9 @@ class ApplicationCreateParams(TypedDict, total=False): Tags are used to filter applications in the App Launcher dashboard. """ + type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"] + """The application type.""" + class CorsHeaders(TypedDict, total=False): allow_all_headers: bool diff --git a/src/cloudflare/types/zero_trust/access/application_update_params.py b/src/cloudflare/types/zero_trust/access/application_update_params.py index ff4cf930a50..b72cc4c6968 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_params.py +++ b/src/cloudflare/types/zero_trust/access/application_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List, Union, Iterable -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Literal, TypedDict __all__ = [ "ApplicationUpdateParams", @@ -17,12 +17,6 @@ class ApplicationUpdateParams(TypedDict, total=False): - domain: Required[object] - """The URL or domain of the bookmark.""" - - type: Required[Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"]] - """The application type.""" - account_id: str """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" @@ -76,6 +70,9 @@ class ApplicationUpdateParams(TypedDict, total=False): custom_pages: List[str] """The custom pages that will be displayed when applicable for this application""" + domain: object + """The URL or domain of the bookmark.""" + enable_binding_cookie: bool """ Enables the binding cookie, which increases security against compromised @@ -130,6 +127,9 @@ class ApplicationUpdateParams(TypedDict, total=False): Tags are used to filter applications in the App Launcher dashboard. """ + type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"] + """The application type.""" + class CorsHeaders(TypedDict, total=False): allow_all_headers: bool diff --git a/tests/api_resources/dns/test_records.py b/tests/api_resources/dns/test_records.py index 8489cdf0e4a..7b55a55258c 100644 --- a/tests/api_resources/dns/test_records.py +++ b/tests/api_resources/dns/test_records.py @@ -32,9 +32,7 @@ class TestRecords: def test_method_create(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) assert_matches_type(RecordCreateResponse, record, path=["response"]) @@ -44,6 +42,10 @@ def test_method_create(self, client: Cloudflare) -> None: def test_method_create_with_all_params(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", + comment="Domain verification record", + content={}, data={ "flags": {}, "tag": "issue", @@ -85,14 +87,11 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "fingerprint": "string", "content": "http://example.com/example.html", }, - name="example.com", - priority=10, - type="URI", - comment="Domain verification record", meta={ "auto_added": True, "source": "primary", }, + priority=10, proxied=False, tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], ttl=3600, @@ -104,9 +103,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_create(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) @@ -120,9 +117,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: def test_streaming_response_create(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) as response: assert not response.is_closed @@ -139,9 +134,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", - data={}, name="example.com", - priority=10, type="URI", ) @@ -151,9 +144,7 @@ def test_method_update(self, client: Cloudflare) -> None: record = client.dns.records.update( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) assert_matches_type(RecordUpdateResponse, record, path=["response"]) @@ -164,6 +155,10 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: record = client.dns.records.update( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", + comment="Domain verification record", + content={}, data={ "flags": {}, "tag": "issue", @@ -205,14 +200,11 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "fingerprint": "string", "content": "http://example.com/example.html", }, - name="example.com", - priority=10, - type="URI", - comment="Domain verification record", meta={ "auto_added": True, "source": "primary", }, + priority=10, proxied=False, tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], ttl=3600, @@ -225,9 +217,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.update( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) @@ -242,9 +232,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.update( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) as response: assert not response.is_closed @@ -262,9 +250,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="", - data={}, name="example.com", - priority=10, type="URI", ) @@ -272,9 +258,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.update( "", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) @@ -413,9 +397,7 @@ def test_method_edit(self, client: Cloudflare) -> None: record = client.dns.records.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) assert_matches_type(RecordEditResponse, record, path=["response"]) @@ -426,6 +408,10 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: record = client.dns.records.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", + comment="Domain verification record", + content={}, data={ "flags": {}, "tag": "issue", @@ -467,14 +453,11 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "fingerprint": "string", "content": "http://example.com/example.html", }, - name="example.com", - priority=10, - type="URI", - comment="Domain verification record", meta={ "auto_added": True, "source": "primary", }, + priority=10, proxied=False, tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], ttl=3600, @@ -487,9 +470,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) @@ -504,9 +485,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) as response: assert not response.is_closed @@ -524,9 +503,7 @@ def test_path_params_edit(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="", - data={}, name="example.com", - priority=10, type="URI", ) @@ -534,9 +511,7 @@ def test_path_params_edit(self, client: Cloudflare) -> None: client.dns.records.with_raw_response.edit( "", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) @@ -741,9 +716,7 @@ class TestAsyncRecords: async def test_method_create(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) assert_matches_type(RecordCreateResponse, record, path=["response"]) @@ -753,6 +726,10 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", + comment="Domain verification record", + content={}, data={ "flags": {}, "tag": "issue", @@ -794,14 +771,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "fingerprint": "string", "content": "http://example.com/example.html", }, - name="example.com", - priority=10, - type="URI", - comment="Domain verification record", meta={ "auto_added": True, "source": "primary", }, + priority=10, proxied=False, tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], ttl=3600, @@ -813,9 +787,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.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) @@ -829,9 +801,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.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) as response: assert not response.is_closed @@ -848,9 +818,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.create( zone_id="", - data={}, name="example.com", - priority=10, type="URI", ) @@ -860,9 +828,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.update( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) assert_matches_type(RecordUpdateResponse, record, path=["response"]) @@ -873,6 +839,10 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare record = await async_client.dns.records.update( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", + comment="Domain verification record", + content={}, data={ "flags": {}, "tag": "issue", @@ -914,14 +884,11 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "fingerprint": "string", "content": "http://example.com/example.html", }, - name="example.com", - priority=10, - type="URI", - comment="Domain verification record", meta={ "auto_added": True, "source": "primary", }, + priority=10, proxied=False, tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], ttl=3600, @@ -934,9 +901,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.update( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) @@ -951,9 +916,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> async with async_client.dns.records.with_streaming_response.update( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) as response: assert not response.is_closed @@ -971,9 +934,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: await async_client.dns.records.with_raw_response.update( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="", - data={}, name="example.com", - priority=10, type="URI", ) @@ -981,9 +942,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: await async_client.dns.records.with_raw_response.update( "", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) @@ -1122,9 +1081,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) assert_matches_type(RecordEditResponse, record, path=["response"]) @@ -1135,6 +1092,10 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) record = await async_client.dns.records.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example.com", + type="URI", + comment="Domain verification record", + content={}, data={ "flags": {}, "tag": "issue", @@ -1176,14 +1137,11 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "fingerprint": "string", "content": "http://example.com/example.html", }, - name="example.com", - priority=10, - type="URI", - comment="Domain verification record", meta={ "auto_added": True, "source": "primary", }, + priority=10, proxied=False, tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], ttl=3600, @@ -1196,9 +1154,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) @@ -1213,9 +1169,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N async with async_client.dns.records.with_streaming_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) as response: assert not response.is_closed @@ -1233,9 +1187,7 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: await async_client.dns.records.with_raw_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="", - data={}, name="example.com", - priority=10, type="URI", ) @@ -1243,9 +1195,7 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: await async_client.dns.records.with_raw_response.edit( "", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - data={}, name="example.com", - priority=10, type="URI", ) diff --git a/tests/api_resources/test_pcaps.py b/tests/api_resources/test_pcaps.py index a93453905af..45b7207c89c 100644 --- a/tests/api_resources/test_pcaps.py +++ b/tests/api_resources/test_pcaps.py @@ -22,9 +22,6 @@ class TestPCAPs: def test_method_create(self, client: Cloudflare) -> None: pcap = client.pcaps.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - colo_name="ord02", - destination_conf="s3://pcaps-bucket?region=us-east-1", - packet_limit=10000, system="magic-transit", time_limit=300, type="simple", @@ -36,13 +33,12 @@ def test_method_create(self, client: Cloudflare) -> None: def test_method_create_with_all_params(self, client: Cloudflare) -> None: pcap = client.pcaps.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - colo_name="ord02", - destination_conf="s3://pcaps-bucket?region=us-east-1", - packet_limit=10000, system="magic-transit", time_limit=300, type="simple", byte_limit=500000, + colo_name="ord02", + destination_conf="s3://pcaps-bucket?region=us-east-1", filter_v1={ "destination_address": "1.2.3.4", "destination_port": 80, @@ -50,6 +46,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "source_address": "1.2.3.4", "source_port": 123, }, + packet_limit=10000, ) assert_matches_type(PCAPCreateResponse, pcap, path=["response"]) @@ -58,9 +55,6 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_create(self, client: Cloudflare) -> None: response = client.pcaps.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - colo_name="ord02", - destination_conf="s3://pcaps-bucket?region=us-east-1", - packet_limit=10000, system="magic-transit", time_limit=300, type="simple", @@ -76,9 +70,6 @@ def test_raw_response_create(self, client: Cloudflare) -> None: def test_streaming_response_create(self, client: Cloudflare) -> None: with client.pcaps.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - colo_name="ord02", - destination_conf="s3://pcaps-bucket?region=us-east-1", - packet_limit=10000, system="magic-transit", time_limit=300, type="simple", @@ -97,9 +88,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.pcaps.with_raw_response.create( account_id="", - colo_name="ord02", - destination_conf="s3://pcaps-bucket?region=us-east-1", - packet_limit=10000, system="magic-transit", time_limit=300, type="simple", @@ -208,9 +196,6 @@ class TestAsyncPCAPs: async def test_method_create(self, async_client: AsyncCloudflare) -> None: pcap = await async_client.pcaps.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - colo_name="ord02", - destination_conf="s3://pcaps-bucket?region=us-east-1", - packet_limit=10000, system="magic-transit", time_limit=300, type="simple", @@ -222,13 +207,12 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: pcap = await async_client.pcaps.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - colo_name="ord02", - destination_conf="s3://pcaps-bucket?region=us-east-1", - packet_limit=10000, system="magic-transit", time_limit=300, type="simple", byte_limit=500000, + colo_name="ord02", + destination_conf="s3://pcaps-bucket?region=us-east-1", filter_v1={ "destination_address": "1.2.3.4", "destination_port": 80, @@ -236,6 +220,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "source_address": "1.2.3.4", "source_port": 123, }, + packet_limit=10000, ) assert_matches_type(PCAPCreateResponse, pcap, path=["response"]) @@ -244,9 +229,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.pcaps.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - colo_name="ord02", - destination_conf="s3://pcaps-bucket?region=us-east-1", - packet_limit=10000, system="magic-transit", time_limit=300, type="simple", @@ -262,9 +244,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.pcaps.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - colo_name="ord02", - destination_conf="s3://pcaps-bucket?region=us-east-1", - packet_limit=10000, system="magic-transit", time_limit=300, type="simple", @@ -283,9 +262,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.pcaps.with_raw_response.create( account_id="", - colo_name="ord02", - destination_conf="s3://pcaps-bucket?region=us-east-1", - packet_limit=10000, system="magic-transit", time_limit=300, type="simple", diff --git a/tests/api_resources/zero_trust/access/test_applications.py b/tests/api_resources/zero_trust/access/test_applications.py index cde5a8b17a1..add993f4720 100644 --- a/tests/api_resources/zero_trust/access/test_applications.py +++ b/tests/api_resources/zero_trust/access/test_applications.py @@ -25,8 +25,6 @@ class TestApplications: @parametrize def test_method_create(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.create( - domain="https://mybookmark.com", - type="bookmark", account_id="string", zone_id="string", ) @@ -36,8 +34,6 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.create( - domain="https://mybookmark.com", - type="bookmark", account_id="string", zone_id="string", allow_authenticate_via_warp=True, @@ -66,6 +62,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", ], + domain="https://mybookmark.com", enable_binding_cookie=True, http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", @@ -93,6 +90,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: session_duration="24h", skip_interstitial=True, tags=["engineers", "engineers", "engineers"], + type="bookmark", ) assert_matches_type(AccessApps, application, path=["response"]) @@ -100,8 +98,6 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.with_raw_response.create( - domain="https://mybookmark.com", - type="bookmark", account_id="string", zone_id="string", ) @@ -115,8 +111,6 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.create( - domain="https://mybookmark.com", - type="bookmark", account_id="string", zone_id="string", ) as response: @@ -133,16 +127,12 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.zero_trust.access.applications.with_raw_response.create( - domain="https://mybookmark.com", - type="bookmark", account_id="", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zero_trust.access.applications.with_raw_response.create( - domain="https://mybookmark.com", - type="bookmark", account_id="string", zone_id="", ) @@ -152,8 +142,6 @@ def test_path_params_create(self, client: Cloudflare) -> None: def test_method_update(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( "023e105f4ecef8ad9ca31a8372d0c353", - domain="https://mybookmark.com", - type="bookmark", account_id="string", zone_id="string", ) @@ -164,8 +152,6 @@ def test_method_update(self, client: Cloudflare) -> None: def test_method_update_with_all_params(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( "023e105f4ecef8ad9ca31a8372d0c353", - domain="https://mybookmark.com", - type="bookmark", account_id="string", zone_id="string", allow_authenticate_via_warp=True, @@ -194,6 +180,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", ], + domain="https://mybookmark.com", enable_binding_cookie=True, http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", @@ -221,6 +208,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: session_duration="24h", skip_interstitial=True, tags=["engineers", "engineers", "engineers"], + type="bookmark", ) assert_matches_type(AccessApps, application, path=["response"]) @@ -229,8 +217,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_update(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.with_raw_response.update( "023e105f4ecef8ad9ca31a8372d0c353", - domain="https://mybookmark.com", - type="bookmark", account_id="string", zone_id="string", ) @@ -245,8 +231,6 @@ def test_raw_response_update(self, client: Cloudflare) -> None: def test_streaming_response_update(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.update( "023e105f4ecef8ad9ca31a8372d0c353", - domain="https://mybookmark.com", - type="bookmark", account_id="string", zone_id="string", ) as response: @@ -264,8 +248,6 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( "023e105f4ecef8ad9ca31a8372d0c353", - domain="https://mybookmark.com", - type="bookmark", account_id="", zone_id="string", ) @@ -273,8 +255,6 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( "023e105f4ecef8ad9ca31a8372d0c353", - domain="https://mybookmark.com", - type="bookmark", account_id="string", zone_id="", ) @@ -549,8 +529,6 @@ class TestAsyncApplications: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.create( - domain="https://mybookmark.com", - type="bookmark", account_id="string", zone_id="string", ) @@ -560,8 +538,6 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.create( - domain="https://mybookmark.com", - type="bookmark", account_id="string", zone_id="string", allow_authenticate_via_warp=True, @@ -590,6 +566,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", ], + domain="https://mybookmark.com", enable_binding_cookie=True, http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", @@ -617,6 +594,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare session_duration="24h", skip_interstitial=True, tags=["engineers", "engineers", "engineers"], + type="bookmark", ) assert_matches_type(AccessApps, application, path=["response"]) @@ -624,8 +602,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.access.applications.with_raw_response.create( - domain="https://mybookmark.com", - type="bookmark", account_id="string", zone_id="string", ) @@ -639,8 +615,6 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.access.applications.with_streaming_response.create( - domain="https://mybookmark.com", - type="bookmark", account_id="string", zone_id="string", ) as response: @@ -657,16 +631,12 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.create( - domain="https://mybookmark.com", - type="bookmark", account_id="", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.create( - domain="https://mybookmark.com", - type="bookmark", account_id="string", zone_id="", ) @@ -676,8 +646,6 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: async def test_method_update(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.update( "023e105f4ecef8ad9ca31a8372d0c353", - domain="https://mybookmark.com", - type="bookmark", account_id="string", zone_id="string", ) @@ -688,8 +656,6 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.update( "023e105f4ecef8ad9ca31a8372d0c353", - domain="https://mybookmark.com", - type="bookmark", account_id="string", zone_id="string", allow_authenticate_via_warp=True, @@ -718,6 +684,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", ], + domain="https://mybookmark.com", enable_binding_cookie=True, http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", @@ -745,6 +712,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare session_duration="24h", skip_interstitial=True, tags=["engineers", "engineers", "engineers"], + type="bookmark", ) assert_matches_type(AccessApps, application, path=["response"]) @@ -753,8 +721,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.zero_trust.access.applications.with_raw_response.update( "023e105f4ecef8ad9ca31a8372d0c353", - domain="https://mybookmark.com", - type="bookmark", account_id="string", zone_id="string", ) @@ -769,8 +735,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.zero_trust.access.applications.with_streaming_response.update( "023e105f4ecef8ad9ca31a8372d0c353", - domain="https://mybookmark.com", - type="bookmark", account_id="string", zone_id="string", ) as response: @@ -788,8 +752,6 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.update( "023e105f4ecef8ad9ca31a8372d0c353", - domain="https://mybookmark.com", - type="bookmark", account_id="", zone_id="string", ) @@ -797,8 +759,6 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.update( "023e105f4ecef8ad9ca31a8372d0c353", - domain="https://mybookmark.com", - type="bookmark", account_id="string", zone_id="", )