Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 22, 2024
1 parent a39f413 commit 395d47f
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 124 deletions.
13 changes: 6 additions & 7 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,6 @@ Types:
```python
from cloudflare.types import (
CustomHostname,
CustomMetadata,
UnnamedSchemaRef16aca57bde2963201c7e6e895436c1c1,
UnnamedSchemaRef78adb375f06c6d462dd92b99e2ecf510,
UnnamedSchemaRef9a9935a9a770967bb604ae41a81e42e1,
Expand Down Expand Up @@ -1673,16 +1672,16 @@ Methods:
Types:

```python
from cloudflare.types.email_routing import Action, EmailRule, Matcher
from cloudflare.types.email_routing import Action, EmailRoutingRule, Matcher
```

Methods:

- <code title="post /zones/{zone_identifier}/email/routing/rules">client.email_routing.rules.<a href="./src/cloudflare/resources/email_routing/rules/rules.py">create</a>(zone_identifier, \*\*<a href="src/cloudflare/types/email_routing/rule_create_params.py">params</a>) -> <a href="./src/cloudflare/types/email_routing/email_rule.py">EmailRule</a></code>
- <code title="put /zones/{zone_identifier}/email/routing/rules/{rule_identifier}">client.email_routing.rules.<a href="./src/cloudflare/resources/email_routing/rules/rules.py">update</a>(rule_identifier, \*, zone_identifier, \*\*<a href="src/cloudflare/types/email_routing/rule_update_params.py">params</a>) -> <a href="./src/cloudflare/types/email_routing/email_rule.py">EmailRule</a></code>
- <code title="get /zones/{zone_identifier}/email/routing/rules">client.email_routing.rules.<a href="./src/cloudflare/resources/email_routing/rules/rules.py">list</a>(zone_identifier, \*\*<a href="src/cloudflare/types/email_routing/rule_list_params.py">params</a>) -> <a href="./src/cloudflare/types/email_routing/email_rule.py">SyncV4PagePaginationArray[EmailRule]</a></code>
- <code title="delete /zones/{zone_identifier}/email/routing/rules/{rule_identifier}">client.email_routing.rules.<a href="./src/cloudflare/resources/email_routing/rules/rules.py">delete</a>(rule_identifier, \*, zone_identifier) -> <a href="./src/cloudflare/types/email_routing/email_rule.py">EmailRule</a></code>
- <code title="get /zones/{zone_identifier}/email/routing/rules/{rule_identifier}">client.email_routing.rules.<a href="./src/cloudflare/resources/email_routing/rules/rules.py">get</a>(rule_identifier, \*, zone_identifier) -> <a href="./src/cloudflare/types/email_routing/email_rule.py">EmailRule</a></code>
- <code title="post /zones/{zone_identifier}/email/routing/rules">client.email_routing.rules.<a href="./src/cloudflare/resources/email_routing/rules/rules.py">create</a>(zone_identifier, \*\*<a href="src/cloudflare/types/email_routing/rule_create_params.py">params</a>) -> <a href="./src/cloudflare/types/email_routing/email_routing_rule.py">EmailRoutingRule</a></code>
- <code title="put /zones/{zone_identifier}/email/routing/rules/{rule_identifier}">client.email_routing.rules.<a href="./src/cloudflare/resources/email_routing/rules/rules.py">update</a>(rule_identifier, \*, zone_identifier, \*\*<a href="src/cloudflare/types/email_routing/rule_update_params.py">params</a>) -> <a href="./src/cloudflare/types/email_routing/email_routing_rule.py">EmailRoutingRule</a></code>
- <code title="get /zones/{zone_identifier}/email/routing/rules">client.email_routing.rules.<a href="./src/cloudflare/resources/email_routing/rules/rules.py">list</a>(zone_identifier, \*\*<a href="src/cloudflare/types/email_routing/rule_list_params.py">params</a>) -> <a href="./src/cloudflare/types/email_routing/email_routing_rule.py">SyncV4PagePaginationArray[EmailRoutingRule]</a></code>
- <code title="delete /zones/{zone_identifier}/email/routing/rules/{rule_identifier}">client.email_routing.rules.<a href="./src/cloudflare/resources/email_routing/rules/rules.py">delete</a>(rule_identifier, \*, zone_identifier) -> <a href="./src/cloudflare/types/email_routing/email_routing_rule.py">EmailRoutingRule</a></code>
- <code title="get /zones/{zone_identifier}/email/routing/rules/{rule_identifier}">client.email_routing.rules.<a href="./src/cloudflare/resources/email_routing/rules/rules.py">get</a>(rule_identifier, \*, zone_identifier) -> <a href="./src/cloudflare/types/email_routing/email_routing_rule.py">EmailRoutingRule</a></code>

### CatchAlls

Expand Down
9 changes: 4 additions & 5 deletions src/cloudflare/resources/custom_hostnames/custom_hostnames.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from ...types import (
CustomHostname,
CustomMetadataParam,
CustomHostnameDeleteResponse,
custom_hostname_edit_params,
custom_hostname_list_params,
Expand Down Expand Up @@ -66,7 +65,7 @@ def create(
zone_id: str,
hostname: str,
ssl: custom_hostname_create_params.SSL,
custom_metadata: CustomMetadataParam | NotGiven = NOT_GIVEN,
custom_metadata: custom_hostname_create_params.CustomMetadata | 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,
Expand Down Expand Up @@ -244,7 +243,7 @@ def edit(
custom_hostname_id: str,
*,
zone_id: str,
custom_metadata: CustomMetadataParam | NotGiven = NOT_GIVEN,
custom_metadata: custom_hostname_edit_params.CustomMetadata | NotGiven = NOT_GIVEN,
custom_origin_server: str | NotGiven = NOT_GIVEN,
custom_origin_sni: str | NotGiven = NOT_GIVEN,
ssl: custom_hostname_edit_params.SSL | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -377,7 +376,7 @@ async def create(
zone_id: str,
hostname: str,
ssl: custom_hostname_create_params.SSL,
custom_metadata: CustomMetadataParam | NotGiven = NOT_GIVEN,
custom_metadata: custom_hostname_create_params.CustomMetadata | 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,
Expand Down Expand Up @@ -555,7 +554,7 @@ async def edit(
custom_hostname_id: str,
*,
zone_id: str,
custom_metadata: CustomMetadataParam | NotGiven = NOT_GIVEN,
custom_metadata: custom_hostname_edit_params.CustomMetadata | NotGiven = NOT_GIVEN,
custom_origin_server: str | NotGiven = NOT_GIVEN,
custom_origin_sni: str | NotGiven = NOT_GIVEN,
ssl: custom_hostname_edit_params.SSL | NotGiven = NOT_GIVEN,
Expand Down
46 changes: 23 additions & 23 deletions src/cloudflare/resources/email_routing/rules/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
make_request_options,
)
from ....types.email_routing import (
EmailRule,
ActionParam,
MatcherParam,
EmailRoutingRule,
rule_list_params,
rule_create_params,
rule_update_params,
Expand Down Expand Up @@ -74,7 +74,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> EmailRule:
) -> EmailRoutingRule:
"""
Rules consist of a set of criteria for matching emails (such as an email being
sent to a specific custom email address) plus a set of actions to take on the
Expand Down Expand Up @@ -122,7 +122,7 @@ def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[EmailRule], ResultWrapper[EmailRule]),
cast_to=cast(Type[EmailRoutingRule], ResultWrapper[EmailRoutingRule]),
)

def update(
Expand All @@ -141,7 +141,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> EmailRule:
) -> EmailRoutingRule:
"""
Update actions and matches, or enable/disable specific routing rules.
Expand Down Expand Up @@ -191,7 +191,7 @@ def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[EmailRule], ResultWrapper[EmailRule]),
cast_to=cast(Type[EmailRoutingRule], ResultWrapper[EmailRoutingRule]),
)

def list(
Expand All @@ -207,7 +207,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncV4PagePaginationArray[EmailRule]:
) -> SyncV4PagePaginationArray[EmailRoutingRule]:
"""
Lists existing routing rules.
Expand All @@ -232,7 +232,7 @@ def list(
raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}")
return self._get_api_list(
f"/zones/{zone_identifier}/email/routing/rules",
page=SyncV4PagePaginationArray[EmailRule],
page=SyncV4PagePaginationArray[EmailRoutingRule],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand All @@ -247,7 +247,7 @@ def list(
rule_list_params.RuleListParams,
),
),
model=EmailRule,
model=EmailRoutingRule,
)

def delete(
Expand All @@ -261,7 +261,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> EmailRule:
) -> EmailRoutingRule:
"""
Delete a specific routing rule.
Expand Down Expand Up @@ -291,7 +291,7 @@ def delete(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[EmailRule], ResultWrapper[EmailRule]),
cast_to=cast(Type[EmailRoutingRule], ResultWrapper[EmailRoutingRule]),
)

def get(
Expand All @@ -305,7 +305,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> EmailRule:
) -> EmailRoutingRule:
"""
Get information for a specific routing rule already created.
Expand Down Expand Up @@ -335,7 +335,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[EmailRule], ResultWrapper[EmailRule]),
cast_to=cast(Type[EmailRoutingRule], ResultWrapper[EmailRoutingRule]),
)


Expand Down Expand Up @@ -367,7 +367,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> EmailRule:
) -> EmailRoutingRule:
"""
Rules consist of a set of criteria for matching emails (such as an email being
sent to a specific custom email address) plus a set of actions to take on the
Expand Down Expand Up @@ -415,7 +415,7 @@ async def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[EmailRule], ResultWrapper[EmailRule]),
cast_to=cast(Type[EmailRoutingRule], ResultWrapper[EmailRoutingRule]),
)

async def update(
Expand All @@ -434,7 +434,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> EmailRule:
) -> EmailRoutingRule:
"""
Update actions and matches, or enable/disable specific routing rules.
Expand Down Expand Up @@ -484,7 +484,7 @@ async def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[EmailRule], ResultWrapper[EmailRule]),
cast_to=cast(Type[EmailRoutingRule], ResultWrapper[EmailRoutingRule]),
)

def list(
Expand All @@ -500,7 +500,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[EmailRule, AsyncV4PagePaginationArray[EmailRule]]:
) -> AsyncPaginator[EmailRoutingRule, AsyncV4PagePaginationArray[EmailRoutingRule]]:
"""
Lists existing routing rules.
Expand All @@ -525,7 +525,7 @@ def list(
raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}")
return self._get_api_list(
f"/zones/{zone_identifier}/email/routing/rules",
page=AsyncV4PagePaginationArray[EmailRule],
page=AsyncV4PagePaginationArray[EmailRoutingRule],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand All @@ -540,7 +540,7 @@ def list(
rule_list_params.RuleListParams,
),
),
model=EmailRule,
model=EmailRoutingRule,
)

async def delete(
Expand All @@ -554,7 +554,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> EmailRule:
) -> EmailRoutingRule:
"""
Delete a specific routing rule.
Expand Down Expand Up @@ -584,7 +584,7 @@ async def delete(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[EmailRule], ResultWrapper[EmailRule]),
cast_to=cast(Type[EmailRoutingRule], ResultWrapper[EmailRoutingRule]),
)

async def get(
Expand All @@ -598,7 +598,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> EmailRule:
) -> EmailRoutingRule:
"""
Get information for a specific routing rule already created.
Expand Down Expand Up @@ -628,7 +628,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[EmailRule], ResultWrapper[EmailRule]),
cast_to=cast(Type[EmailRoutingRule], ResultWrapper[EmailRoutingRule]),
)


Expand Down
1 change: 0 additions & 1 deletion src/cloudflare/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@
from .account_update_params import AccountUpdateParams as AccountUpdateParams
from .audit_log_list_params import AuditLogListParams as AuditLogListParams
from .calls_app_with_secret import CallsAppWithSecret as CallsAppWithSecret
from .custom_metadata_param import CustomMetadataParam as CustomMetadataParam
from .origin_ca_certificate import OriginCACertificate as OriginCACertificate
from .origin_steering_param import OriginSteeringParam as OriginSteeringParam
from .queue_create_response import QueueCreateResponse as QueueCreateResponse
Expand Down
7 changes: 6 additions & 1 deletion src/cloudflare/types/custom_hostname.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
from typing_extensions import Literal

from .._models import BaseModel
from .custom_metadata import CustomMetadata
from .unnamed_schema_ref_9a9935a9a770967bb604ae41a81e42e1 import UnnamedSchemaRef9a9935a9a770967bb604ae41a81e42e1
from .unnamed_schema_ref_16aca57bde2963201c7e6e895436c1c1 import UnnamedSchemaRef16aca57bde2963201c7e6e895436c1c1
from .unnamed_schema_ref_78adb375f06c6d462dd92b99e2ecf510 import UnnamedSchemaRef78adb375f06c6d462dd92b99e2ecf510

__all__ = [
"CustomHostname",
"CustomMetadata",
"OwnershipVerification",
"OwnershipVerificationHTTP",
"SSL",
Expand All @@ -21,6 +21,11 @@
]


class CustomMetadata(BaseModel):
key: Optional[str] = None
"""Unique metadata for this hostname."""


class OwnershipVerification(BaseModel):
name: Optional[str] = None
"""DNS Name for record."""
Expand Down
10 changes: 7 additions & 3 deletions src/cloudflare/types/custom_hostname_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
from typing import List
from typing_extensions import Literal, Required, TypedDict

from .custom_metadata_param import CustomMetadataParam
from .unnamed_schema_ref_9a9935a9a770967bb604ae41a81e42e1 import UnnamedSchemaRef9a9935a9a770967bb604ae41a81e42e1
from .unnamed_schema_ref_16aca57bde2963201c7e6e895436c1c1 import UnnamedSchemaRef16aca57bde2963201c7e6e895436c1c1
from .unnamed_schema_ref_78adb375f06c6d462dd92b99e2ecf510 import UnnamedSchemaRef78adb375f06c6d462dd92b99e2ecf510

__all__ = ["CustomHostnameCreateParams", "SSL", "SSLSettings"]
__all__ = ["CustomHostnameCreateParams", "SSL", "SSLSettings", "CustomMetadata"]


class CustomHostnameCreateParams(TypedDict, total=False):
Expand All @@ -23,7 +22,7 @@ class CustomHostnameCreateParams(TypedDict, total=False):
ssl: Required[SSL]
"""SSL properties used when creating the custom hostname."""

custom_metadata: CustomMetadataParam
custom_metadata: CustomMetadata
"""These are per-hostname (customer) settings."""


Expand Down Expand Up @@ -79,3 +78,8 @@ class SSL(TypedDict, total=False):

wildcard: bool
"""Indicates whether the certificate covers a wildcard."""


class CustomMetadata(TypedDict, total=False):
key: str
"""Unique metadata for this hostname."""
10 changes: 7 additions & 3 deletions src/cloudflare/types/custom_hostname_edit_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@
from typing import List
from typing_extensions import Literal, Required, TypedDict

from .custom_metadata_param import CustomMetadataParam
from .unnamed_schema_ref_9a9935a9a770967bb604ae41a81e42e1 import UnnamedSchemaRef9a9935a9a770967bb604ae41a81e42e1
from .unnamed_schema_ref_16aca57bde2963201c7e6e895436c1c1 import UnnamedSchemaRef16aca57bde2963201c7e6e895436c1c1
from .unnamed_schema_ref_78adb375f06c6d462dd92b99e2ecf510 import UnnamedSchemaRef78adb375f06c6d462dd92b99e2ecf510

__all__ = ["CustomHostnameEditParams", "SSL", "SSLSettings"]
__all__ = ["CustomHostnameEditParams", "CustomMetadata", "SSL", "SSLSettings"]


class CustomHostnameEditParams(TypedDict, total=False):
zone_id: Required[str]
"""Identifier"""

custom_metadata: CustomMetadataParam
custom_metadata: CustomMetadata
"""These are per-hostname (customer) settings."""

custom_origin_server: str
Expand All @@ -39,6 +38,11 @@ class CustomHostnameEditParams(TypedDict, total=False):
"""SSL properties used when creating the custom hostname."""


class CustomMetadata(TypedDict, total=False):
key: str
"""Unique metadata for this hostname."""


class SSLSettings(TypedDict, total=False):
ciphers: List[str]
"""An allowlist of ciphers for TLS termination.
Expand Down
12 changes: 0 additions & 12 deletions src/cloudflare/types/custom_metadata_param.py

This file was deleted.

Loading

0 comments on commit 395d47f

Please sign in to comment.