diff --git a/README.md b/README.md index 6456b071eb0..4a9c33d4ed9 100644 --- a/README.md +++ b/README.md @@ -306,6 +306,41 @@ with client.zones.with_streaming_response.create( The context manager is required so that the response will reliably be closed. +### Making custom/undocumented requests + +This library is typed for convenient access the documented API. + +If you need to access undocumented endpoints, params, or response properties, the library can still be used. + +#### Undocumented endpoints + +To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other +http verbs. Options on the client will be respected (such as retries) will be respected when making this +request. + +```py +import httpx + +response = client.post( + "/foo", + cast_to=httpx.Response, + body={"my_param": True}, +) + +print(response.headers.get("x-foo")) +``` + +#### Undocumented params + +If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request +options. + +#### Undocumented properties + +To access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You +can also get all the extra fields on the Pydantic model as a dict with +[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra). + ### Configuring the HTTP client You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including: diff --git a/src/cloudflare/types/dns/dns_record.py b/src/cloudflare/types/dns/dns_record.py index edf809026e4..8752f5cbcb3 100644 --- a/src/cloudflare/types/dns/dns_record.py +++ b/src/cloudflare/types/dns/dns_record.py @@ -16,9 +16,9 @@ "CAA", "CAAData", "CAAMeta", - "Cert", - "CertData", - "CertMeta", + "CERT", + "CERTData", + "CERTMeta", "CNAME", "CNAMEMeta", "DNSKEY", @@ -42,9 +42,9 @@ "NSMeta", "PTR", "PTRMeta", - "Smimea", - "SmimeaData", - "SmimeaMeta", + "SMIMEA", + "SMIMEAData", + "SMIMEAMeta", "SRV", "SRVData", "SRVMeta", @@ -286,7 +286,7 @@ class CAA(BaseModel): """The domain of the record.""" -class CertData(BaseModel): +class CERTData(BaseModel): algorithm: Optional[float] = None """Algorithm.""" @@ -300,7 +300,7 @@ class CertData(BaseModel): """Type.""" -class CertMeta(BaseModel): +class CERTMeta(BaseModel): auto_added: Optional[bool] = None """ Will exist if Cloudflare automatically added this DNS record during initial @@ -311,8 +311,8 @@ class CertMeta(BaseModel): """Where the record originated from.""" -class Cert(BaseModel): - data: CertData +class CERT(BaseModel): + data: CERTData """Components of a CERT record.""" name: str @@ -342,7 +342,7 @@ class Cert(BaseModel): Cloudflare). """ - meta: Optional[CertMeta] = None + meta: Optional[CERTMeta] = None """Extra Cloudflare-specific information about the record.""" modified_on: Optional[datetime] = None @@ -1077,7 +1077,7 @@ class PTR(BaseModel): """The domain of the record.""" -class SmimeaData(BaseModel): +class SMIMEAData(BaseModel): certificate: Optional[str] = None """Certificate.""" @@ -1091,7 +1091,7 @@ class SmimeaData(BaseModel): """Usage.""" -class SmimeaMeta(BaseModel): +class SMIMEAMeta(BaseModel): auto_added: Optional[bool] = None """ Will exist if Cloudflare automatically added this DNS record during initial @@ -1102,8 +1102,8 @@ class SmimeaMeta(BaseModel): """Where the record originated from.""" -class Smimea(BaseModel): - data: SmimeaData +class SMIMEA(BaseModel): + data: SMIMEAData """Components of a SMIMEA record.""" name: str @@ -1133,7 +1133,7 @@ class Smimea(BaseModel): Cloudflare). """ - meta: Optional[SmimeaMeta] = None + meta: Optional[SMIMEAMeta] = None """Extra Cloudflare-specific information about the record.""" modified_on: Optional[datetime] = None @@ -1662,7 +1662,7 @@ class URI(BaseModel): DNSRecord = Annotated[ Union[ - A, AAAA, CAA, Cert, CNAME, DNSKEY, DS, HTTPS, LOC, MX, NAPTR, NS, PTR, Smimea, SRV, SSHFP, SVCB, TLSA, TXT, URI + A, AAAA, CAA, CERT, CNAME, DNSKEY, DS, HTTPS, LOC, MX, NAPTR, NS, PTR, SMIMEA, SRV, SSHFP, SVCB, TLSA, TXT, URI ], PropertyInfo(discriminator="type"), ] diff --git a/src/cloudflare/types/workers/scripts/setting_edit_params.py b/src/cloudflare/types/workers/scripts/setting_edit_params.py index 48f07546b66..b99fd88f5d7 100644 --- a/src/cloudflare/types/workers/scripts/setting_edit_params.py +++ b/src/cloudflare/types/workers/scripts/setting_edit_params.py @@ -21,7 +21,7 @@ "SettingsResultBindingWorkersDispatchNamespaceBinding", "SettingsResultBindingWorkersDispatchNamespaceBindingOutbound", "SettingsResultBindingWorkersDispatchNamespaceBindingOutboundWorker", - "SettingsResultBindingWorkersMTLSCertBinding", + "SettingsResultBindingWorkersMTLSCERTBinding", "SettingsResultMigrations", "SettingsResultMigrationsWorkersSingleStepMigrations", "SettingsResultMigrationsWorkersSingleStepMigrationsRenamedClass", @@ -143,7 +143,7 @@ class SettingsResultBindingWorkersDispatchNamespaceBinding(TypedDict, total=Fals """Outbound worker""" -class SettingsResultBindingWorkersMTLSCertBinding(TypedDict, total=False): +class SettingsResultBindingWorkersMTLSCERTBinding(TypedDict, total=False): type: Required[Literal["mtls_certificate"]] """The class of resource that the binding provides.""" @@ -159,7 +159,7 @@ class SettingsResultBindingWorkersMTLSCertBinding(TypedDict, total=False): SettingsResultBindingWorkersQueueBinding, SettingsResultBindingWorkersD1Binding, SettingsResultBindingWorkersDispatchNamespaceBinding, - SettingsResultBindingWorkersMTLSCertBinding, + SettingsResultBindingWorkersMTLSCERTBinding, ] _SettingsResultMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords = TypedDict( diff --git a/src/cloudflare/types/workers/scripts/setting_edit_response.py b/src/cloudflare/types/workers/scripts/setting_edit_response.py index 2d434e8b562..b7cda59b6a1 100644 --- a/src/cloudflare/types/workers/scripts/setting_edit_response.py +++ b/src/cloudflare/types/workers/scripts/setting_edit_response.py @@ -19,7 +19,7 @@ "BindingWorkersDispatchNamespaceBinding", "BindingWorkersDispatchNamespaceBindingOutbound", "BindingWorkersDispatchNamespaceBindingOutboundWorker", - "BindingWorkersMTLSCertBinding", + "BindingWorkersMTLSCERTBinding", "Migrations", "MigrationsWorkersSingleStepMigrations", "MigrationsWorkersSingleStepMigrationsRenamedClass", @@ -149,7 +149,7 @@ class BindingWorkersDispatchNamespaceBinding(BaseModel): """Outbound worker""" -class BindingWorkersMTLSCertBinding(BaseModel): +class BindingWorkersMTLSCERTBinding(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -168,7 +168,7 @@ class BindingWorkersMTLSCertBinding(BaseModel): BindingWorkersQueueBinding, BindingWorkersD1Binding, BindingWorkersDispatchNamespaceBinding, - BindingWorkersMTLSCertBinding, + BindingWorkersMTLSCERTBinding, ] diff --git a/src/cloudflare/types/workers/scripts/setting_get_response.py b/src/cloudflare/types/workers/scripts/setting_get_response.py index 168c0b84ae0..36b3bb99d35 100644 --- a/src/cloudflare/types/workers/scripts/setting_get_response.py +++ b/src/cloudflare/types/workers/scripts/setting_get_response.py @@ -19,7 +19,7 @@ "BindingWorkersDispatchNamespaceBinding", "BindingWorkersDispatchNamespaceBindingOutbound", "BindingWorkersDispatchNamespaceBindingOutboundWorker", - "BindingWorkersMTLSCertBinding", + "BindingWorkersMTLSCERTBinding", "Migrations", "MigrationsWorkersSingleStepMigrations", "MigrationsWorkersSingleStepMigrationsRenamedClass", @@ -149,7 +149,7 @@ class BindingWorkersDispatchNamespaceBinding(BaseModel): """Outbound worker""" -class BindingWorkersMTLSCertBinding(BaseModel): +class BindingWorkersMTLSCERTBinding(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -168,7 +168,7 @@ class BindingWorkersMTLSCertBinding(BaseModel): BindingWorkersQueueBinding, BindingWorkersD1Binding, BindingWorkersDispatchNamespaceBinding, - BindingWorkersMTLSCertBinding, + BindingWorkersMTLSCERTBinding, ] diff --git a/src/cloudflare/types/workers/services/environments/setting_edit_params.py b/src/cloudflare/types/workers/services/environments/setting_edit_params.py index 409fbbaa474..949a8f955c2 100644 --- a/src/cloudflare/types/workers/services/environments/setting_edit_params.py +++ b/src/cloudflare/types/workers/services/environments/setting_edit_params.py @@ -20,7 +20,7 @@ "ResultBindingWorkersDispatchNamespaceBinding", "ResultBindingWorkersDispatchNamespaceBindingOutbound", "ResultBindingWorkersDispatchNamespaceBindingOutboundWorker", - "ResultBindingWorkersMTLSCertBinding", + "ResultBindingWorkersMTLSCERTBinding", "ResultMigrations", "ResultMigrationsWorkersSingleStepMigrations", "ResultMigrationsWorkersSingleStepMigrationsRenamedClass", @@ -152,7 +152,7 @@ class ResultBindingWorkersDispatchNamespaceBinding(TypedDict, total=False): """Outbound worker""" -class ResultBindingWorkersMTLSCertBinding(TypedDict, total=False): +class ResultBindingWorkersMTLSCERTBinding(TypedDict, total=False): type: Required[Literal["mtls_certificate"]] """The class of resource that the binding provides.""" @@ -168,7 +168,7 @@ class ResultBindingWorkersMTLSCertBinding(TypedDict, total=False): ResultBindingWorkersQueueBinding, ResultBindingWorkersD1Binding, ResultBindingWorkersDispatchNamespaceBinding, - ResultBindingWorkersMTLSCertBinding, + ResultBindingWorkersMTLSCERTBinding, ] _ResultMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords = TypedDict( diff --git a/src/cloudflare/types/workers/services/environments/setting_edit_response.py b/src/cloudflare/types/workers/services/environments/setting_edit_response.py index 41c01c60798..8428ab40658 100644 --- a/src/cloudflare/types/workers/services/environments/setting_edit_response.py +++ b/src/cloudflare/types/workers/services/environments/setting_edit_response.py @@ -19,7 +19,7 @@ "BindingWorkersDispatchNamespaceBinding", "BindingWorkersDispatchNamespaceBindingOutbound", "BindingWorkersDispatchNamespaceBindingOutboundWorker", - "BindingWorkersMTLSCertBinding", + "BindingWorkersMTLSCERTBinding", "Migrations", "MigrationsWorkersSingleStepMigrations", "MigrationsWorkersSingleStepMigrationsRenamedClass", @@ -149,7 +149,7 @@ class BindingWorkersDispatchNamespaceBinding(BaseModel): """Outbound worker""" -class BindingWorkersMTLSCertBinding(BaseModel): +class BindingWorkersMTLSCERTBinding(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -168,7 +168,7 @@ class BindingWorkersMTLSCertBinding(BaseModel): BindingWorkersQueueBinding, BindingWorkersD1Binding, BindingWorkersDispatchNamespaceBinding, - BindingWorkersMTLSCertBinding, + BindingWorkersMTLSCERTBinding, ] diff --git a/src/cloudflare/types/workers/services/environments/setting_get_response.py b/src/cloudflare/types/workers/services/environments/setting_get_response.py index 06c3224f7da..d8aae88365b 100644 --- a/src/cloudflare/types/workers/services/environments/setting_get_response.py +++ b/src/cloudflare/types/workers/services/environments/setting_get_response.py @@ -19,7 +19,7 @@ "BindingWorkersDispatchNamespaceBinding", "BindingWorkersDispatchNamespaceBindingOutbound", "BindingWorkersDispatchNamespaceBindingOutboundWorker", - "BindingWorkersMTLSCertBinding", + "BindingWorkersMTLSCERTBinding", "Migrations", "MigrationsWorkersSingleStepMigrations", "MigrationsWorkersSingleStepMigrationsRenamedClass", @@ -149,7 +149,7 @@ class BindingWorkersDispatchNamespaceBinding(BaseModel): """Outbound worker""" -class BindingWorkersMTLSCertBinding(BaseModel): +class BindingWorkersMTLSCERTBinding(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -168,7 +168,7 @@ class BindingWorkersMTLSCertBinding(BaseModel): BindingWorkersQueueBinding, BindingWorkersD1Binding, BindingWorkersDispatchNamespaceBinding, - BindingWorkersMTLSCertBinding, + BindingWorkersMTLSCERTBinding, ] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content/binding_get_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content/binding_get_response.py index 22bc3671510..fbeff912215 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content/binding_get_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content/binding_get_response.py @@ -16,7 +16,7 @@ "WorkersDispatchNamespaceBinding", "WorkersDispatchNamespaceBindingOutbound", "WorkersDispatchNamespaceBindingOutboundWorker", - "WorkersMTLSCertBinding", + "WorkersMTLSCERTBinding", ] @@ -136,7 +136,7 @@ class WorkersDispatchNamespaceBinding(BaseModel): """Outbound worker""" -class WorkersMTLSCertBinding(BaseModel): +class WorkersMTLSCERTBinding(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -155,5 +155,5 @@ class WorkersMTLSCertBinding(BaseModel): WorkersQueueBinding, WorkersD1Binding, WorkersDispatchNamespaceBinding, - WorkersMTLSCertBinding, + WorkersMTLSCERTBinding, ] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content/setting_edit_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content/setting_edit_params.py index aac45ef07f6..378c1606f72 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content/setting_edit_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content/setting_edit_params.py @@ -20,7 +20,7 @@ "ResultBindingWorkersDispatchNamespaceBinding", "ResultBindingWorkersDispatchNamespaceBindingOutbound", "ResultBindingWorkersDispatchNamespaceBindingOutboundWorker", - "ResultBindingWorkersMTLSCertBinding", + "ResultBindingWorkersMTLSCERTBinding", "ResultMigrations", "ResultMigrationsWorkersSingleStepMigrations", "ResultMigrationsWorkersSingleStepMigrationsRenamedClass", @@ -152,7 +152,7 @@ class ResultBindingWorkersDispatchNamespaceBinding(TypedDict, total=False): """Outbound worker""" -class ResultBindingWorkersMTLSCertBinding(TypedDict, total=False): +class ResultBindingWorkersMTLSCERTBinding(TypedDict, total=False): type: Required[Literal["mtls_certificate"]] """The class of resource that the binding provides.""" @@ -168,7 +168,7 @@ class ResultBindingWorkersMTLSCertBinding(TypedDict, total=False): ResultBindingWorkersQueueBinding, ResultBindingWorkersD1Binding, ResultBindingWorkersDispatchNamespaceBinding, - ResultBindingWorkersMTLSCertBinding, + ResultBindingWorkersMTLSCERTBinding, ] _ResultMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords = TypedDict( diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content/setting_edit_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content/setting_edit_response.py index 64ab7ebdd3b..c0348d656ea 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content/setting_edit_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content/setting_edit_response.py @@ -19,7 +19,7 @@ "BindingWorkersDispatchNamespaceBinding", "BindingWorkersDispatchNamespaceBindingOutbound", "BindingWorkersDispatchNamespaceBindingOutboundWorker", - "BindingWorkersMTLSCertBinding", + "BindingWorkersMTLSCERTBinding", "Migrations", "MigrationsWorkersSingleStepMigrations", "MigrationsWorkersSingleStepMigrationsRenamedClass", @@ -149,7 +149,7 @@ class BindingWorkersDispatchNamespaceBinding(BaseModel): """Outbound worker""" -class BindingWorkersMTLSCertBinding(BaseModel): +class BindingWorkersMTLSCERTBinding(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -168,7 +168,7 @@ class BindingWorkersMTLSCertBinding(BaseModel): BindingWorkersQueueBinding, BindingWorkersD1Binding, BindingWorkersDispatchNamespaceBinding, - BindingWorkersMTLSCertBinding, + BindingWorkersMTLSCERTBinding, ] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content/setting_get_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content/setting_get_response.py index df3b9c30871..5802628bc03 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content/setting_get_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content/setting_get_response.py @@ -19,7 +19,7 @@ "BindingWorkersDispatchNamespaceBinding", "BindingWorkersDispatchNamespaceBindingOutbound", "BindingWorkersDispatchNamespaceBindingOutboundWorker", - "BindingWorkersMTLSCertBinding", + "BindingWorkersMTLSCERTBinding", "Migrations", "MigrationsWorkersSingleStepMigrations", "MigrationsWorkersSingleStepMigrationsRenamedClass", @@ -149,7 +149,7 @@ class BindingWorkersDispatchNamespaceBinding(BaseModel): """Outbound worker""" -class BindingWorkersMTLSCertBinding(BaseModel): +class BindingWorkersMTLSCERTBinding(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -168,7 +168,7 @@ class BindingWorkersMTLSCertBinding(BaseModel): BindingWorkersQueueBinding, BindingWorkersD1Binding, BindingWorkersDispatchNamespaceBinding, - BindingWorkersMTLSCertBinding, + BindingWorkersMTLSCERTBinding, ] diff --git a/src/cloudflare/types/zero_trust/gateway/rule_create_params.py b/src/cloudflare/types/zero_trust/gateway/rule_create_params.py index 37c5c9c31cd..30af03fc2b8 100644 --- a/src/cloudflare/types/zero_trust/gateway/rule_create_params.py +++ b/src/cloudflare/types/zero_trust/gateway/rule_create_params.py @@ -18,7 +18,7 @@ "RuleSettingsL4override", "RuleSettingsNotificationSettings", "RuleSettingsPayloadLog", - "RuleSettingsUntrustedCert", + "RuleSettingsUntrustedCERT", "Schedule", ] @@ -208,7 +208,7 @@ class RuleSettingsPayloadLog(TypedDict, total=False): """Set to true to enable DLP payload logging for this rule.""" -class RuleSettingsUntrustedCert(TypedDict, total=False): +class RuleSettingsUntrustedCERT(TypedDict, total=False): action: Literal["pass_through", "block", "error"] """The action performed when an untrusted certificate is seen. @@ -300,7 +300,7 @@ class RuleSettings(TypedDict, total=False): resolver. Cannot be set when dns_resolvers are specified. """ - untrusted_cert: RuleSettingsUntrustedCert + untrusted_cert: RuleSettingsUntrustedCERT """Configure behavior when an upstream cert is invalid or an SSL error occurs.""" diff --git a/src/cloudflare/types/zero_trust/gateway/rule_update_params.py b/src/cloudflare/types/zero_trust/gateway/rule_update_params.py index ca568d601a6..25182bc48a0 100644 --- a/src/cloudflare/types/zero_trust/gateway/rule_update_params.py +++ b/src/cloudflare/types/zero_trust/gateway/rule_update_params.py @@ -18,7 +18,7 @@ "RuleSettingsL4override", "RuleSettingsNotificationSettings", "RuleSettingsPayloadLog", - "RuleSettingsUntrustedCert", + "RuleSettingsUntrustedCERT", "Schedule", ] @@ -208,7 +208,7 @@ class RuleSettingsPayloadLog(TypedDict, total=False): """Set to true to enable DLP payload logging for this rule.""" -class RuleSettingsUntrustedCert(TypedDict, total=False): +class RuleSettingsUntrustedCERT(TypedDict, total=False): action: Literal["pass_through", "block", "error"] """The action performed when an untrusted certificate is seen. @@ -300,7 +300,7 @@ class RuleSettings(TypedDict, total=False): resolver. Cannot be set when dns_resolvers are specified. """ - untrusted_cert: RuleSettingsUntrustedCert + untrusted_cert: RuleSettingsUntrustedCERT """Configure behavior when an upstream cert is invalid or an SSL error occurs.""" diff --git a/src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_rules.py b/src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_rules.py index 41c6fa85f67..66c415a0cc9 100644 --- a/src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_rules.py +++ b/src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_rules.py @@ -19,7 +19,7 @@ "RuleSettingsL4override", "RuleSettingsNotificationSettings", "RuleSettingsPayloadLog", - "RuleSettingsUntrustedCert", + "RuleSettingsUntrustedCERT", "Schedule", ] @@ -142,7 +142,7 @@ class RuleSettingsPayloadLog(BaseModel): """Set to true to enable DLP payload logging for this rule.""" -class RuleSettingsUntrustedCert(BaseModel): +class RuleSettingsUntrustedCERT(BaseModel): action: Optional[Literal["pass_through", "block", "error"]] = None """The action performed when an untrusted certificate is seen. @@ -234,7 +234,7 @@ class RuleSettings(BaseModel): resolver. Cannot be set when dns_resolvers are specified. """ - untrusted_cert: Optional[RuleSettingsUntrustedCert] = None + untrusted_cert: Optional[RuleSettingsUntrustedCERT] = None """Configure behavior when an upstream cert is invalid or an SSL error occurs."""