Skip to content

Commit 7fc60d8

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#471)
1 parent 6b8c3c3 commit 7fc60d8

23 files changed

+91
-137
lines changed

api.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from cloudflare.types import (
55
ASN,
66
AuditLog,
7+
CertificateCA,
78
CertificateRequestType,
89
CloudflareTunnel,
910
ErrorData,
@@ -1042,7 +1043,9 @@ from cloudflare.types.load_balancers import (
10421043
OriginSteering,
10431044
RandomSteering,
10441045
Rules,
1046+
SessionAffinity,
10451047
SessionAffinityAttributes,
1048+
SteeringPolicy,
10461049
LoadBalancerDeleteResponse,
10471050
)
10481051
```
@@ -1284,7 +1287,6 @@ Types:
12841287

12851288
```python
12861289
from cloudflare.types.ssl import (
1287-
CertificateAuthority,
12881290
Host,
12891291
RequestValidity,
12901292
Status,

src/cloudflare/resources/load_balancers/load_balancers.py

+16-73
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import annotations
44

55
from typing import List, Type, Iterable, cast
6-
from typing_extensions import Literal
76

87
import httpx
98

@@ -69,13 +68,17 @@
6968
)
7069
from .monitors.monitors import MonitorsResource, AsyncMonitorsResource
7170
from ...types.load_balancers import (
71+
SteeringPolicy,
72+
SessionAffinity,
7273
load_balancer_edit_params,
7374
load_balancer_create_params,
7475
load_balancer_update_params,
7576
)
7677
from ...types.load_balancers.rules_param import RulesParam
7778
from ...types.load_balancers.default_pools import DefaultPools
7879
from ...types.load_balancers.load_balancer import LoadBalancer
80+
from ...types.load_balancers.steering_policy import SteeringPolicy
81+
from ...types.load_balancers.session_affinity import SessionAffinity
7982
from ...types.load_balancers.random_steering_param import RandomSteeringParam
8083
from ...types.load_balancers.adaptive_routing_param import AdaptiveRoutingParam
8184
from ...types.load_balancers.location_strategy_param import LocationStrategyParam
@@ -130,20 +133,10 @@ def create(
130133
random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN,
131134
region_pools: object | NotGiven = NOT_GIVEN,
132135
rules: Iterable[RulesParam] | NotGiven = NOT_GIVEN,
133-
session_affinity: Literal["none", "cookie", "ip_cookie", "header", '""'] | NotGiven = NOT_GIVEN,
136+
session_affinity: SessionAffinity | NotGiven = NOT_GIVEN,
134137
session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN,
135138
session_affinity_ttl: float | NotGiven = NOT_GIVEN,
136-
steering_policy: Literal[
137-
"off",
138-
"geo",
139-
"random",
140-
"dynamic_latency",
141-
"proximity",
142-
"least_outstanding_requests",
143-
"least_connections",
144-
'""',
145-
]
146-
| NotGiven = NOT_GIVEN,
139+
steering_policy: SteeringPolicy | NotGiven = NOT_GIVEN,
147140
ttl: float | NotGiven = NOT_GIVEN,
148141
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
149142
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -330,20 +323,10 @@ def update(
330323
random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN,
331324
region_pools: object | NotGiven = NOT_GIVEN,
332325
rules: Iterable[RulesParam] | NotGiven = NOT_GIVEN,
333-
session_affinity: Literal["none", "cookie", "ip_cookie", "header", '""'] | NotGiven = NOT_GIVEN,
326+
session_affinity: SessionAffinity | NotGiven = NOT_GIVEN,
334327
session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN,
335328
session_affinity_ttl: float | NotGiven = NOT_GIVEN,
336-
steering_policy: Literal[
337-
"off",
338-
"geo",
339-
"random",
340-
"dynamic_latency",
341-
"proximity",
342-
"least_outstanding_requests",
343-
"least_connections",
344-
'""',
345-
]
346-
| NotGiven = NOT_GIVEN,
329+
steering_policy: SteeringPolicy | NotGiven = NOT_GIVEN,
347330
ttl: float | NotGiven = NOT_GIVEN,
348331
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
349332
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -609,20 +592,10 @@ def edit(
609592
random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN,
610593
region_pools: object | NotGiven = NOT_GIVEN,
611594
rules: Iterable[RulesParam] | NotGiven = NOT_GIVEN,
612-
session_affinity: Literal["none", "cookie", "ip_cookie", "header", '""'] | NotGiven = NOT_GIVEN,
595+
session_affinity: SessionAffinity | NotGiven = NOT_GIVEN,
613596
session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN,
614597
session_affinity_ttl: float | NotGiven = NOT_GIVEN,
615-
steering_policy: Literal[
616-
"off",
617-
"geo",
618-
"random",
619-
"dynamic_latency",
620-
"proximity",
621-
"least_outstanding_requests",
622-
"least_connections",
623-
'""',
624-
]
625-
| NotGiven = NOT_GIVEN,
598+
steering_policy: SteeringPolicy | NotGiven = NOT_GIVEN,
626599
ttl: float | NotGiven = NOT_GIVEN,
627600
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
628601
# 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(
882855
random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN,
883856
region_pools: object | NotGiven = NOT_GIVEN,
884857
rules: Iterable[RulesParam] | NotGiven = NOT_GIVEN,
885-
session_affinity: Literal["none", "cookie", "ip_cookie", "header", '""'] | NotGiven = NOT_GIVEN,
858+
session_affinity: SessionAffinity | NotGiven = NOT_GIVEN,
886859
session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN,
887860
session_affinity_ttl: float | NotGiven = NOT_GIVEN,
888-
steering_policy: Literal[
889-
"off",
890-
"geo",
891-
"random",
892-
"dynamic_latency",
893-
"proximity",
894-
"least_outstanding_requests",
895-
"least_connections",
896-
'""',
897-
]
898-
| NotGiven = NOT_GIVEN,
861+
steering_policy: SteeringPolicy | NotGiven = NOT_GIVEN,
899862
ttl: float | NotGiven = NOT_GIVEN,
900863
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
901864
# 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(
10821045
random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN,
10831046
region_pools: object | NotGiven = NOT_GIVEN,
10841047
rules: Iterable[RulesParam] | NotGiven = NOT_GIVEN,
1085-
session_affinity: Literal["none", "cookie", "ip_cookie", "header", '""'] | NotGiven = NOT_GIVEN,
1048+
session_affinity: SessionAffinity | NotGiven = NOT_GIVEN,
10861049
session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN,
10871050
session_affinity_ttl: float | NotGiven = NOT_GIVEN,
1088-
steering_policy: Literal[
1089-
"off",
1090-
"geo",
1091-
"random",
1092-
"dynamic_latency",
1093-
"proximity",
1094-
"least_outstanding_requests",
1095-
"least_connections",
1096-
'""',
1097-
]
1098-
| NotGiven = NOT_GIVEN,
1051+
steering_policy: SteeringPolicy | NotGiven = NOT_GIVEN,
10991052
ttl: float | NotGiven = NOT_GIVEN,
11001053
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
11011054
# 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(
13611314
random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN,
13621315
region_pools: object | NotGiven = NOT_GIVEN,
13631316
rules: Iterable[RulesParam] | NotGiven = NOT_GIVEN,
1364-
session_affinity: Literal["none", "cookie", "ip_cookie", "header", '""'] | NotGiven = NOT_GIVEN,
1317+
session_affinity: SessionAffinity | NotGiven = NOT_GIVEN,
13651318
session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN,
13661319
session_affinity_ttl: float | NotGiven = NOT_GIVEN,
1367-
steering_policy: Literal[
1368-
"off",
1369-
"geo",
1370-
"random",
1371-
"dynamic_latency",
1372-
"proximity",
1373-
"least_outstanding_requests",
1374-
"least_connections",
1375-
'""',
1376-
]
1377-
| NotGiven = NOT_GIVEN,
1320+
steering_policy: SteeringPolicy | NotGiven = NOT_GIVEN,
13781321
ttl: float | NotGiven = NOT_GIVEN,
13791322
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
13801323
# The extra values given here take precedence over values defined on the client or passed to this method.

src/cloudflare/types/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
Identifier as Identifier,
1313
Permission as Permission,
1414
ResponseInfo as ResponseInfo,
15+
CertificateCA as CertificateCA,
1516
PaginationInfo as PaginationInfo,
1617
PermissionGrant as PermissionGrant,
1718
CloudflareTunnel as CloudflareTunnel,

src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
from .dcv_method import DCVMethod
99
from .bundle_method import BundleMethod
10+
from ..shared.certificate_ca import CertificateCA
1011
from .domain_validation_type import DomainValidationType
11-
from ..ssl.certificate_authority import CertificateAuthority
1212

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

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

59-
certificate_authority: CertificateAuthority
59+
certificate_authority: CertificateCA
6060
"""The Certificate Authority that will issue the certificate"""
6161

6262
custom_certificate: str

src/cloudflare/types/custom_hostnames/custom_hostname_create_response.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
from ..._models import BaseModel
88
from .dcv_method import DCVMethod
99
from .bundle_method import BundleMethod
10+
from ..shared.certificate_ca import CertificateCA
1011
from .domain_validation_type import DomainValidationType
11-
from ..ssl.certificate_authority import CertificateAuthority
1212

1313
__all__ = [
1414
"CustomHostnameCreateResponse",
@@ -88,7 +88,7 @@ class SSL(BaseModel):
8888
chain, but does not otherwise modify it.
8989
"""
9090

91-
certificate_authority: Optional[CertificateAuthority] = None
91+
certificate_authority: Optional[CertificateCA] = None
9292
"""The Certificate Authority that will issue the certificate"""
9393

9494
custom_certificate: Optional[str] = None

src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
from .dcv_method import DCVMethod
99
from .bundle_method import BundleMethod
10+
from ..shared.certificate_ca import CertificateCA
1011
from .domain_validation_type import DomainValidationType
11-
from ..ssl.certificate_authority import CertificateAuthority
1212

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

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

76-
certificate_authority: CertificateAuthority
76+
certificate_authority: CertificateCA
7777
"""The Certificate Authority that will issue the certificate"""
7878

7979
custom_certificate: str

src/cloudflare/types/custom_hostnames/custom_hostname_edit_response.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
from ..._models import BaseModel
88
from .dcv_method import DCVMethod
99
from .bundle_method import BundleMethod
10+
from ..shared.certificate_ca import CertificateCA
1011
from .domain_validation_type import DomainValidationType
11-
from ..ssl.certificate_authority import CertificateAuthority
1212

1313
__all__ = [
1414
"CustomHostnameEditResponse",
@@ -88,7 +88,7 @@ class SSL(BaseModel):
8888
chain, but does not otherwise modify it.
8989
"""
9090

91-
certificate_authority: Optional[CertificateAuthority] = None
91+
certificate_authority: Optional[CertificateCA] = None
9292
"""The Certificate Authority that will issue the certificate"""
9393

9494
custom_certificate: Optional[str] = None

src/cloudflare/types/custom_hostnames/custom_hostname_get_response.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
from ..._models import BaseModel
88
from .dcv_method import DCVMethod
99
from .bundle_method import BundleMethod
10+
from ..shared.certificate_ca import CertificateCA
1011
from .domain_validation_type import DomainValidationType
11-
from ..ssl.certificate_authority import CertificateAuthority
1212

1313
__all__ = [
1414
"CustomHostnameGetResponse",
@@ -88,7 +88,7 @@ class SSL(BaseModel):
8888
chain, but does not otherwise modify it.
8989
"""
9090

91-
certificate_authority: Optional[CertificateAuthority] = None
91+
certificate_authority: Optional[CertificateCA] = None
9292
"""The Certificate Authority that will issue the certificate"""
9393

9494
custom_certificate: Optional[str] = None

src/cloudflare/types/custom_hostnames/custom_hostname_list_response.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
from ..._models import BaseModel
88
from .dcv_method import DCVMethod
99
from .bundle_method import BundleMethod
10+
from ..shared.certificate_ca import CertificateCA
1011
from .domain_validation_type import DomainValidationType
11-
from ..ssl.certificate_authority import CertificateAuthority
1212

1313
__all__ = [
1414
"CustomHostnameListResponse",
@@ -88,7 +88,7 @@ class SSL(BaseModel):
8888
chain, but does not otherwise modify it.
8989
"""
9090

91-
certificate_authority: Optional[CertificateAuthority] = None
91+
certificate_authority: Optional[CertificateCA] = None
9292
"""The Certificate Authority that will issue the certificate"""
9393

9494
custom_certificate: Optional[str] = None

src/cloudflare/types/load_balancers/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
from .filter_options import FilterOptions as FilterOptions
1919
from .origin_steering import OriginSteering as OriginSteering
2020
from .random_steering import RandomSteering as RandomSteering
21+
from .steering_policy import SteeringPolicy as SteeringPolicy
2122
from .adaptive_routing import AdaptiveRouting as AdaptiveRouting
2223
from .pool_edit_params import PoolEditParams as PoolEditParams
2324
from .pool_list_params import PoolListParams as PoolListParams
25+
from .session_affinity import SessionAffinity as SessionAffinity
2426
from .location_strategy import LocationStrategy as LocationStrategy
2527
from .search_get_params import SearchGetParams as SearchGetParams
2628
from .pool_create_params import PoolCreateParams as PoolCreateParams

src/cloudflare/types/load_balancers/load_balancer.py

+4-14
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
from typing import List, Optional
44
from datetime import datetime
5-
from typing_extensions import Literal
65

76
from .rules import Rules
87
from ..._models import BaseModel
98
from .default_pools import DefaultPools
109
from .random_steering import RandomSteering
10+
from .steering_policy import SteeringPolicy
1111
from .adaptive_routing import AdaptiveRouting
12+
from .session_affinity import SessionAffinity
1213
from .location_strategy import LocationStrategy
1314
from .session_affinity_attributes import SessionAffinityAttributes
1415

@@ -104,7 +105,7 @@ class LoadBalancer(BaseModel):
104105
execute.
105106
"""
106107

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

151-
steering_policy: Optional[
152-
Literal[
153-
"off",
154-
"geo",
155-
"random",
156-
"dynamic_latency",
157-
"proximity",
158-
"least_outstanding_requests",
159-
"least_connections",
160-
'""',
161-
]
162-
] = None
152+
steering_policy: Optional[SteeringPolicy] = None
163153
"""Steering Policy for this load balancer.
164154
165155
- `"off"`: Use `default_pools`.

0 commit comments

Comments
 (0)