Skip to content

Commit 72c9a7a

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#485)
1 parent bc21852 commit 72c9a7a

File tree

9 files changed

+156
-83
lines changed

9 files changed

+156
-83
lines changed

api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Types:
44

55
- <code><a href="./src/resources/shared.ts">ASN</a></code>
66
- <code><a href="./src/resources/shared.ts">AuditLog</a></code>
7+
- <code><a href="./src/resources/shared.ts">CertificateCA</a></code>
78
- <code><a href="./src/resources/shared.ts">CertificateRequestType</a></code>
89
- <code><a href="./src/resources/shared.ts">CloudflareTunnel</a></code>
910
- <code><a href="./src/resources/shared.ts">ErrorData</a></code>
@@ -891,7 +892,9 @@ Types:
891892
- <code><a href="./src/resources/load-balancers/load-balancers.ts">OriginSteering</a></code>
892893
- <code><a href="./src/resources/load-balancers/load-balancers.ts">RandomSteering</a></code>
893894
- <code><a href="./src/resources/load-balancers/load-balancers.ts">Rules</a></code>
895+
- <code><a href="./src/resources/load-balancers/load-balancers.ts">SessionAffinity</a></code>
894896
- <code><a href="./src/resources/load-balancers/load-balancers.ts">SessionAffinityAttributes</a></code>
897+
- <code><a href="./src/resources/load-balancers/load-balancers.ts">SteeringPolicy</a></code>
895898
- <code><a href="./src/resources/load-balancers/load-balancers.ts">LoadBalancerDeleteResponse</a></code>
896899

897900
Methods:
@@ -1095,7 +1098,6 @@ Methods:
10951098

10961099
Types:
10971100

