Skip to content

feat(api): update via SDK Studio #467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ Methods:
Types:

```python
from cloudflare.types.accounts import UserWithInviteCode, MemberListResponse, MemberDeleteResponse
from cloudflare.types.accounts import (
MemberStatus,
UserWithInviteCode,
MemberListResponse,
MemberDeleteResponse,
)
```

Methods:
Expand Down Expand Up @@ -1390,7 +1395,11 @@ Methods:
Types:

```python
from cloudflare.types.acm import TotalTLSCreateResponse, TotalTLSGetResponse
from cloudflare.types.acm import (
TotalTLSCertificateAuthority,
TotalTLSCreateResponse,
TotalTLSGetResponse,
)
```

Methods:
Expand Down Expand Up @@ -3225,6 +3234,7 @@ Types:
```python
from cloudflare.types.addressing import (
AddressMap,
AddressMapKind,
AddressMapCreateResponse,
AddressMapDeleteResponse,
AddressMapGetResponse,
Expand Down
8 changes: 4 additions & 4 deletions src/cloudflare/resources/acm/total_tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from __future__ import annotations

from typing import Type, Optional, cast
from typing_extensions import Literal

import httpx

Expand All @@ -21,12 +20,13 @@
async_to_streamed_response_wrapper,
)
from ..._wrappers import ResultWrapper
from ...types.acm import total_tls_create_params
from ...types.acm import TotalTLSCertificateAuthority, total_tls_create_params
from ..._base_client import (
make_request_options,
)
from ...types.acm.total_tls_get_response import TotalTLSGetResponse
from ...types.acm.total_tls_create_response import TotalTLSCreateResponse
from ...types.acm.total_tls_certificate_authority import TotalTLSCertificateAuthority

__all__ = ["TotalTLSResource", "AsyncTotalTLSResource"]

Expand All @@ -45,7 +45,7 @@ def create(
*,
zone_id: str,
enabled: bool,
certificate_authority: Literal["google", "lets_encrypt"] | NotGiven = NOT_GIVEN,
certificate_authority: TotalTLSCertificateAuthority | 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 @@ -147,7 +147,7 @@ async def create(
*,
zone_id: str,
enabled: bool,
certificate_authority: Literal["google", "lets_encrypt"] | NotGiven = NOT_GIVEN,
certificate_authority: TotalTLSCertificateAuthority | 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
1 change: 1 addition & 0 deletions src/cloudflare/types/accounts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from __future__ import annotations

from .account import Account as Account
from .member_status import MemberStatus as MemberStatus
from .role_get_response import RoleGetResponse as RoleGetResponse
from .member_list_params import MemberListParams as MemberListParams
from .account_list_params import AccountListParams as AccountListParams
Expand Down
7 changes: 7 additions & 0 deletions src/cloudflare/types/accounts/member_status.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing_extensions import Literal

__all__ = ["MemberStatus"]

MemberStatus = Literal["member", "invited"]
1 change: 1 addition & 0 deletions src/cloudflare/types/acm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
from .total_tls_get_response import TotalTLSGetResponse as TotalTLSGetResponse
from .total_tls_create_params import TotalTLSCreateParams as TotalTLSCreateParams
from .total_tls_create_response import TotalTLSCreateResponse as TotalTLSCreateResponse
from .total_tls_certificate_authority import TotalTLSCertificateAuthority as TotalTLSCertificateAuthority
7 changes: 7 additions & 0 deletions src/cloudflare/types/acm/total_tls_certificate_authority.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing_extensions import Literal

__all__ = ["TotalTLSCertificateAuthority"]

TotalTLSCertificateAuthority = Literal["google", "lets_encrypt"]
6 changes: 4 additions & 2 deletions src/cloudflare/types/acm/total_tls_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

from __future__ import annotations

from typing_extensions import Literal, Required, TypedDict
from typing_extensions import Required, TypedDict

from .total_tls_certificate_authority import TotalTLSCertificateAuthority

__all__ = ["TotalTLSCreateParams"]

Expand All @@ -17,5 +19,5 @@ class TotalTLSCreateParams(TypedDict, total=False):
proxied A, AAAA, or CNAME record in your zone.
"""

certificate_authority: Literal["google", "lets_encrypt"]
certificate_authority: TotalTLSCertificateAuthority
"""The Certificate Authority that Total TLS certificates will be issued through."""
3 changes: 2 additions & 1 deletion src/cloudflare/types/acm/total_tls_create_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
from typing_extensions import Literal

from ..._models import BaseModel
from .total_tls_certificate_authority import TotalTLSCertificateAuthority

__all__ = ["TotalTLSCreateResponse"]


class TotalTLSCreateResponse(BaseModel):
certificate_authority: Optional[Literal["google", "lets_encrypt"]] = None
certificate_authority: Optional[TotalTLSCertificateAuthority] = None
"""The Certificate Authority that Total TLS certificates will be issued through."""

enabled: Optional[bool] = None
Expand Down
3 changes: 2 additions & 1 deletion src/cloudflare/types/acm/total_tls_get_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
from typing_extensions import Literal

from ..._models import BaseModel
from .total_tls_certificate_authority import TotalTLSCertificateAuthority

__all__ = ["TotalTLSGetResponse"]


class TotalTLSGetResponse(BaseModel):
certificate_authority: Optional[Literal["google", "lets_encrypt"]] = None
certificate_authority: Optional[TotalTLSCertificateAuthority] = None
"""The Certificate Authority that Total TLS certificates will be issued through."""

enabled: Optional[bool] = None
Expand Down
1 change: 1 addition & 0 deletions src/cloudflare/types/addressing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from .prefix import Prefix as Prefix
from .address_map import AddressMap as AddressMap
from .address_map_kind import AddressMapKind as AddressMapKind
from .prefix_edit_params import PrefixEditParams as PrefixEditParams
from .prefix_create_params import PrefixCreateParams as PrefixCreateParams
from .service_list_response import ServiceListResponse as ServiceListResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

from typing import List, Optional
from datetime import datetime
from typing_extensions import Literal

from ..._models import BaseModel
from .address_map_kind import AddressMapKind

__all__ = ["AddressMapCreateResponse", "IP", "Membership"]

Expand All @@ -25,7 +25,7 @@ class Membership(BaseModel):
identifier: Optional[str] = None
"""Identifier"""

kind: Optional[Literal["zone", "account"]] = None
kind: Optional[AddressMapKind] = None
"""The type of the membership."""


Expand Down
4 changes: 2 additions & 2 deletions src/cloudflare/types/addressing/address_map_get_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

from typing import List, Optional
from datetime import datetime
from typing_extensions import Literal

from ..._models import BaseModel
from .address_map_kind import AddressMapKind

__all__ = ["AddressMapGetResponse", "IP", "Membership"]

Expand All @@ -25,7 +25,7 @@ class Membership(BaseModel):
identifier: Optional[str] = None
"""Identifier"""

kind: Optional[Literal["zone", "account"]] = None
kind: Optional[AddressMapKind] = None
"""The type of the membership."""


Expand Down
7 changes: 7 additions & 0 deletions src/cloudflare/types/addressing/address_map_kind.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing_extensions import Literal

__all__ = ["AddressMapKind"]

AddressMapKind = Literal["zone", "account"]
6 changes: 3 additions & 3 deletions src/cloudflare/types/rulesets/route_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from .logging import Logging
from ..._models import BaseModel

__all__ = ["RouteRule", "ActionParameters", "ActionParametersOrigin", "ActionParametersSni"]
__all__ = ["RouteRule", "ActionParameters", "ActionParametersOrigin", "ActionParametersSNI"]


class ActionParametersOrigin(BaseModel):
Expand All @@ -18,7 +18,7 @@ class ActionParametersOrigin(BaseModel):
"""Override the destination port."""


class ActionParametersSni(BaseModel):
class ActionParametersSNI(BaseModel):
value: str
"""The SNI override."""

Expand All @@ -30,7 +30,7 @@ class ActionParameters(BaseModel):
origin: Optional[ActionParametersOrigin] = None
"""Override the IP/TCP destination."""

sni: Optional[ActionParametersSni] = None
sni: Optional[ActionParametersSNI] = None
"""Override the Server Name Indication (SNI)."""


Expand Down
6 changes: 3 additions & 3 deletions src/cloudflare/types/rulesets/route_rule_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from .logging_param import LoggingParam

__all__ = ["RouteRuleParam", "ActionParameters", "ActionParametersOrigin", "ActionParametersSni"]
__all__ = ["RouteRuleParam", "ActionParameters", "ActionParametersOrigin", "ActionParametersSNI"]


class ActionParametersOrigin(TypedDict, total=False):
Expand All @@ -17,7 +17,7 @@ class ActionParametersOrigin(TypedDict, total=False):
"""Override the destination port."""


class ActionParametersSni(TypedDict, total=False):
class ActionParametersSNI(TypedDict, total=False):
value: Required[str]
"""The SNI override."""

Expand All @@ -29,7 +29,7 @@ class ActionParameters(TypedDict, total=False):
origin: ActionParametersOrigin
"""Override the IP/TCP destination."""

sni: ActionParametersSni
sni: ActionParametersSNI
"""Override the Server Name Indication (SNI)."""


Expand Down
6 changes: 3 additions & 3 deletions src/cloudflare/types/rulesets/rule_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"RouteRule",
"RouteRuleActionParameters",
"RouteRuleActionParametersOrigin",
"RouteRuleActionParametersSni",
"RouteRuleActionParametersSNI",
"ScoreRule",
"ScoreRuleActionParameters",
"ServeErrorRule",
Expand Down Expand Up @@ -588,7 +588,7 @@ class RouteRuleActionParametersOrigin(TypedDict, total=False):
"""Override the destination port."""


class RouteRuleActionParametersSni(TypedDict, total=False):
class RouteRuleActionParametersSNI(TypedDict, total=False):
value: Required[str]
"""The SNI override."""

Expand All @@ -600,7 +600,7 @@ class RouteRuleActionParameters(TypedDict, total=False):
origin: RouteRuleActionParametersOrigin
"""Override the IP/TCP destination."""

sni: RouteRuleActionParametersSni
sni: RouteRuleActionParametersSNI
"""Override the Server Name Indication (SNI)."""


Expand Down
6 changes: 3 additions & 3 deletions src/cloudflare/types/rulesets/rule_edit_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"RouteRule",
"RouteRuleActionParameters",
"RouteRuleActionParametersOrigin",
"RouteRuleActionParametersSni",
"RouteRuleActionParametersSNI",
"ScoreRule",
"ScoreRuleActionParameters",
"ServeErrorRule",
Expand Down Expand Up @@ -618,7 +618,7 @@ class RouteRuleActionParametersOrigin(TypedDict, total=False):
"""Override the destination port."""


class RouteRuleActionParametersSni(TypedDict, total=False):
class RouteRuleActionParametersSNI(TypedDict, total=False):
value: Required[str]
"""The SNI override."""

Expand All @@ -630,7 +630,7 @@ class RouteRuleActionParameters(TypedDict, total=False):
origin: RouteRuleActionParametersOrigin
"""Override the IP/TCP destination."""

sni: RouteRuleActionParametersSni
sni: RouteRuleActionParametersSNI
"""Override the Server Name Indication (SNI)."""


Expand Down
4 changes: 2 additions & 2 deletions src/cloudflare/types/user/organization.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Optional
from typing_extensions import Literal

from ..._models import BaseModel
from ..shared.permission import Permission
from ..accounts.member_status import MemberStatus

__all__ = ["Organization"]

Expand All @@ -22,5 +22,5 @@ class Organization(BaseModel):
roles: Optional[List[str]] = None
"""List of roles that a user has within an organization."""

status: Optional[Literal["member", "invited"]] = None
status: Optional[MemberStatus] = None
"""Whether the user is a member of the organization or has an inivitation pending."""
5 changes: 4 additions & 1 deletion tests/api_resources/acm/test_total_tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@

from cloudflare import Cloudflare, AsyncCloudflare
from tests.utils import assert_matches_type
from cloudflare.types.acm import TotalTLSGetResponse, TotalTLSCreateResponse
from cloudflare.types.acm import (
TotalTLSGetResponse,
TotalTLSCreateResponse,
)

base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")

Expand Down