|
3 | 3 | from __future__ import annotations
|
4 | 4 |
|
5 | 5 | from typing import List, Type, Iterable, cast
|
6 |
| -from typing_extensions import Literal |
7 | 6 |
|
8 | 7 | import httpx
|
9 | 8 |
|
|
69 | 68 | )
|
70 | 69 | from .monitors.monitors import MonitorsResource, AsyncMonitorsResource
|
71 | 70 | from ...types.load_balancers import (
|
| 71 | + SteeringPolicy, |
| 72 | + SessionAffinity, |
72 | 73 | load_balancer_edit_params,
|
73 | 74 | load_balancer_create_params,
|
74 | 75 | load_balancer_update_params,
|
75 | 76 | )
|
76 | 77 | from ...types.load_balancers.rules_param import RulesParam
|
77 | 78 | from ...types.load_balancers.default_pools import DefaultPools
|
78 | 79 | 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 |
79 | 82 | from ...types.load_balancers.random_steering_param import RandomSteeringParam
|
80 | 83 | from ...types.load_balancers.adaptive_routing_param import AdaptiveRoutingParam
|
81 | 84 | from ...types.load_balancers.location_strategy_param import LocationStrategyParam
|
@@ -130,20 +133,10 @@ def create(
|
130 | 133 | random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN,
|
131 | 134 | region_pools: object | NotGiven = NOT_GIVEN,
|
132 | 135 | 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, |
134 | 137 | session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN,
|
135 | 138 | 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, |
147 | 140 | ttl: float | NotGiven = NOT_GIVEN,
|
148 | 141 | # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
149 | 142 | # The extra values given here take precedence over values defined on the client or passed to this method.
|
@@ -330,20 +323,10 @@ def update(
|
330 | 323 | random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN,
|
331 | 324 | region_pools: object | NotGiven = NOT_GIVEN,
|
332 | 325 | 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, |
334 | 327 | session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN,
|
335 | 328 | 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, |
347 | 330 | ttl: float | NotGiven = NOT_GIVEN,
|
348 | 331 | # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
349 | 332 | # The extra values given here take precedence over values defined on the client or passed to this method.
|
@@ -609,20 +592,10 @@ def edit(
|
609 | 592 | random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN,
|
610 | 593 | region_pools: object | NotGiven = NOT_GIVEN,
|
611 | 594 | 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, |
613 | 596 | session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN,
|
614 | 597 | 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, |
626 | 599 | ttl: float | NotGiven = NOT_GIVEN,
|
627 | 600 | # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
628 | 601 | # 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(
|
882 | 855 | random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN,
|
883 | 856 | region_pools: object | NotGiven = NOT_GIVEN,
|
884 | 857 | 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, |
886 | 859 | session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN,
|
887 | 860 | 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, |
899 | 862 | ttl: float | NotGiven = NOT_GIVEN,
|
900 | 863 | # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
901 | 864 | # 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(
|
1082 | 1045 | random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN,
|
1083 | 1046 | region_pools: object | NotGiven = NOT_GIVEN,
|
1084 | 1047 | 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, |
1086 | 1049 | session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN,
|
1087 | 1050 | 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, |
1099 | 1052 | ttl: float | NotGiven = NOT_GIVEN,
|
1100 | 1053 | # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
1101 | 1054 | # 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(
|
1361 | 1314 | random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN,
|
1362 | 1315 | region_pools: object | NotGiven = NOT_GIVEN,
|
1363 | 1316 | 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, |
1365 | 1318 | session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN,
|
1366 | 1319 | 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, |
1378 | 1321 | ttl: float | NotGiven = NOT_GIVEN,
|
1379 | 1322 | # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
1380 | 1323 | # The extra values given here take precedence over values defined on the client or passed to this method.
|
|
0 commit comments