1098-
- <code><a href="./src/resources/ssl/certificate-packs/certificate-packs.ts">CertificateAuthority</a></code>
10991101
- <code><a href="./src/resources/ssl/certificate-packs/certificate-packs.ts">Host</a></code>
11001102
- <code><a href="./src/resources/ssl/certificate-packs/certificate-packs.ts">RequestValidity</a></code>
11011103
- <code><a href="./src/resources/ssl/certificate-packs/certificate-packs.ts">Status</a></code>

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ export namespace Cloudflare {
556556

557557
export import ASN = API.ASN;
558558
export import AuditLog = API.AuditLog;
559+
export import CertificateCA = API.CertificateCA;
559560
export import CertificateRequestType = API.CertificateRequestType;
560561
export import CloudflareTunnel = API.CloudflareTunnel;
561562
export import ErrorData = API.ErrorData;

src/resources/custom-hostnames/custom-hostnames.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import * as Core from 'cloudflare/core';
44
import { APIResource } from 'cloudflare/resource';
55
import * as CustomHostnamesAPI from 'cloudflare/resources/custom-hostnames/custom-hostnames';
6+
import * as Shared from 'cloudflare/resources/shared';
67
import * as FallbackOriginAPI from 'cloudflare/resources/custom-hostnames/fallback-origin';
7-
import * as CertificatePacksAPI from 'cloudflare/resources/ssl/certificate-packs/certificate-packs';
88
import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination';
99

1010
export class CustomHostnames extends APIResource {
@@ -213,7 +213,7 @@ export namespace CustomHostname {
213213
/**
214214
* The Certificate Authority that will issue the certificate
215215
*/
216-
certificate_authority?: CertificatePacksAPI.CertificateAuthority;
216+
certificate_authority?: Shared.CertificateCA;
217217

218218
/**
219219
* If a custom uploaded certificate is used.
@@ -560,7 +560,7 @@ export namespace CustomHostnameCreateResponse {
560560
/**
561561
* The Certificate Authority that will issue the certificate
562562
*/
563-
certificate_authority?: CertificatePacksAPI.CertificateAuthority;
563+
certificate_authority?: Shared.CertificateCA;
564564

565565
/**
566566
* If a custom uploaded certificate is used.
@@ -885,7 +885,7 @@ export namespace CustomHostnameListResponse {
885885
/**
886886
* The Certificate Authority that will issue the certificate
887887
*/
888-
certificate_authority?: CertificatePacksAPI.CertificateAuthority;
888+
certificate_authority?: Shared.CertificateCA;
889889

890890
/**
891891
* If a custom uploaded certificate is used.
@@ -1217,7 +1217,7 @@ export namespace CustomHostnameEditResponse {
12171217
/**
12181218
* The Certificate Authority that will issue the certificate
12191219
*/
1220-
certificate_authority?: CertificatePacksAPI.CertificateAuthority;
1220+
certificate_authority?: Shared.CertificateCA;
12211221

12221222
/**
12231223
* If a custom uploaded certificate is used.
@@ -1542,7 +1542,7 @@ export namespace CustomHostnameGetResponse {
15421542
/**
15431543
* The Certificate Authority that will issue the certificate
15441544
*/
1545-
certificate_authority?: CertificatePacksAPI.CertificateAuthority;
1545+
certificate_authority?: Shared.CertificateCA;
15461546

15471547
/**
15481548
* If a custom uploaded certificate is used.
@@ -1805,7 +1805,7 @@ export namespace CustomHostnameCreateParams {
18051805
/**
18061806
* The Certificate Authority that will issue the certificate
18071807
*/
1808-
certificate_authority?: CertificatePacksAPI.CertificateAuthorityParam;
1808+
certificate_authority?: Shared.CertificateCAParam;
18091809

18101810
/**
18111811
* If a custom uploaded certificate is used.
@@ -1983,7 +1983,7 @@ export namespace CustomHostnameEditParams {
19831983
/**
19841984
* The Certificate Authority that will issue the certificate
19851985
*/
1986-
certificate_authority?: CertificatePacksAPI.CertificateAuthorityParam;
1986+
certificate_authority?: Shared.CertificateCAParam;
19871987

19881988
/**
19891989
* If a custom uploaded certificate is used.

src/resources/load-balancers/load-balancers.ts

Lines changed: 134 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ export interface LoadBalancer {
389389
* `headers` in `session_affinity_attributes` for additional required
390390
* configuration.
391391
*/
392-
session_affinity?: 'none' | 'cookie' | 'ip_cookie' | 'header' | '""';
392+
session_affinity?: SessionAffinity;
393393

394394
/**
395395
* Configures attributes for session affinity.
@@ -434,15 +434,7 @@ export interface LoadBalancer {
434434
* - `""`: Will map to `"geo"` if you use
435435
* `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
436436
*/
437-
steering_policy?:
438-
| 'off'
439-
| 'geo'
440-
| 'random'
441-
| 'dynamic_latency'
442-
| 'proximity'
443-
| 'least_outstanding_requests'
444-
| 'least_connections'
445-
| '""';
437+
steering_policy?: SteeringPolicy;
446438

447439
/**
448440
* Time to live (TTL) of the DNS entry for the IP address returned by this load
@@ -967,7 +959,7 @@ export namespace Rules {
967959
* `headers` in `session_affinity_attributes` for additional required
968960
* configuration.
969961
*/
970-
session_affinity?: 'none' | 'cookie' | 'ip_cookie' | 'header' | '""';
962+
session_affinity?: LoadBalancersAPI.SessionAffinity;
971963

972964
/**
973965
* Configures attributes for session affinity.
@@ -1012,15 +1004,7 @@ export namespace Rules {
10121004
* - `""`: Will map to `"geo"` if you use
10131005
* `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
10141006
*/
1015-
steering_policy?:
1016-
| 'off'
1017-
| 'geo'
1018-
| 'random'
1019-
| 'dynamic_latency'
1020-
| 'proximity'
1021-
| 'least_outstanding_requests'
1022-
| 'least_connections'
1023-
| '""';
1007+
steering_policy?: LoadBalancersAPI.SteeringPolicy;
10241008

10251009
/**
10261010
* Time to live (TTL) of the DNS entry for the IP address returned by this load
@@ -1202,7 +1186,7 @@ export namespace RulesParam {
12021186
* `headers` in `session_affinity_attributes` for additional required
12031187
* configuration.
12041188
*/
1205-
session_affinity?: 'none' | 'cookie' | 'ip_cookie' | 'header' | '""';
1189+
session_affinity?: LoadBalancersAPI.SessionAffinityParam;
12061190

12071191
/**
12081192
* Configures attributes for session affinity.
@@ -1247,15 +1231,7 @@ export namespace RulesParam {
12471231
* - `""`: Will map to `"geo"` if you use
12481232
* `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
12491233
*/
1250-
steering_policy?:
1251-
| 'off'
1252-
| 'geo'
1253-
| 'random'
1254-
| 'dynamic_latency'
1255-
| 'proximity'
1256-
| 'least_outstanding_requests'
1257-
| 'least_connections'
1258-
| '""';
1234+
steering_policy?: LoadBalancersAPI.SteeringPolicyParam;
12591235

12601236
/**
12611237
* Time to live (TTL) of the DNS entry for the IP address returned by this load
@@ -1265,6 +1241,60 @@ export namespace RulesParam {
12651241
}
12661242
}
12671243

1244+
/**
1245+
* Specifies the type of session affinity the load balancer should use unless
1246+
* specified as `"none"` or "" (default). The supported types are:
1247+
*
1248+
* - `"cookie"`: On the first request to a proxied load balancer, a cookie is
1249+
* generated, encoding information of which origin the request will be forwarded
1250+
* to. Subsequent requests, by the same client to the same load balancer, will be
1251+
* sent to the origin server the cookie encodes, for the duration of the cookie
1252+
* and as long as the origin server remains healthy. If the cookie has expired or
1253+
* the origin server is unhealthy, then a new origin server is calculated and
1254+
* used.
1255+
* - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
1256+
* selection is stable and based on the client's ip address.
1257+
* - `"header"`: On the first request to a proxied load balancer, a session key
1258+
* based on the configured HTTP headers (see
1259+
* `session_affinity_attributes.headers`) is generated, encoding the request
1260+
* headers used for storing in the load balancer session state which origin the
1261+
* request will be forwarded to. Subsequent requests to the load balancer with
1262+
* the same headers will be sent to the same origin server, for the duration of
1263+
* the session and as long as the origin server remains healthy. If the session
1264+
* has been idle for the duration of `session_affinity_ttl` seconds or the origin
1265+
* server is unhealthy, then a new origin server is calculated and used. See
1266+
* `headers` in `session_affinity_attributes` for additional required
1267+
* configuration.
1268+
*/
1269+
export type SessionAffinity = 'none' | 'cookie' | 'ip_cookie' | 'header' | '""';
1270+
1271+
/**
1272+
* Specifies the type of session affinity the load balancer should use unless
1273+
* specified as `"none"` or "" (default). The supported types are:
1274+
*
1275+
* - `"cookie"`: On the first request to a proxied load balancer, a cookie is
1276+
* generated, encoding information of which origin the request will be forwarded
1277+
* to. Subsequent requests, by the same client to the same load balancer, will be
1278+
* sent to the origin server the cookie encodes, for the duration of the cookie
1279+
* and as long as the origin server remains healthy. If the cookie has expired or
1280+
* the origin server is unhealthy, then a new origin server is calculated and
1281+
* used.
1282+
* - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
1283+
* selection is stable and based on the client's ip address.
1284+
* - `"header"`: On the first request to a proxied load balancer, a session key
1285+
* based on the configured HTTP headers (see
1286+
* `session_affinity_attributes.headers`) is generated, encoding the request
1287+
* headers used for storing in the load balancer session state which origin the
1288+
* request will be forwarded to. Subsequent requests to the load balancer with
1289+
* the same headers will be sent to the same origin server, for the duration of
1290+
* the session and as long as the origin server remains healthy. If the session
1291+
* has been idle for the duration of `session_affinity_ttl` seconds or the origin
1292+
* server is unhealthy, then a new origin server is calculated and used. See
1293+
* `headers` in `session_affinity_attributes` for additional required
1294+
* configuration.
1295+
*/
1296+
export type SessionAffinityParam = 'none' | 'cookie' | 'ip_cookie' | 'header' | '""';
1297+
12681298
/**
12691299
* Configures attributes for session affinity.
12701300
*/
@@ -1399,6 +1429,74 @@ export interface SessionAffinityAttributesParam {
13991429
zero_downtime_failover?: 'none' | 'temporary' | 'sticky';
14001430
}
14011431

1432+
/**
1433+
* Steering Policy for this load balancer.
1434+
*
1435+
* - `"off"`: Use `default_pools`.
1436+
* - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
1437+
* requests, the country for `country_pools` is determined by
1438+
* `location_strategy`.
1439+
* - `"random"`: Select a pool randomly.
1440+
* - `"dynamic_latency"`: Use round trip time to select the closest pool in
1441+
* default_pools (requires pool health checks).
1442+
* - `"proximity"`: Use the pools' latitude and longitude to select the closest
1443+
* pool using the Cloudflare PoP location for proxied requests or the location
1444+
* determined by `location_strategy` for non-proxied requests.
1445+
* - `"least_outstanding_requests"`: Select a pool by taking into consideration
1446+
* `random_steering` weights, as well as each pool's number of outstanding
1447+
* requests. Pools with more pending requests are weighted proportionately less
1448+
* relative to others.
1449+
* - `"least_connections"`: Select a pool by taking into consideration
1450+
* `random_steering` weights, as well as each pool's number of open connections.
1451+
* Pools with more open connections are weighted proportionately less relative to
1452+
* others. Supported for HTTP/1 and HTTP/2 connections.
1453+
* - `""`: Will map to `"geo"` if you use
1454+
* `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
1455+
*/
1456+
export type SteeringPolicy =
1457+
| 'off'
1458+
| 'geo'
1459+
| 'random'
1460+
| 'dynamic_latency'
1461+
| 'proximity'
1462+
| 'least_outstanding_requests'
1463+
| 'least_connections'
1464+
| '""';
1465+
1466+
/**
1467+
* Steering Policy for this load balancer.
1468+
*
1469+
* - `"off"`: Use `default_pools`.
1470+
* - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
1471+
* requests, the country for `country_pools` is determined by
1472+
* `location_strategy`.
1473+
* - `"random"`: Select a pool randomly.
1474+
* - `"dynamic_latency"`: Use round trip time to select the closest pool in
1475+
* default_pools (requires pool health checks).
1476+
* - `"proximity"`: Use the pools' latitude and longitude to select the closest
1477+
* pool using the Cloudflare PoP location for proxied requests or the location
1478+
* determined by `location_strategy` for non-proxied requests.
1479+
* - `"least_outstanding_requests"`: Select a pool by taking into consideration
1480+
* `random_steering` weights, as well as each pool's number of outstanding
1481+
* requests. Pools with more pending requests are weighted proportionately less
1482+
* relative to others.
1483+
* - `"least_connections"`: Select a pool by taking into consideration
1484+
* `random_steering` weights, as well as each pool's number of open connections.
1485+
* Pools with more open connections are weighted proportionately less relative to
1486+
* others. Supported for HTTP/1 and HTTP/2 connections.
1487+
* - `""`: Will map to `"geo"` if you use
1488+
* `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
1489+
*/
1490+
export type SteeringPolicyParam =
1491+
| 'off'
1492+
| 'geo'
1493+
| 'random'
1494+
| 'dynamic_latency'
1495+
| 'proximity'
1496+
| 'least_outstanding_requests'
1497+
| 'least_connections'
1498+
| '""';
1499+
14021500
export interface LoadBalancerDeleteResponse {
14031501
id?: string;
14041502
}
@@ -1521,7 +1619,7 @@ export interface LoadBalancerCreateParams {
15211619
* `headers` in `session_affinity_attributes` for additional required
15221620
* configuration.
15231621
*/
1524-
session_affinity?: 'none' | 'cookie' | 'ip_cookie' | 'header' | '""';
1622+
session_affinity?: SessionAffinityParam;
15251623

15261624
/**
15271625
* Body param: Configures attributes for session affinity.
@@ -1567,15 +1665,7 @@ export interface LoadBalancerCreateParams {
15671665
* - `""`: Will map to `"geo"` if you use
15681666
* `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
15691667
*/
1570-
steering_policy?:
1571-
| 'off'
1572-
| 'geo'
1573-
| 'random'
1574-
| 'dynamic_latency'
1575-
| 'proximity'
1576-
| 'least_outstanding_requests'
1577-
| 'least_connections'
1578-
| '""';
1668+
steering_policy?: SteeringPolicyParam;
15791669

15801670
/**
15811671
* Body param: Time to live (TTL) of the DNS entry for the IP address returned by
@@ -1708,7 +1798,7 @@ export interface LoadBalancerUpdateParams {
17081798
* `headers` in `session_affinity_attributes` for additional required
17091799
* configuration.
17101800
*/
1711-
session_affinity?: 'none' | 'cookie' | 'ip_cookie' | 'header' | '""';
1801+
session_affinity?: SessionAffinityParam;
17121802

17131803
/**
17141804
* Body param: Configures attributes for session affinity.
@@ -1754,15 +1844,7 @@ export interface LoadBalancerUpdateParams {
17541844
* - `""`: Will map to `"geo"` if you use
17551845
* `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
17561846
*/
1757-
steering_policy?:
1758-
| 'off'
1759-
| 'geo'
1760-
| 'random'
1761-
| 'dynamic_latency'
1762-
| 'proximity'
1763-
| 'least_outstanding_requests'
1764-
| 'least_connections'
1765-
| '""';
1847+
steering_policy?: SteeringPolicyParam;
17661848

17671849
/**
17681850
* Body param: Time to live (TTL) of the DNS entry for the IP address returned by
@@ -1903,7 +1985,7 @@ export interface LoadBalancerEditParams {
19031985
* `headers` in `session_affinity_attributes` for additional required
19041986
* configuration.
19051987
*/
1906-
session_affinity?: 'none' | 'cookie' | 'ip_cookie' | 'header' | '""';
1988+
session_affinity?: SessionAffinityParam;
19071989

19081990
/**
19091991
* Body param: Configures attributes for session affinity.
@@ -1949,15 +2031,7 @@ export interface LoadBalancerEditParams {
19492031
* - `""`: Will map to `"geo"` if you use
19502032
* `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
19512033
*/
1952-
steering_policy?:
1953-
| 'off'
1954-
| 'geo'
1955-
| 'random'
1956-
| 'dynamic_latency'
1957-
| 'proximity'
1958-
| 'least_outstanding_requests'
1959-
| 'least_connections'
1960-
| '""';
2034+
steering_policy?: SteeringPolicyParam;
19612035

19622036
/**
19632037
* Body param: Time to live (TTL) of the DNS entry for the IP address returned by

0 commit comments

Comments
 (0)