From 7fc60d8c253a50ff314228ef650a22e58417f745 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 04:39:01 +0000 Subject: [PATCH] feat(api): update via SDK Studio (#471) --- api.md | 4 +- .../load_balancers/load_balancers.py | 89 ++++--------------- src/cloudflare/types/__init__.py | 1 + .../custom_hostname_create_params.py | 4 +- .../custom_hostname_create_response.py | 4 +- .../custom_hostname_edit_params.py | 4 +- .../custom_hostname_edit_response.py | 4 +- .../custom_hostname_get_response.py | 4 +- .../custom_hostname_list_response.py | 4 +- .../types/load_balancers/__init__.py | 2 + .../types/load_balancers/load_balancer.py | 18 +--- .../load_balancer_create_params.py | 10 +-- .../load_balancer_edit_params.py | 10 +-- .../load_balancer_update_params.py | 10 +-- src/cloudflare/types/load_balancers/rules.py | 18 +--- .../types/load_balancers/rules_param.py | 10 +-- .../session_affinity.py} | 4 +- .../types/load_balancers/steering_policy.py | 9 ++ src/cloudflare/types/shared/__init__.py | 1 + src/cloudflare/types/shared/certificate_ca.py | 7 ++ .../types/shared_params/__init__.py | 1 + .../types/shared_params/certificate_ca.py | 9 ++ src/cloudflare/types/ssl/__init__.py | 1 - 23 files changed, 91 insertions(+), 137 deletions(-) rename src/cloudflare/types/{ssl/certificate_authority.py => load_balancers/session_affinity.py} (54%) create mode 100644 src/cloudflare/types/load_balancers/steering_policy.py create mode 100644 src/cloudflare/types/shared/certificate_ca.py create mode 100644 src/cloudflare/types/shared_params/certificate_ca.py diff --git a/api.md b/api.md index 3827413a429..da2eed346f5 100644 --- a/api.md +++ b/api.md @@ -4,6 +4,7 @@ from cloudflare.types import ( ASN, AuditLog, + CertificateCA, CertificateRequestType, CloudflareTunnel, ErrorData, @@ -1042,7 +1043,9 @@ from cloudflare.types.load_balancers import ( OriginSteering, RandomSteering, Rules, + SessionAffinity, SessionAffinityAttributes, + SteeringPolicy, LoadBalancerDeleteResponse, ) ``` @@ -1284,7 +1287,6 @@ Types: ```python from cloudflare.types.ssl import ( - CertificateAuthority, Host, RequestValidity, Status, diff --git a/src/cloudflare/resources/load_balancers/load_balancers.py b/src/cloudflare/resources/load_balancers/load_balancers.py index f63334101c1..251ee8f97bb 100644 --- a/src/cloudflare/resources/load_balancers/load_balancers.py +++ b/src/cloudflare/resources/load_balancers/load_balancers.py @@ -3,7 +3,6 @@ from __future__ import annotations from typing import List, Type, Iterable, cast -from typing_extensions import Literal import httpx @@ -69,6 +68,8 @@ ) 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, @@ -76,6 +77,8 @@ 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 @@ -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. @@ -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. @@ -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. @@ -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. @@ -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. @@ -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. diff --git a/src/cloudflare/types/__init__.py b/src/cloudflare/types/__init__.py index e5d0a72b561..99ea53c6e3d 100644 --- a/src/cloudflare/types/__init__.py +++ b/src/cloudflare/types/__init__.py @@ -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, diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py b/src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py index ead0b1d5931..d47976e8d28 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py @@ -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"] @@ -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 diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_create_response.py b/src/cloudflare/types/custom_hostnames/custom_hostname_create_response.py index ba359b4a128..dfe7fd48f7f 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_create_response.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_create_response.py @@ -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", @@ -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 diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py b/src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py index b135722e804..52e45f8ec77 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py @@ -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"] @@ -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 diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_edit_response.py b/src/cloudflare/types/custom_hostnames/custom_hostname_edit_response.py index 793c9949881..c566f4a4411 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_edit_response.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_edit_response.py @@ -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", @@ -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 diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_get_response.py b/src/cloudflare/types/custom_hostnames/custom_hostname_get_response.py index eb4b90a307c..16d15f4f222 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_get_response.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_get_response.py @@ -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", @@ -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 diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_list_response.py b/src/cloudflare/types/custom_hostnames/custom_hostname_list_response.py index b79f5a32db3..691ee91af4e 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_list_response.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_list_response.py @@ -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", @@ -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 diff --git a/src/cloudflare/types/load_balancers/__init__.py b/src/cloudflare/types/load_balancers/__init__.py index bbd0f9aa489..46d78e92ec5 100644 --- a/src/cloudflare/types/load_balancers/__init__.py +++ b/src/cloudflare/types/load_balancers/__init__.py @@ -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 diff --git a/src/cloudflare/types/load_balancers/load_balancer.py b/src/cloudflare/types/load_balancers/load_balancer.py index 242171cacb2..11e17929346 100644 --- a/src/cloudflare/types/load_balancers/load_balancer.py +++ b/src/cloudflare/types/load_balancers/load_balancer.py @@ -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 @@ -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: @@ -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`. diff --git a/src/cloudflare/types/load_balancers/load_balancer_create_params.py b/src/cloudflare/types/load_balancers/load_balancer_create_params.py index 173adfbeb31..74a4d9d4742 100644 --- a/src/cloudflare/types/load_balancers/load_balancer_create_params.py +++ b/src/cloudflare/types/load_balancers/load_balancer_create_params.py @@ -3,10 +3,12 @@ from __future__ import annotations from typing import List, Iterable -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Required, TypedDict from .rules_param import RulesParam from .default_pools import DefaultPools +from .steering_policy import SteeringPolicy +from .session_affinity import SessionAffinity from .random_steering_param import RandomSteeringParam from .adaptive_routing_param import AdaptiveRoutingParam from .location_strategy_param import LocationStrategyParam @@ -97,7 +99,7 @@ class LoadBalancerCreateParams(TypedDict, total=False): execute. """ - session_affinity: Literal["none", "cookie", "ip_cookie", "header", '""'] + session_affinity: SessionAffinity """ Specifies the type of session affinity the load balancer should use unless specified as `"none"` or "" (default). The supported types are: @@ -141,9 +143,7 @@ class LoadBalancerCreateParams(TypedDict, total=False): number of seconds specified. """ - steering_policy: Literal[ - "off", "geo", "random", "dynamic_latency", "proximity", "least_outstanding_requests", "least_connections", '""' - ] + steering_policy: SteeringPolicy """Steering Policy for this load balancer. - `"off"`: Use `default_pools`. diff --git a/src/cloudflare/types/load_balancers/load_balancer_edit_params.py b/src/cloudflare/types/load_balancers/load_balancer_edit_params.py index 5848c3bf5ea..54a9a2ab9c6 100644 --- a/src/cloudflare/types/load_balancers/load_balancer_edit_params.py +++ b/src/cloudflare/types/load_balancers/load_balancer_edit_params.py @@ -3,10 +3,12 @@ from __future__ import annotations from typing import List, Iterable -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Required, TypedDict from .rules_param import RulesParam from .default_pools import DefaultPools +from .steering_policy import SteeringPolicy +from .session_affinity import SessionAffinity from .random_steering_param import RandomSteeringParam from .adaptive_routing_param import AdaptiveRoutingParam from .location_strategy_param import LocationStrategyParam @@ -100,7 +102,7 @@ class LoadBalancerEditParams(TypedDict, total=False): execute. """ - session_affinity: Literal["none", "cookie", "ip_cookie", "header", '""'] + session_affinity: SessionAffinity """ Specifies the type of session affinity the load balancer should use unless specified as `"none"` or "" (default). The supported types are: @@ -144,9 +146,7 @@ class LoadBalancerEditParams(TypedDict, total=False): number of seconds specified. """ - steering_policy: Literal[ - "off", "geo", "random", "dynamic_latency", "proximity", "least_outstanding_requests", "least_connections", '""' - ] + steering_policy: SteeringPolicy """Steering Policy for this load balancer. - `"off"`: Use `default_pools`. diff --git a/src/cloudflare/types/load_balancers/load_balancer_update_params.py b/src/cloudflare/types/load_balancers/load_balancer_update_params.py index 1c8db91d1c4..4055e4c5438 100644 --- a/src/cloudflare/types/load_balancers/load_balancer_update_params.py +++ b/src/cloudflare/types/load_balancers/load_balancer_update_params.py @@ -3,10 +3,12 @@ from __future__ import annotations from typing import List, Iterable -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Required, TypedDict from .rules_param import RulesParam from .default_pools import DefaultPools +from .steering_policy import SteeringPolicy +from .session_affinity import SessionAffinity from .random_steering_param import RandomSteeringParam from .adaptive_routing_param import AdaptiveRoutingParam from .location_strategy_param import LocationStrategyParam @@ -100,7 +102,7 @@ class LoadBalancerUpdateParams(TypedDict, total=False): execute. """ - session_affinity: Literal["none", "cookie", "ip_cookie", "header", '""'] + session_affinity: SessionAffinity """ Specifies the type of session affinity the load balancer should use unless specified as `"none"` or "" (default). The supported types are: @@ -144,9 +146,7 @@ class LoadBalancerUpdateParams(TypedDict, total=False): number of seconds specified. """ - steering_policy: Literal[ - "off", "geo", "random", "dynamic_latency", "proximity", "least_outstanding_requests", "least_connections", '""' - ] + steering_policy: SteeringPolicy """Steering Policy for this load balancer. - `"off"`: Use `default_pools`. diff --git a/src/cloudflare/types/load_balancers/rules.py b/src/cloudflare/types/load_balancers/rules.py index 3c0887f61c9..41e166c9635 100644 --- a/src/cloudflare/types/load_balancers/rules.py +++ b/src/cloudflare/types/load_balancers/rules.py @@ -1,12 +1,13 @@ # 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 .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 @@ -88,7 +89,7 @@ class Overrides(BaseModel): back to using default_pools. """ - 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: @@ -132,18 +133,7 @@ class Overrides(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`. diff --git a/src/cloudflare/types/load_balancers/rules_param.py b/src/cloudflare/types/load_balancers/rules_param.py index f74b2e39bcc..4ff218a8a84 100644 --- a/src/cloudflare/types/load_balancers/rules_param.py +++ b/src/cloudflare/types/load_balancers/rules_param.py @@ -3,9 +3,11 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import TypedDict from .default_pools import DefaultPools +from .steering_policy import SteeringPolicy +from .session_affinity import SessionAffinity from .random_steering_param import RandomSteeringParam from .adaptive_routing_param import AdaptiveRoutingParam from .location_strategy_param import LocationStrategyParam @@ -89,7 +91,7 @@ class Overrides(TypedDict, total=False): back to using default_pools. """ - session_affinity: Literal["none", "cookie", "ip_cookie", "header", '""'] + session_affinity: SessionAffinity """ Specifies the type of session affinity the load balancer should use unless specified as `"none"` or "" (default). The supported types are: @@ -133,9 +135,7 @@ class Overrides(TypedDict, total=False): number of seconds specified. """ - steering_policy: Literal[ - "off", "geo", "random", "dynamic_latency", "proximity", "least_outstanding_requests", "least_connections", '""' - ] + steering_policy: SteeringPolicy """Steering Policy for this load balancer. - `"off"`: Use `default_pools`. diff --git a/src/cloudflare/types/ssl/certificate_authority.py b/src/cloudflare/types/load_balancers/session_affinity.py similarity index 54% rename from src/cloudflare/types/ssl/certificate_authority.py rename to src/cloudflare/types/load_balancers/session_affinity.py index 928533b5a72..43b79ef9037 100644 --- a/src/cloudflare/types/ssl/certificate_authority.py +++ b/src/cloudflare/types/load_balancers/session_affinity.py @@ -2,6 +2,6 @@ from typing_extensions import Literal -__all__ = ["CertificateAuthority"] +__all__ = ["SessionAffinity"] -CertificateAuthority = Literal["digicert", "google", "lets_encrypt"] +SessionAffinity = Literal["none", "cookie", "ip_cookie", "header", '""'] diff --git a/src/cloudflare/types/load_balancers/steering_policy.py b/src/cloudflare/types/load_balancers/steering_policy.py new file mode 100644 index 00000000000..eb7637c2237 --- /dev/null +++ b/src/cloudflare/types/load_balancers/steering_policy.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +__all__ = ["SteeringPolicy"] + +SteeringPolicy = Literal[ + "off", "geo", "random", "dynamic_latency", "proximity", "least_outstanding_requests", "least_connections", '""' +] diff --git a/src/cloudflare/types/shared/__init__.py b/src/cloudflare/types/shared/__init__.py index 0a9630a29f2..9bafe8cf7b3 100644 --- a/src/cloudflare/types/shared/__init__.py +++ b/src/cloudflare/types/shared/__init__.py @@ -9,6 +9,7 @@ from .identifier import Identifier as Identifier from .permission import Permission as Permission from .response_info import ResponseInfo as ResponseInfo +from .certificate_ca import CertificateCA as CertificateCA from .pagination_info import PaginationInfo as PaginationInfo from .permission_grant import PermissionGrant as PermissionGrant from .cloudflare_tunnel import CloudflareTunnel as CloudflareTunnel diff --git a/src/cloudflare/types/shared/certificate_ca.py b/src/cloudflare/types/shared/certificate_ca.py new file mode 100644 index 00000000000..bf610820022 --- /dev/null +++ b/src/cloudflare/types/shared/certificate_ca.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +__all__ = ["CertificateCA"] + +CertificateCA = Literal["digicert", "google", "lets_encrypt"] diff --git a/src/cloudflare/types/shared_params/__init__.py b/src/cloudflare/types/shared_params/__init__.py index 92f6f91d686..9aee71c9325 100644 --- a/src/cloudflare/types/shared_params/__init__.py +++ b/src/cloudflare/types/shared_params/__init__.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .asn import ASN as ASN +from .certificate_ca import CertificateCA as CertificateCA from .permission_grant import PermissionGrant as PermissionGrant from .certificate_request_type import CertificateRequestType as CertificateRequestType diff --git a/src/cloudflare/types/shared_params/certificate_ca.py b/src/cloudflare/types/shared_params/certificate_ca.py new file mode 100644 index 00000000000..6c04765d842 --- /dev/null +++ b/src/cloudflare/types/shared_params/certificate_ca.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +__all__ = ["CertificateCA"] + +CertificateCA = Literal["digicert", "google", "lets_encrypt"] diff --git a/src/cloudflare/types/ssl/__init__.py b/src/cloudflare/types/ssl/__init__.py index c1afaaddf69..6734fbac734 100644 --- a/src/cloudflare/types/ssl/__init__.py +++ b/src/cloudflare/types/ssl/__init__.py @@ -8,7 +8,6 @@ from .request_validity import RequestValidity as RequestValidity from .validation_method import ValidationMethod as ValidationMethod from .analyze_create_params import AnalyzeCreateParams as AnalyzeCreateParams -from .certificate_authority import CertificateAuthority as CertificateAuthority from .analyze_create_response import AnalyzeCreateResponse as AnalyzeCreateResponse from .verification_get_params import VerificationGetParams as VerificationGetParams from .verification_edit_params import VerificationEditParams as VerificationEditParams