Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Mar 21, 2024
1 parent efaad20 commit 3c1de95
Show file tree
Hide file tree
Showing 15 changed files with 91 additions and 56 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
34 changes: 17 additions & 17 deletions src/cloudflare/types/dns/dns_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"CAA",
"CAAData",
"CAAMeta",
"Cert",
"CertData",
"CertMeta",
"CERT",
"CERTData",
"CERTMeta",
"CNAME",
"CNAMEMeta",
"DNSKEY",
Expand All @@ -42,9 +42,9 @@
"NSMeta",
"PTR",
"PTRMeta",
"Smimea",
"SmimeaData",
"SmimeaMeta",
"SMIMEA",
"SMIMEAData",
"SMIMEAMeta",
"SRV",
"SRVData",
"SRVMeta",
Expand Down Expand Up @@ -286,7 +286,7 @@ class CAA(BaseModel):
"""The domain of the record."""


class CertData(BaseModel):
class CERTData(BaseModel):
algorithm: Optional[float] = None
"""Algorithm."""

Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1077,7 +1077,7 @@ class PTR(BaseModel):
"""The domain of the record."""


class SmimeaData(BaseModel):
class SMIMEAData(BaseModel):
certificate: Optional[str] = None
"""Certificate."""

Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"),
]
6 changes: 3 additions & 3 deletions src/cloudflare/types/workers/scripts/setting_edit_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"SettingsResultBindingWorkersDispatchNamespaceBinding",
"SettingsResultBindingWorkersDispatchNamespaceBindingOutbound",
"SettingsResultBindingWorkersDispatchNamespaceBindingOutboundWorker",
"SettingsResultBindingWorkersMTLSCertBinding",
"SettingsResultBindingWorkersMTLSCERTBinding",
"SettingsResultMigrations",
"SettingsResultMigrationsWorkersSingleStepMigrations",
"SettingsResultMigrationsWorkersSingleStepMigrationsRenamedClass",
Expand Down Expand Up @@ -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."""

Expand All @@ -159,7 +159,7 @@ class SettingsResultBindingWorkersMTLSCertBinding(TypedDict, total=False):
SettingsResultBindingWorkersQueueBinding,
SettingsResultBindingWorkersD1Binding,
SettingsResultBindingWorkersDispatchNamespaceBinding,
SettingsResultBindingWorkersMTLSCertBinding,
SettingsResultBindingWorkersMTLSCERTBinding,
]

_SettingsResultMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords = TypedDict(
Expand Down
6 changes: 3 additions & 3 deletions src/cloudflare/types/workers/scripts/setting_edit_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"BindingWorkersDispatchNamespaceBinding",
"BindingWorkersDispatchNamespaceBindingOutbound",
"BindingWorkersDispatchNamespaceBindingOutboundWorker",
"BindingWorkersMTLSCertBinding",
"BindingWorkersMTLSCERTBinding",
"Migrations",
"MigrationsWorkersSingleStepMigrations",
"MigrationsWorkersSingleStepMigrationsRenamedClass",
Expand Down Expand Up @@ -149,7 +149,7 @@ class BindingWorkersDispatchNamespaceBinding(BaseModel):
"""Outbound worker"""


class BindingWorkersMTLSCertBinding(BaseModel):
class BindingWorkersMTLSCERTBinding(BaseModel):
name: str
"""A JavaScript variable name for the binding."""

Expand All @@ -168,7 +168,7 @@ class BindingWorkersMTLSCertBinding(BaseModel):
BindingWorkersQueueBinding,
BindingWorkersD1Binding,
BindingWorkersDispatchNamespaceBinding,
BindingWorkersMTLSCertBinding,
BindingWorkersMTLSCERTBinding,
]


Expand Down
6 changes: 3 additions & 3 deletions src/cloudflare/types/workers/scripts/setting_get_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"BindingWorkersDispatchNamespaceBinding",
"BindingWorkersDispatchNamespaceBindingOutbound",
"BindingWorkersDispatchNamespaceBindingOutboundWorker",
"BindingWorkersMTLSCertBinding",
"BindingWorkersMTLSCERTBinding",
"Migrations",
"MigrationsWorkersSingleStepMigrations",
"MigrationsWorkersSingleStepMigrationsRenamedClass",
Expand Down Expand Up @@ -149,7 +149,7 @@ class BindingWorkersDispatchNamespaceBinding(BaseModel):
"""Outbound worker"""


class BindingWorkersMTLSCertBinding(BaseModel):
class BindingWorkersMTLSCERTBinding(BaseModel):
name: str
"""A JavaScript variable name for the binding."""

Expand All @@ -168,7 +168,7 @@ class BindingWorkersMTLSCertBinding(BaseModel):
BindingWorkersQueueBinding,
BindingWorkersD1Binding,
BindingWorkersDispatchNamespaceBinding,
BindingWorkersMTLSCertBinding,
BindingWorkersMTLSCERTBinding,
]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"ResultBindingWorkersDispatchNamespaceBinding",
"ResultBindingWorkersDispatchNamespaceBindingOutbound",
"ResultBindingWorkersDispatchNamespaceBindingOutboundWorker",
"ResultBindingWorkersMTLSCertBinding",
"ResultBindingWorkersMTLSCERTBinding",
"ResultMigrations",
"ResultMigrationsWorkersSingleStepMigrations",
"ResultMigrationsWorkersSingleStepMigrationsRenamedClass",
Expand Down Expand Up @@ -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."""

