Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#471)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed May 7, 2024
1 parent 6b8c3c3 commit 7fc60d8
Show file tree
Hide file tree
Showing 23 changed files with 91 additions and 137 deletions.
4 changes: 3 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from cloudflare.types import (
ASN,
AuditLog,
CertificateCA,
CertificateRequestType,
CloudflareTunnel,
ErrorData,
Expand Down Expand Up @@ -1042,7 +1043,9 @@ from cloudflare.types.load_balancers import (
OriginSteering,
RandomSteering,
Rules,
SessionAffinity,
SessionAffinityAttributes,
SteeringPolicy,
LoadBalancerDeleteResponse,
)
```
Expand Down Expand Up @@ -1284,7 +1287,6 @@ Types:

```python
from cloudflare.types.ssl import (
CertificateAuthority,
Host,
RequestValidity,
Status,
Expand Down
89 changes: 16 additions & 73 deletions src/cloudflare/resources/load_balancers/load_balancers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from __future__ import annotations

from typing import List, Type, Iterable, cast
from typing_extensions import Literal

import httpx

Expand Down Expand Up @@ -69,13 +68,17 @@
)
from .monitors.monitors import MonitorsResource, AsyncMonitorsResource
from ...types.load_balancers import (
SteeringPolicy,
SessionAffinity,
load_balancer_edit_params,
load_balancer_create_params,
load_balancer_update_params,
)
from ...types.load_balancers.rules_param import RulesParam
from ...types.load_balancers.default_pools import DefaultPools
from ...types.load_balancers.load_balancer import LoadBalancer
from ...types.load_balancers.steering_policy import SteeringPolicy
from ...types.load_balancers.session_affinity import SessionAffinity
from ...types.load_balancers.random_steering_param import RandomSteeringParam
from ...types.load_balancers.adaptive_routing_param import AdaptiveRoutingParam
from ...types.load_balancers.location_strategy_param import LocationStrategyParam
Expand Down Expand Up @@ -130,20 +133,10 @@ def create(
random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN,
region_pools: object | NotGiven = NOT_GIVEN,
rules: Iterable[RulesParam] | NotGiven = NOT_GIVEN,
session_affinity: Literal["none", "cookie", "ip_cookie", "header", '""'] | NotGiven = NOT_GIVEN,
session_affinity: SessionAffinity | NotGiven = NOT_GIVEN,
session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN,
session_affinity_ttl: float | NotGiven = NOT_GIVEN,
steering_policy: Literal[
"off",
"geo",
"random",
"dynamic_latency",
"proximity",
"least_outstanding_requests",
"least_connections",
'""',
]
| NotGiven = NOT_GIVEN,
steering_policy: SteeringPolicy | NotGiven = NOT_GIVEN,
ttl: 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.
Expand Down Expand Up @@ -330,20 +323,10 @@ def update(
random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN,
region_pools: object | NotGiven = NOT_GIVEN,
rules: Iterable[RulesParam] | NotGiven = NOT_GIVEN,
session_affinity: Literal["none", "cookie", "ip_cookie", "header", '""'] | NotGiven = NOT_GIVEN,
session_affinity: SessionAffinity | NotGiven = NOT_GIVEN,
session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN,
session_affinity_ttl: float | NotGiven = NOT_GIVEN,
steering_policy: Literal[
"off",
"geo",
"random",
"dynamic_latency",
"proximity",
"least_outstanding_requests",
"least_connections",
'""',
]
| NotGiven = NOT_GIVEN,
steering_policy: SteeringPolicy | NotGiven = NOT_GIVEN,
ttl: 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.
Expand Down Expand Up @@ -609,20 +592,10 @@ def edit(
random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN,
region_pools: object | NotGiven = NOT_GIVEN,
rules: Iterable[RulesParam] | NotGiven = NOT_GIVEN,
session_affinity: Literal["none", "cookie", "ip_cookie", "header", '""'] | NotGiven = NOT_GIVEN,
session_affinity: SessionAffinity | NotGiven = NOT_GIVEN,
session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN,
session_affinity_ttl: float | NotGiven = NOT_GIVEN,
steering_policy: Literal[
"off",
"geo",
"random",
"dynamic_latency",
"proximity",
"least_outstanding_requests",
"least_connections",
'""',
]
| NotGiven = NOT_GIVEN,
steering_policy: SteeringPolicy | NotGiven = NOT_GIVEN,
ttl: 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.
Expand Down Expand Up @@ -882,20 +855,10 @@ async def create(
random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN,
region_pools: object | NotGiven = NOT_GIVEN,
rules: Iterable[RulesParam] | NotGiven = NOT_GIVEN,
session_affinity: Literal["none", "cookie", "ip_cookie", "header", '""'] | NotGiven = NOT_GIVEN,
session_affinity: SessionAffinity | NotGiven = NOT_GIVEN,
session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN,
session_affinity_ttl: float | NotGiven = NOT_GIVEN,
steering_policy: Literal[
"off",
"geo",
"random",
"dynamic_latency",
"proximity",
"least_outstanding_requests",
"least_connections",
'""',
]
| NotGiven = NOT_GIVEN,
steering_policy: SteeringPolicy | NotGiven = NOT_GIVEN,
ttl: 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.
Expand Down Expand Up @@ -1082,20 +1045,10 @@ async def update(
random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN,
region_pools: object | NotGiven = NOT_GIVEN,
rules: Iterable[RulesParam] | NotGiven = NOT_GIVEN,
session_affinity: Literal["none", "cookie", "ip_cookie", "header", '""'] | NotGiven = NOT_GIVEN,
session_affinity: SessionAffinity | NotGiven = NOT_GIVEN,
session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN,
session_affinity_ttl: float | NotGiven = NOT_GIVEN,
steering_policy: Literal[
"off",
"geo",
"random",
"dynamic_latency",
"proximity",
"least_outstanding_requests",
"least_connections",
'""',
]
| NotGiven = NOT_GIVEN,
steering_policy: SteeringPolicy | NotGiven = NOT_GIVEN,
ttl: 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.
Expand Down Expand Up @@ -1361,20 +1314,10 @@ async def edit(
random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN,
region_pools: object | NotGiven = NOT_GIVEN,
rules: Iterable[RulesParam] | NotGiven = NOT_GIVEN,
session_affinity: Literal["none", "cookie", "ip_cookie", "header", '""'] | NotGiven = NOT_GIVEN,
session_affinity: SessionAffinity | NotGiven = NOT_GIVEN,
session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN,
session_affinity_ttl: float | NotGiven = NOT_GIVEN,
steering_policy: Literal[
"off",
"geo",
"random",
"dynamic_latency",
"proximity",
"least_outstanding_requests",
"least_connections",
'""',
]
| NotGiven = NOT_GIVEN,
steering_policy: SteeringPolicy | NotGiven = NOT_GIVEN,
ttl: 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.
Expand Down
1 change: 1 addition & 0 deletions src/cloudflare/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
Identifier as Identifier,
Permission as Permission,
ResponseInfo as ResponseInfo,
CertificateCA as CertificateCA,
PaginationInfo as PaginationInfo,
PermissionGrant as PermissionGrant,
CloudflareTunnel as CloudflareTunnel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

from .dcv_method import DCVMethod
from .bundle_method import BundleMethod
from ..shared.certificate_ca import CertificateCA
from .domain_validation_type import DomainValidationType
from ..ssl.certificate_authority import CertificateAuthority

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

Expand Down Expand Up @@ -56,7 +56,7 @@ class SSL(TypedDict, total=False):
chain, but does not otherwise modify it.
"""

certificate_authority: CertificateAuthority
certificate_authority: CertificateCA
"""The Certificate Authority that will issue the certificate"""

custom_certificate: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from ..._models import BaseModel
from .dcv_method import DCVMethod
from .bundle_method import BundleMethod
from ..shared.certificate_ca import CertificateCA
from .domain_validation_type import DomainValidationType
from ..ssl.certificate_authority import CertificateAuthority

__all__ = [
"CustomHostnameCreateResponse",
Expand Down Expand Up @@ -88,7 +88,7 @@ class SSL(BaseModel):
chain, but does not otherwise modify it.
"""

certificate_authority: Optional[CertificateAuthority] = None
certificate_authority: Optional[CertificateCA] = None
"""The Certificate Authority that will issue the certificate"""

custom_certificate: Optional[str] = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

from .dcv_method import DCVMethod
from .bundle_method import BundleMethod
from ..shared.certificate_ca import CertificateCA
from .domain_validation_type import DomainValidationType
from ..ssl.certificate_authority import CertificateAuthority

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

Expand Down Expand Up @@ -73,7 +73,7 @@ class SSL(TypedDict, total=False):
chain, but does not otherwise modify it.
"""

certificate_authority: CertificateAuthority
certificate_authority: CertificateCA
"""The Certificate Authority that will issue the certificate"""

custom_certificate: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from ..._models import BaseModel
from .dcv_method import DCVMethod
from .bundle_method import BundleMethod
from ..shared.certificate_ca import CertificateCA
from .domain_validation_type import DomainValidationType
from ..ssl.certificate_authority import CertificateAuthority

__all__ = [
"CustomHostnameEditResponse",
Expand Down Expand Up @@ -88,7 +88,7 @@ class SSL(BaseModel):
chain, but does not otherwise modify it.
"""

certificate_authority: Optional[CertificateAuthority] = None
certificate_authority: Optional[CertificateCA] = None
"""The Certificate Authority that will issue the certificate"""

custom_certificate: Optional[str] = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from ..._models import BaseModel
from .dcv_method import DCVMethod
from .bundle_method import BundleMethod
from ..shared.certificate_ca import CertificateCA
from .domain_validation_type import DomainValidationType
from ..ssl.certificate_authority import CertificateAuthority

__all__ = [
"CustomHostnameGetResponse",
Expand Down Expand Up @@ -88,7 +88,7 @@ class SSL(BaseModel):
chain, but does not otherwise modify it.
"""

certificate_authority: Optional[CertificateAuthority] = None
certificate_authority: Optional[CertificateCA] = None
"""The Certificate Authority that will issue the certificate"""

custom_certificate: Optional[str] = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from ..._models import BaseModel
from .dcv_method import DCVMethod
from .bundle_method import BundleMethod
from ..shared.certificate_ca import CertificateCA
from .domain_validation_type import DomainValidationType
from ..ssl.certificate_authority import CertificateAuthority

__all__ = [
"CustomHostnameListResponse",
Expand Down Expand Up @@ -88,7 +88,7 @@ class SSL(BaseModel):
chain, but does not otherwise modify it.
"""

certificate_authority: Optional[CertificateAuthority] = None
certificate_authority: Optional[CertificateCA] = None
"""The Certificate Authority that will issue the certificate"""

custom_certificate: Optional[str] = None
Expand Down
2 changes: 2 additions & 0 deletions src/cloudflare/types/load_balancers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
from .filter_options import FilterOptions as FilterOptions
from .origin_steering import OriginSteering as OriginSteering
from .random_steering import RandomSteering as RandomSteering
from .steering_policy import SteeringPolicy as SteeringPolicy
from .adaptive_routing import AdaptiveRouting as AdaptiveRouting
from .pool_edit_params import PoolEditParams as PoolEditParams
from .pool_list_params import PoolListParams as PoolListParams
from .session_affinity import SessionAffinity as SessionAffinity
from .location_strategy import LocationStrategy as LocationStrategy
from .search_get_params import SearchGetParams as SearchGetParams
from .pool_create_params import PoolCreateParams as PoolCreateParams
Expand Down
18 changes: 4 additions & 14 deletions src/cloudflare/types/load_balancers/load_balancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

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

from .rules import Rules
from ..._models import BaseModel
from .default_pools import DefaultPools
from .random_steering import RandomSteering
from .steering_policy import SteeringPolicy
from .adaptive_routing import AdaptiveRouting
from .session_affinity import SessionAffinity
from .location_strategy import LocationStrategy
from .session_affinity_attributes import SessionAffinityAttributes

Expand Down Expand Up @@ -104,7 +105,7 @@ class LoadBalancer(BaseModel):
execute.
"""

session_affinity: Optional[Literal["none", "cookie", "ip_cookie", "header", '""']] = None
session_affinity: Optional[SessionAffinity] = None
"""
Specifies the type of session affinity the load balancer should use unless
specified as `"none"` or "" (default). The supported types are:
Expand Down Expand Up @@ -148,18 +149,7 @@ class LoadBalancer(BaseModel):
number of seconds specified.
"""

steering_policy: Optional[
Literal[
"off",
"geo",
"random",
"dynamic_latency",
"proximity",
"least_outstanding_requests",
"least_connections",
'""',
]
] = None
steering_policy: Optional[SteeringPolicy] = None
"""Steering Policy for this load balancer.
- `"off"`: Use `default_pools`.
Expand Down
Loading

0 comments on commit 7fc60d8

Please sign in to comment.