feat(api): OpenAPI spec update via Stainless API (#140)

This commit is contained in:
stainless-app[bot] 2024-03-18 17:09:33 +00:00
parent b3ef1624f7
commit 92d24cee80
13 changed files with 526 additions and 210 deletions

View file

@ -58,12 +58,33 @@ class Records(SyncAPIResource):
self,
*,
zone_id: str,
data: record_create_params.Data,
name: str,
type: Literal["URI"],
priority: float,
type: Literal[
"URI",
"TXT",
"TLSA",
"SVCB",
"SSHFP",
"SRV",
"SMIMEA",
"PTR",
"NS",
"NAPTR",
"MX",
"LOC",
"HTTPS",
"DS",
"DNSKEY",
"CNAME",
"CERT",
"CAA",
"AAAA",
"A",
],
comment: str | 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,
@ -89,14 +110,14 @@ class Records(SyncAPIResource):
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.
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.
@ -122,12 +143,12 @@ class Records(SyncAPIResource):
f"/zones/{zone_id}/dns_records",
body=maybe_transform(
{
"data": data,
"name": name,
"priority": priority,
"type": type,
"comment": comment,
"data": data,
"meta": meta,
"priority": priority,
"proxied": proxied,
"tags": tags,
"ttl": ttl,
@ -152,12 +173,33 @@ class Records(SyncAPIResource):
dns_record_id: str,
*,
zone_id: str,
data: record_update_params.Data,
name: str,
type: Literal["URI"],
priority: float,
type: Literal[
"URI",
"TXT",
"TLSA",
"SVCB",
"SSHFP",
"SRV",
"SMIMEA",
"PTR",
"NS",
"NAPTR",
"MX",
"LOC",
"HTTPS",
"DS",
"DNSKEY",
"CNAME",
"CERT",
"CAA",
"AAAA",
"A",
],
comment: str | 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,
@ -184,14 +226,14 @@ class Records(SyncAPIResource):
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.
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.
@ -219,12 +261,12 @@ class Records(SyncAPIResource):
f"/zones/{zone_id}/dns_records/{dns_record_id}",
body=maybe_transform(
{
"data": data,
"name": name,
"priority": priority,
"type": type,
"comment": comment,
"data": data,
"meta": meta,
"priority": priority,
"proxied": proxied,
"tags": tags,
"ttl": ttl,
@ -418,12 +460,33 @@ class Records(SyncAPIResource):
dns_record_id: str,
*,
zone_id: str,
data: record_edit_params.Data,
name: str,
type: Literal["URI"],
priority: float,
type: Literal[
"URI",
"TXT",
"TLSA",
"SVCB",
"SSHFP",
"SRV",
"SMIMEA",
"PTR",
"NS",
"NAPTR",
"MX",
"LOC",
"HTTPS",
"DS",
"DNSKEY",
"CNAME",
"CERT",
"CAA",
"AAAA",
"A",
],
comment: str | 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,
@ -450,14 +513,14 @@ class Records(SyncAPIResource):
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.
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.
@ -485,12 +548,12 @@ class Records(SyncAPIResource):
f"/zones/{zone_id}/dns_records/{dns_record_id}",
body=maybe_transform(
{
"data": data,
"name": name,
"priority": priority,
"type": type,
"comment": comment,
"data": data,
"meta": meta,
"priority": priority,
"proxied": proxied,
"tags": tags,
"ttl": ttl,
@ -720,12 +783,33 @@ class AsyncRecords(AsyncAPIResource):
self,
*,
zone_id: str,
data: record_create_params.Data,
name: str,
type: Literal["URI"],
priority: float,
type: Literal[
"URI",
"TXT",
"TLSA",
"SVCB",
"SSHFP",
"SRV",
"SMIMEA",
"PTR",
"NS",
"NAPTR",
"MX",
"LOC",
"HTTPS",
"DS",
"DNSKEY",
"CNAME",
"CERT",
"CAA",
"AAAA",
"A",
],
comment: str | 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,
@ -751,14 +835,14 @@ class AsyncRecords(AsyncAPIResource):
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.
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.
@ -784,12 +868,12 @@ class AsyncRecords(AsyncAPIResource):
f"/zones/{zone_id}/dns_records",
body=await async_maybe_transform(
{
"data": data,
"name": name,
"priority": priority,
"type": type,
"comment": comment,
"data": data,
"meta": meta,
"priority": priority,
"proxied": proxied,
"tags": tags,
"ttl": ttl,
@ -814,12 +898,33 @@ class AsyncRecords(AsyncAPIResource):
dns_record_id: str,
*,
zone_id: str,
data: record_update_params.Data,
name: str,
type: Literal["URI"],
priority: float,
type: Literal[
"URI",
"TXT",
"TLSA",
"SVCB",
"SSHFP",
"SRV",
"SMIMEA",
"PTR",
"NS",
"NAPTR",
"MX",
"LOC",
"HTTPS",
"DS",
"DNSKEY",
"CNAME",
"CERT",
"CAA",
"AAAA",
"A",
],
comment: str | 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,
@ -846,14 +951,14 @@ class AsyncRecords(AsyncAPIResource):
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.
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.
@ -881,12 +986,12 @@ class AsyncRecords(AsyncAPIResource):
f"/zones/{zone_id}/dns_records/{dns_record_id}",
body=await async_maybe_transform(
{
"data": data,
"name": name,
"priority": priority,
"type": type,
"comment": comment,
"data": data,
"meta": meta,
"priority": priority,
"proxied": proxied,
"tags": tags,
"ttl": ttl,
@ -1080,12 +1185,33 @@ class AsyncRecords(AsyncAPIResource):
dns_record_id: str,
*,
zone_id: str,
data: record_edit_params.Data,
name: str,
type: Literal["URI"],
priority: float,
type: Literal[
"URI",
"TXT",
"TLSA",
"SVCB",
"SSHFP",
"SRV",
"SMIMEA",
"PTR",
"NS",
"NAPTR",
"MX",
"LOC",
"HTTPS",
"DS",
"DNSKEY",
"CNAME",
"CERT",
"CAA",
"AAAA",
"A",
],
comment: str | 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,
@ -1112,14 +1238,14 @@ class AsyncRecords(AsyncAPIResource):
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.
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.
@ -1147,12 +1273,12 @@ class AsyncRecords(AsyncAPIResource):
f"/zones/{zone_id}/dns_records/{dns_record_id}",
body=await async_maybe_transform(
{
"data": data,
"name": name,
"priority": priority,
"type": type,
"comment": comment,
"data": data,
"meta": meta,
"priority": priority,
"proxied": proxied,
"tags": tags,
"ttl": ttl,

View file

@ -66,14 +66,14 @@ class PCAPs(SyncAPIResource):
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,6 +87,14 @@ class PCAPs(SyncAPIResource):
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.
@ -97,14 +105,6 @@ class PCAPs(SyncAPIResource):
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 @@ class PCAPs(SyncAPIResource):
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 @@ class AsyncPCAPs(AsyncAPIResource):
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,6 +276,14 @@ class AsyncPCAPs(AsyncAPIResource):
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.
@ -286,14 +294,6 @@ class AsyncPCAPs(AsyncAPIResource):
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 @@ class AsyncPCAPs(AsyncAPIResource):
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,
),

View file

@ -3,6 +3,7 @@
from __future__ import annotations
from typing import Any, List, Type, Union, Optional, cast
from typing_extensions import Literal
import httpx
@ -82,6 +83,8 @@ class Applications(SyncAPIResource):
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,
@ -93,7 +96,6 @@ class Applications(SyncAPIResource):
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,
@ -106,7 +108,6 @@ class Applications(SyncAPIResource):
session_duration: str | NotGiven = NOT_GIVEN,
skip_interstitial: bool | NotGiven = NOT_GIVEN,
tags: List[str] | NotGiven = NOT_GIVEN,
type: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@ -118,6 +119,10 @@ class Applications(SyncAPIResource):
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.
@ -144,8 +149,6 @@ class Applications(SyncAPIResource):
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.
@ -175,8 +178,6 @@ class Applications(SyncAPIResource):
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
@ -206,6 +207,8 @@ class Applications(SyncAPIResource):
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,
@ -215,7 +218,6 @@ class Applications(SyncAPIResource):
"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,
@ -228,7 +230,6 @@ class Applications(SyncAPIResource):
"session_duration": session_duration,
"skip_interstitial": skip_interstitial,
"tags": tags,
"type": type,
},
application_create_params.ApplicationCreateParams,
),
@ -249,6 +250,8 @@ class Applications(SyncAPIResource):
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,
@ -260,7 +263,6 @@ class Applications(SyncAPIResource):
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,
@ -273,7 +275,6 @@ class Applications(SyncAPIResource):
session_duration: str | NotGiven = NOT_GIVEN,
skip_interstitial: bool | NotGiven = NOT_GIVEN,
tags: List[str] | NotGiven = NOT_GIVEN,
type: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@ -287,6 +288,10 @@ class Applications(SyncAPIResource):
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.
@ -313,8 +318,6 @@ class Applications(SyncAPIResource):
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.
@ -344,8 +347,6 @@ class Applications(SyncAPIResource):
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
@ -375,6 +376,8 @@ class Applications(SyncAPIResource):
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,
@ -384,7 +387,6 @@ class Applications(SyncAPIResource):
"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,
@ -397,7 +399,6 @@ class Applications(SyncAPIResource):
"session_duration": session_duration,
"skip_interstitial": skip_interstitial,
"tags": tags,
"type": type,
},
application_update_params.ApplicationUpdateParams,
),
@ -673,6 +674,8 @@ class AsyncApplications(AsyncAPIResource):
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,
@ -684,7 +687,6 @@ class AsyncApplications(AsyncAPIResource):
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,
@ -697,7 +699,6 @@ class AsyncApplications(AsyncAPIResource):
session_duration: str | NotGiven = NOT_GIVEN,
skip_interstitial: bool | NotGiven = NOT_GIVEN,
tags: List[str] | NotGiven = NOT_GIVEN,
type: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@ -709,6 +710,10 @@ class AsyncApplications(AsyncAPIResource):
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.
@ -735,8 +740,6 @@ class AsyncApplications(AsyncAPIResource):
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.
@ -766,8 +769,6 @@ class AsyncApplications(AsyncAPIResource):
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
@ -797,6 +798,8 @@ class AsyncApplications(AsyncAPIResource):
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,
@ -806,7 +809,6 @@ class AsyncApplications(AsyncAPIResource):
"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,
@ -819,7 +821,6 @@ class AsyncApplications(AsyncAPIResource):
"session_duration": session_duration,
"skip_interstitial": skip_interstitial,
"tags": tags,
"type": type,
},
application_create_params.ApplicationCreateParams,
),
@ -840,6 +841,8 @@ class AsyncApplications(AsyncAPIResource):
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,
@ -851,7 +854,6 @@ class AsyncApplications(AsyncAPIResource):
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,
@ -864,7 +866,6 @@ class AsyncApplications(AsyncAPIResource):
session_duration: str | NotGiven = NOT_GIVEN,
skip_interstitial: bool | NotGiven = NOT_GIVEN,
tags: List[str] | NotGiven = NOT_GIVEN,
type: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@ -878,6 +879,10 @@ class AsyncApplications(AsyncAPIResource):
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.
@ -904,8 +909,6 @@ class AsyncApplications(AsyncAPIResource):
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.
@ -935,8 +938,6 @@ class AsyncApplications(AsyncAPIResource):
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
@ -966,6 +967,8 @@ class AsyncApplications(AsyncAPIResource):
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,
@ -975,7 +978,6 @@ class AsyncApplications(AsyncAPIResource):
"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,
@ -988,7 +990,6 @@ class AsyncApplications(AsyncAPIResource):
"session_duration": session_duration,
"skip_interstitial": skip_interstitial,
"tags": tags,
"type": type,
},
application_update_params.ApplicationUpdateParams,
),

View file

@ -12,10 +12,41 @@ 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."""
type: Required[Literal["URI"]]
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",
"TXT",
"TLSA",
"SVCB",
"SSHFP",
"SRV",
"SMIMEA",
"PTR",
"NS",
"NAPTR",
"MX",
"LOC",
"HTTPS",
"DS",
"DNSKEY",
"CNAME",
"CERT",
"CAA",
"AAAA",
"A",
]
]
"""Record type."""
comment: str
@ -24,16 +55,8 @@ class RecordCreateParams(TypedDict, total=False):
This field has no effect on DNS responses.
"""
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
@ -73,7 +96,7 @@ class Data(TypedDict, total=False):
fingerprint: str
"""fingerprint."""
flags: str
flags: object
"""Flags."""
key_tag: float

View file

@ -12,10 +12,41 @@ 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."""
type: Required[Literal["URI"]]
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",
"TXT",
"TLSA",
"SVCB",
"SSHFP",
"SRV",
"SMIMEA",
"PTR",
"NS",
"NAPTR",
"MX",
"LOC",
"HTTPS",
"DS",
"DNSKEY",
"CNAME",
"CERT",
"CAA",
"AAAA",
"A",
]
]
"""Record type."""
comment: str
@ -24,16 +55,8 @@ class RecordEditParams(TypedDict, total=False):
This field has no effect on DNS responses.
"""
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
@ -73,7 +96,7 @@ class Data(TypedDict, total=False):
fingerprint: str
"""fingerprint."""
flags: str
flags: object
"""Flags."""
key_tag: float

View file

@ -12,10 +12,41 @@ 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."""
type: Required[Literal["URI"]]
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",
"TXT",
"TLSA",
"SVCB",
"SSHFP",
"SRV",
"SMIMEA",
"PTR",
"NS",
"NAPTR",
"MX",
"LOC",
"HTTPS",
"DS",
"DNSKEY",
"CNAME",
"CERT",
"CAA",
"AAAA",
"A",
]
]
"""Record type."""
comment: str
@ -24,16 +55,8 @@ class RecordUpdateParams(TypedDict, total=False):
This field has no effect on DNS responses.
"""
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
@ -73,7 +96,7 @@ class Data(TypedDict, total=False):
fingerprint: str
"""fingerprint."""
flags: str
flags: object
"""Flags."""
key_tag: float

View file

@ -11,6 +11,19 @@ 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."""
@ -30,21 +43,8 @@ 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

View file

@ -55,7 +55,7 @@ class Source(TypedDict, total=False):
private_key: Annotated[str, PropertyInfo(alias="privateKey")]
"""Private Key of an IAM credential (ideally scoped to a single GCS bucket)"""
provider: Literal["gcs"]
provider: Literal["gcs", "aws"]
region: str
"""Name of the AWS availability zone"""

View file

@ -3,7 +3,7 @@
from __future__ import annotations
from typing import List, Union, Iterable
from typing_extensions import Literal, TypedDict
from typing_extensions import Literal, Required, TypedDict
__all__ = [
"ApplicationCreateParams",
@ -17,6 +17,12 @@ __all__ = [
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."""
@ -70,9 +76,6 @@ 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
@ -127,9 +130,6 @@ class ApplicationCreateParams(TypedDict, total=False):
Tags are used to filter applications in the App Launcher dashboard.
"""
type: str
"""The application type."""
class CorsHeaders(TypedDict, total=False):
allow_all_headers: bool

View file

@ -3,7 +3,7 @@
from __future__ import annotations
from typing import List, Union, Iterable
from typing_extensions import Literal, TypedDict
from typing_extensions import Literal, Required, TypedDict
__all__ = [
"ApplicationUpdateParams",
@ -17,6 +17,12 @@ __all__ = [
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."""
@ -70,9 +76,6 @@ 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
@ -127,9 +130,6 @@ class ApplicationUpdateParams(TypedDict, total=False):
Tags are used to filter applications in the App Launcher dashboard.
"""
type: str
"""The application type."""
class CorsHeaders(TypedDict, total=False):
allow_all_headers: bool

View file

@ -32,7 +32,9 @@ 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"])
@ -42,11 +44,8 @@ class TestRecords:
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",
data={
"flags": "string",
"flags": {},
"tag": "issue",
"value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"',
"algorithm": 2,
@ -86,11 +85,14 @@ class TestRecords:
"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,
@ -102,7 +104,9 @@ class TestRecords:
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",
)
@ -116,7 +120,9 @@ class TestRecords:
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
@ -133,7 +139,9 @@ class TestRecords:
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",
)
@ -143,7 +151,9 @@ class TestRecords:
record = client.dns.records.update(
"023e105f4ecef8ad9ca31a8372d0c353",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
data={},
name="example.com",
priority=10,
type="URI",
)
assert_matches_type(RecordUpdateResponse, record, path=["response"])
@ -154,11 +164,8 @@ class TestRecords:
record = client.dns.records.update(
"023e105f4ecef8ad9ca31a8372d0c353",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
name="example.com",
type="URI",
comment="Domain verification record",
data={
"flags": "string",
"flags": {},
"tag": "issue",
"value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"',
"algorithm": 2,
@ -198,11 +205,14 @@ class TestRecords:
"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,
@ -215,7 +225,9 @@ class TestRecords:
response = client.dns.records.with_raw_response.update(
"023e105f4ecef8ad9ca31a8372d0c353",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
data={},
name="example.com",
priority=10,
type="URI",
)
@ -230,7 +242,9 @@ class TestRecords:
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
@ -248,7 +262,9 @@ class TestRecords:
client.dns.records.with_raw_response.update(
"023e105f4ecef8ad9ca31a8372d0c353",
zone_id="",
data={},
name="example.com",
priority=10,
type="URI",
)
@ -256,7 +272,9 @@ class TestRecords:
client.dns.records.with_raw_response.update(
"",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
data={},
name="example.com",
priority=10,
type="URI",
)
@ -395,7 +413,9 @@ class TestRecords:
record = client.dns.records.edit(
"023e105f4ecef8ad9ca31a8372d0c353",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
data={},
name="example.com",
priority=10,
type="URI",
)
assert_matches_type(RecordEditResponse, record, path=["response"])
@ -406,11 +426,8 @@ class TestRecords:
record = client.dns.records.edit(
"023e105f4ecef8ad9ca31a8372d0c353",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
name="example.com",
type="URI",
comment="Domain verification record",
data={
"flags": "string",
"flags": {},
"tag": "issue",
"value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"',
"algorithm": 2,
@ -450,11 +467,14 @@ class TestRecords:
"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,
@ -467,7 +487,9 @@ class TestRecords:
response = client.dns.records.with_raw_response.edit(
"023e105f4ecef8ad9ca31a8372d0c353",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
data={},
name="example.com",
priority=10,
type="URI",
)
@ -482,7 +504,9 @@ class TestRecords:
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
@ -500,7 +524,9 @@ class TestRecords:
client.dns.records.with_raw_response.edit(
"023e105f4ecef8ad9ca31a8372d0c353",
zone_id="",
data={},
name="example.com",
priority=10,
type="URI",
)
@ -508,7 +534,9 @@ class TestRecords:
client.dns.records.with_raw_response.edit(
"",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
data={},
name="example.com",
priority=10,
type="URI",
)
@ -713,7 +741,9 @@ 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"])
@ -723,11 +753,8 @@ class TestAsyncRecords:
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",
data={
"flags": "string",
"flags": {},
"tag": "issue",
"value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"',
"algorithm": 2,
@ -767,11 +794,14 @@ class TestAsyncRecords:
"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,
@ -783,7 +813,9 @@ class TestAsyncRecords:
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",
)
@ -797,7 +829,9 @@ class TestAsyncRecords:
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
@ -814,7 +848,9 @@ class TestAsyncRecords:
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",
)
@ -824,7 +860,9 @@ class TestAsyncRecords:
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"])
@ -835,11 +873,8 @@ class TestAsyncRecords:
record = await async_client.dns.records.update(
"023e105f4ecef8ad9ca31a8372d0c353",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
name="example.com",
type="URI",
comment="Domain verification record",
data={
"flags": "string",
"flags": {},
"tag": "issue",
"value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"',
"algorithm": 2,
@ -879,11 +914,14 @@ class TestAsyncRecords:
"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,
@ -896,7 +934,9 @@ class TestAsyncRecords:
response = await async_client.dns.records.with_raw_response.update(
"023e105f4ecef8ad9ca31a8372d0c353",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
data={},
name="example.com",
priority=10,
type="URI",
)
@ -911,7 +951,9 @@ class TestAsyncRecords:
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
@ -929,7 +971,9 @@ class TestAsyncRecords:
await async_client.dns.records.with_raw_response.update(
"023e105f4ecef8ad9ca31a8372d0c353",
zone_id="",
data={},
name="example.com",
priority=10,
type="URI",
)
@ -937,7 +981,9 @@ class TestAsyncRecords:
await async_client.dns.records.with_raw_response.update(
"",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
data={},
name="example.com",
priority=10,
type="URI",
)
@ -1076,7 +1122,9 @@ class TestAsyncRecords:
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"])
@ -1087,11 +1135,8 @@ class TestAsyncRecords:
record = await async_client.dns.records.edit(
"023e105f4ecef8ad9ca31a8372d0c353",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
name="example.com",
type="URI",
comment="Domain verification record",
data={
"flags": "string",
"flags": {},
"tag": "issue",
"value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"',
"algorithm": 2,
@ -1131,11 +1176,14 @@ class TestAsyncRecords:
"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,
@ -1148,7 +1196,9 @@ class TestAsyncRecords:
response = await async_client.dns.records.with_raw_response.edit(
"023e105f4ecef8ad9ca31a8372d0c353",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
data={},
name="example.com",
priority=10,
type="URI",
)
@ -1163,7 +1213,9 @@ class TestAsyncRecords:
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
@ -1181,7 +1233,9 @@ class TestAsyncRecords:
await async_client.dns.records.with_raw_response.edit(
"023e105f4ecef8ad9ca31a8372d0c353",
zone_id="",
data={},
name="example.com",
priority=10,
type="URI",
)
@ -1189,7 +1243,9 @@ class TestAsyncRecords:
await async_client.dns.records.with_raw_response.edit(
"",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
data={},
name="example.com",
priority=10,
type="URI",
)

View file

@ -22,6 +22,9 @@ 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",
@ -33,12 +36,13 @@ class TestPCAPs:
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,
@ -46,7 +50,6 @@ class TestPCAPs:
"source_address": "1.2.3.4",
"source_port": 123,
},
packet_limit=10000,
)
assert_matches_type(PCAPCreateResponse, pcap, path=["response"])
@ -55,6 +58,9 @@ class TestPCAPs:
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",
@ -70,6 +76,9 @@ class TestPCAPs:
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",
@ -88,6 +97,9 @@ class TestPCAPs:
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",
@ -196,6 +208,9 @@ 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",
@ -207,12 +222,13 @@ class TestAsyncPCAPs:
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,
@ -220,7 +236,6 @@ class TestAsyncPCAPs:
"source_address": "1.2.3.4",
"source_port": 123,
},
packet_limit=10000,
)
assert_matches_type(PCAPCreateResponse, pcap, path=["response"])
@ -229,6 +244,9 @@ class TestAsyncPCAPs:
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",
@ -244,6 +262,9 @@ class TestAsyncPCAPs:
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",
@ -262,6 +283,9 @@ class TestAsyncPCAPs:
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",

View file

@ -25,6 +25,8 @@ 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",
)
@ -34,6 +36,8 @@ class TestApplications:
@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,
@ -62,7 +66,6 @@ class TestApplications:
"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",
@ -90,7 +93,6 @@ class TestApplications:
session_duration="24h",
skip_interstitial=True,
tags=["engineers", "engineers", "engineers"],
type="bookmark",
)
assert_matches_type(AccessApps, application, path=["response"])
@ -98,6 +100,8 @@ class TestApplications:
@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",
)
@ -111,6 +115,8 @@ class TestApplications:
@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:
@ -127,12 +133,16 @@ class TestApplications:
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="",
)
@ -142,6 +152,8 @@ class TestApplications:
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",
)
@ -152,6 +164,8 @@ class TestApplications:
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,
@ -180,7 +194,6 @@ class TestApplications:
"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",
@ -208,7 +221,6 @@ class TestApplications:
session_duration="24h",
skip_interstitial=True,
tags=["engineers", "engineers", "engineers"],
type="bookmark",
)
assert_matches_type(AccessApps, application, path=["response"])
@ -217,6 +229,8 @@ class TestApplications:
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",
)
@ -231,6 +245,8 @@ class TestApplications:
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:
@ -248,6 +264,8 @@ class TestApplications:
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",
)
@ -255,6 +273,8 @@ class TestApplications:
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="",
)
@ -529,6 +549,8 @@ 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",
)
@ -538,6 +560,8 @@ class TestAsyncApplications:
@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,
@ -566,7 +590,6 @@ class TestAsyncApplications:
"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",
@ -594,7 +617,6 @@ class TestAsyncApplications:
session_duration="24h",
skip_interstitial=True,
tags=["engineers", "engineers", "engineers"],
type="bookmark",
)
assert_matches_type(AccessApps, application, path=["response"])
@ -602,6 +624,8 @@ class TestAsyncApplications:
@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",
)
@ -615,6 +639,8 @@ class TestAsyncApplications:
@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:
@ -631,12 +657,16 @@ class TestAsyncApplications:
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="",
)
@ -646,6 +676,8 @@ class TestAsyncApplications:
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",
)
@ -656,6 +688,8 @@ class TestAsyncApplications:
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,
@ -684,7 +718,6 @@ class TestAsyncApplications:
"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",
@ -712,7 +745,6 @@ class TestAsyncApplications:
session_duration="24h",
skip_interstitial=True,
tags=["engineers", "engineers", "engineers"],
type="bookmark",
)
assert_matches_type(AccessApps, application, path=["response"])
@ -721,6 +753,8 @@ class TestAsyncApplications:
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",
)
@ -735,6 +769,8 @@ class TestAsyncApplications:
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:
@ -752,6 +788,8 @@ class TestAsyncApplications:
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",
)
@ -759,6 +797,8 @@ class TestAsyncApplications:
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="",
)