Expand All @@ -168,7 +168,7 @@ class ResultBindingWorkersMTLSCertBinding(TypedDict, total=False):
ResultBindingWorkersQueueBinding,
ResultBindingWorkersD1Binding,
ResultBindingWorkersDispatchNamespaceBinding,
ResultBindingWorkersMTLSCertBinding,
ResultBindingWorkersMTLSCERTBinding,
]

_ResultMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords = TypedDict(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"BindingWorkersDispatchNamespaceBinding",
"BindingWorkersDispatchNamespaceBindingOutbound",
"BindingWorkersDispatchNamespaceBindingOutboundWorker",
"BindingWorkersMTLSCertBinding",
"BindingWorkersMTLSCERTBinding",
"Migrations",
"MigrationsWorkersSingleStepMigrations",
"MigrationsWorkersSingleStepMigrationsRenamedClass",
Expand Down Expand Up @@ -149,7 +149,7 @@ class BindingWorkersDispatchNamespaceBinding(BaseModel):
"""Outbound worker"""


class BindingWorkersMTLSCertBinding(BaseModel):
class BindingWorkersMTLSCERTBinding(BaseModel):
name: str
"""A JavaScript variable name for the binding."""

Expand All @@ -168,7 +168,7 @@ class BindingWorkersMTLSCertBinding(BaseModel):
BindingWorkersQueueBinding,
BindingWorkersD1Binding,
BindingWorkersDispatchNamespaceBinding,
BindingWorkersMTLSCertBinding,
BindingWorkersMTLSCERTBinding,
]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"BindingWorkersDispatchNamespaceBinding",
"BindingWorkersDispatchNamespaceBindingOutbound",
"BindingWorkersDispatchNamespaceBindingOutboundWorker",
"BindingWorkersMTLSCertBinding",
"BindingWorkersMTLSCERTBinding",
"Migrations",
"MigrationsWorkersSingleStepMigrations",
"MigrationsWorkersSingleStepMigrationsRenamedClass",
Expand Down Expand Up @@ -149,7 +149,7 @@ class BindingWorkersDispatchNamespaceBinding(BaseModel):
"""Outbound worker"""


class BindingWorkersMTLSCertBinding(BaseModel):
class BindingWorkersMTLSCERTBinding(BaseModel):
name: str
"""A JavaScript variable name for the binding."""

Expand All @@ -168,7 +168,7 @@ class BindingWorkersMTLSCertBinding(BaseModel):
BindingWorkersQueueBinding,
BindingWorkersD1Binding,
BindingWorkersDispatchNamespaceBinding,
BindingWorkersMTLSCertBinding,
BindingWorkersMTLSCERTBinding,
]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"WorkersDispatchNamespaceBinding",
"WorkersDispatchNamespaceBindingOutbound",
"WorkersDispatchNamespaceBindingOutboundWorker",
"WorkersMTLSCertBinding",
"WorkersMTLSCERTBinding",
]


Expand Down Expand Up @@ -136,7 +136,7 @@ class WorkersDispatchNamespaceBinding(BaseModel):
"""Outbound worker"""


class WorkersMTLSCertBinding(BaseModel):
class WorkersMTLSCERTBinding(BaseModel):
name: str
"""A JavaScript variable name for the binding."""

Expand All @@ -155,5 +155,5 @@ class WorkersMTLSCertBinding(BaseModel):
WorkersQueueBinding,
WorkersD1Binding,
WorkersDispatchNamespaceBinding,
WorkersMTLSCertBinding,
WorkersMTLSCERTBinding,
]
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"ResultBindingWorkersDispatchNamespaceBinding",
"ResultBindingWorkersDispatchNamespaceBindingOutbound",
"ResultBindingWorkersDispatchNamespaceBindingOutboundWorker",
"ResultBindingWorkersMTLSCertBinding",
"ResultBindingWorkersMTLSCERTBinding",
"ResultMigrations",
"ResultMigrationsWorkersSingleStepMigrations",
"ResultMigrationsWorkersSingleStepMigrationsRenamedClass",
Expand Down Expand Up @@ -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."""

Expand All @@ -168,7 +168,7 @@ class ResultBindingWorkersMTLSCertBinding(TypedDict, total=False):
ResultBindingWorkersQueueBinding,
ResultBindingWorkersD1Binding,
ResultBindingWorkersDispatchNamespaceBinding,
ResultBindingWorkersMTLSCertBinding,
ResultBindingWorkersMTLSCERTBinding,
]

_ResultMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords = TypedDict(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"BindingWorkersDispatchNamespaceBinding",
"BindingWorkersDispatchNamespaceBindingOutbound",
"BindingWorkersDispatchNamespaceBindingOutboundWorker",
"BindingWorkersMTLSCertBinding",
"BindingWorkersMTLSCERTBinding",
"Migrations",
"MigrationsWorkersSingleStepMigrations",
"MigrationsWorkersSingleStepMigrationsRenamedClass",
Expand Down Expand Up @@ -149,7 +149,7 @@ class BindingWorkersDispatchNamespaceBinding(BaseModel):
"""Outbound worker"""


class BindingWorkersMTLSCertBinding(BaseModel):
class BindingWorkersMTLSCERTBinding(BaseModel):
name: str
"""A JavaScript variable name for the binding."""

Expand All @@ -168,7 +168,7 @@ class BindingWorkersMTLSCertBinding(BaseModel):
BindingWorkersQueueBinding,
BindingWorkersD1Binding,
BindingWorkersDispatchNamespaceBinding,
BindingWorkersMTLSCertBinding,
BindingWorkersMTLSCERTBinding,
]


Expand Down
Loading

0 comments on commit 3c1de95

Please sign in to comment.