Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#485)
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 bc21852 commit 72c9a7a
Show file tree
Hide file tree
Showing 9 changed files with 156 additions and 83 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 @@ Types:

- <code><a href="./src/resources/shared.ts">ASN</a></code>
- <code><a href="./src/resources/shared.ts">AuditLog</a></code>
- <code><a href="./src/resources/shared.ts">CertificateCA</a></code>
- <code><a href="./src/resources/shared.ts">CertificateRequestType</a></code>
- <code><a href="./src/resources/shared.ts">CloudflareTunnel</a></code>
- <code><a href="./src/resources/shared.ts">ErrorData</a></code>
Expand Down Expand Up @@ -891,7 +892,9 @@ Types:
- <code><a href="./src/resources/load-balancers/load-balancers.ts">OriginSteering</a></code>
- <code><a href="./src/resources/load-balancers/load-balancers.ts">RandomSteering</a></code>
- <code><a href="./src/resources/load-balancers/load-balancers.ts">Rules</a></code>
- <code><a href="./src/resources/load-balancers/load-balancers.ts">SessionAffinity</a></code>
- <code><a href="./src/resources/load-balancers/load-balancers.ts">SessionAffinityAttributes</a></code>
- <code><a href="./src/resources/load-balancers/load-balancers.ts">SteeringPolicy</a></code>
- <code><a href="./src/resources/load-balancers/load-balancers.ts">LoadBalancerDeleteResponse</a></code>

Methods:
Expand Down Expand Up @@ -1095,7 +1098,6 @@ Methods:

Types:

- <code><a href="./src/resources/ssl/certificate-packs/certificate-packs.ts">CertificateAuthority</a></code>
- <code><a href="./src/resources/ssl/certificate-packs/certificate-packs.ts">Host</a></code>
- <code><a href="./src/resources/ssl/certificate-packs/certificate-packs.ts">RequestValidity</a></code>
- <code><a href="./src/resources/ssl/certificate-packs/certificate-packs.ts">Status</a></code>
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ export namespace Cloudflare {

export import ASN = API.ASN;
export import AuditLog = API.AuditLog;
export import CertificateCA = API.CertificateCA;
export import CertificateRequestType = API.CertificateRequestType;
export import CloudflareTunnel = API.CloudflareTunnel;
export import ErrorData = API.ErrorData;
Expand Down
16 changes: 8 additions & 8 deletions src/resources/custom-hostnames/custom-hostnames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as CustomHostnamesAPI from 'cloudflare/resources/custom-hostnames/custom-hostnames';
import * as Shared from 'cloudflare/resources/shared';
import * as FallbackOriginAPI from 'cloudflare/resources/custom-hostnames/fallback-origin';
import * as CertificatePacksAPI from 'cloudflare/resources/ssl/certificate-packs/certificate-packs';
import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination';

export class CustomHostnames extends APIResource {
Expand Down Expand Up @@ -213,7 +213,7 @@ export namespace CustomHostname {
/**
* The Certificate Authority that will issue the certificate
*/
certificate_authority?: CertificatePacksAPI.CertificateAuthority;
certificate_authority?: Shared.CertificateCA;

/**
* If a custom uploaded certificate is used.
Expand Down Expand Up @@ -560,7 +560,7 @@ export namespace CustomHostnameCreateResponse {
/**
* The Certificate Authority that will issue the certificate
*/
certificate_authority?: CertificatePacksAPI.CertificateAuthority;
certificate_authority?: Shared.CertificateCA;

/**
* If a custom uploaded certificate is used.
Expand Down Expand Up @@ -885,7 +885,7 @@ export namespace CustomHostnameListResponse {
/**
* The Certificate Authority that will issue the certificate
*/
certificate_authority?: CertificatePacksAPI.CertificateAuthority;
certificate_authority?: Shared.CertificateCA;

/**
* If a custom uploaded certificate is used.
Expand Down Expand Up @@ -1217,7 +1217,7 @@ export namespace CustomHostnameEditResponse {
/**
* The Certificate Authority that will issue the certificate
*/
certificate_authority?: CertificatePacksAPI.CertificateAuthority;
certificate_authority?: Shared.CertificateCA;

/**
* If a custom uploaded certificate is used.
Expand Down Expand Up @@ -1542,7 +1542,7 @@ export namespace CustomHostnameGetResponse {
/**
* The Certificate Authority that will issue the certificate
*/
certificate_authority?: CertificatePacksAPI.CertificateAuthority;
certificate_authority?: Shared.CertificateCA;

/**
* If a custom uploaded certificate is used.
Expand Down Expand Up @@ -1805,7 +1805,7 @@ export namespace CustomHostnameCreateParams {
/**
* The Certificate Authority that will issue the certificate
*/
certificate_authority?: CertificatePacksAPI.CertificateAuthorityParam;
certificate_authority?: Shared.CertificateCAParam;

/**
* If a custom uploaded certificate is used.
Expand Down Expand Up @@ -1983,7 +1983,7 @@ export namespace CustomHostnameEditParams {
/**
* The Certificate Authority that will issue the certificate
*/
certificate_authority?: CertificatePacksAPI.CertificateAuthorityParam;
certificate_authority?: Shared.CertificateCAParam;

/**
* If a custom uploaded certificate is used.
Expand Down
194 changes: 134 additions & 60 deletions src/resources/load-balancers/load-balancers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ export interface LoadBalancer {
* `headers` in `session_affinity_attributes` for additional required
* configuration.
*/
session_affinity?: 'none' | 'cookie' | 'ip_cookie' | 'header' | '""';
session_affinity?: SessionAffinity;

/**
* Configures attributes for session affinity.
Expand Down Expand Up @@ -434,15 +434,7 @@ export interface LoadBalancer {
* - `""`: Will map to `"geo"` if you use
* `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
*/
steering_policy?:
| 'off'
| 'geo'
| 'random'
| 'dynamic_latency'
| 'proximity'
| 'least_outstanding_requests'
| 'least_connections'
| '""';
steering_policy?: SteeringPolicy;

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

/**
* Configures attributes for session affinity.
Expand Down Expand Up @@ -1012,15 +1004,7 @@ export namespace Rules {
* - `""`: Will map to `"geo"` if you use
* `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
*/
steering_policy?:
| 'off'
| 'geo'
| 'random'
| 'dynamic_latency'
| 'proximity'
| 'least_outstanding_requests'
| 'least_connections'
| '""';
steering_policy?: LoadBalancersAPI.SteeringPolicy;

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

/**
* Configures attributes for session affinity.
Expand Down Expand Up @@ -1247,15 +1231,7 @@ export namespace RulesParam {
* - `""`: Will map to `"geo"` if you use
* `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
*/
steering_policy?:
| 'off'
| 'geo'
| 'random'
| 'dynamic_latency'
| 'proximity'
| 'least_outstanding_requests'
| 'least_connections'
| '""';
steering_policy?: LoadBalancersAPI.SteeringPolicyParam;

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

/**
* Specifies the type of session affinity the load balancer should use unless
* specified as `"none"` or "" (default). The supported types are:
*
* - `"cookie"`: On the first request to a proxied load balancer, a cookie is
* generated, encoding information of which origin the request will be forwarded
* to. Subsequent requests, by the same client to the same load balancer, will be
* sent to the origin server the cookie encodes, for the duration of the cookie
* and as long as the origin server remains healthy. If the cookie has expired or
* the origin server is unhealthy, then a new origin server is calculated and
* used.
* - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
* selection is stable and based on the client's ip address.
* - `"header"`: On the first request to a proxied load balancer, a session key
* based on the configured HTTP headers (see
* `session_affinity_attributes.headers`) is generated, encoding the request
* headers used for storing in the load balancer session state which origin the
* request will be forwarded to. Subsequent requests to the load balancer with
* the same headers will be sent to the same origin server, for the duration of
* the session and as long as the origin server remains healthy. If the session
* has been idle for the duration of `session_affinity_ttl` seconds or the origin
* server is unhealthy, then a new origin server is calculated and used. See
* `headers` in `session_affinity_attributes` for additional required
* configuration.
*/
export type SessionAffinity = 'none' | 'cookie' | 'ip_cookie' | 'header' | '""';

/**
* Specifies the type of session affinity the load balancer should use unless
* specified as `"none"` or "" (default). The supported types are:
*
* - `"cookie"`: On the first request to a proxied load balancer, a cookie is
* generated, encoding information of which origin the request will be forwarded
* to. Subsequent requests, by the same client to the same load balancer, will be
* sent to the origin server the cookie encodes, for the duration of the cookie
* and as long as the origin server remains healthy. If the cookie has expired or
* the origin server is unhealthy, then a new origin server is calculated and
* used.
* - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
* selection is stable and based on the client's ip address.
* - `"header"`: On the first request to a proxied load balancer, a session key
* based on the configured HTTP headers (see
* `session_affinity_attributes.headers`) is generated, encoding the request
* headers used for storing in the load balancer session state which origin the
* request will be forwarded to. Subsequent requests to the load balancer with
* the same headers will be sent to the same origin server, for the duration of
* the session and as long as the origin server remains healthy. If the session
* has been idle for the duration of `session_affinity_ttl` seconds or the origin
* server is unhealthy, then a new origin server is calculated and used. See
* `headers` in `session_affinity_attributes` for additional required
* configuration.
*/
export type SessionAffinityParam = 'none' | 'cookie' | 'ip_cookie' | 'header' | '""';

/**
* Configures attributes for session affinity.
*/
Expand Down Expand Up @@ -1399,6 +1429,74 @@ export interface SessionAffinityAttributesParam {
zero_downtime_failover?: 'none' | 'temporary' | 'sticky';
}

/**
* Steering Policy for this load balancer.
*
* - `"off"`: Use `default_pools`.
* - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
* requests, the country for `country_pools` is determined by
* `location_strategy`.
* - `"random"`: Select a pool randomly.
* - `"dynamic_latency"`: Use round trip time to select the closest pool in
* default_pools (requires pool health checks).
* - `"proximity"`: Use the pools' latitude and longitude to select the closest
* pool using the Cloudflare PoP location for proxied requests or the location
* determined by `location_strategy` for non-proxied requests.
* - `"least_outstanding_requests"`: Select a pool by taking into consideration
* `random_steering` weights, as well as each pool's number of outstanding
* requests. Pools with more pending requests are weighted proportionately less
* relative to others.
* - `"least_connections"`: Select a pool by taking into consideration
* `random_steering` weights, as well as each pool's number of open connections.
* Pools with more open connections are weighted proportionately less relative to
* others. Supported for HTTP/1 and HTTP/2 connections.
* - `""`: Will map to `"geo"` if you use
* `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
*/
export type SteeringPolicy =
| 'off'
| 'geo'
| 'random'
| 'dynamic_latency'
| 'proximity'
| 'least_outstanding_requests'
| 'least_connections'
| '""';

/**
* Steering Policy for this load balancer.
*
* - `"off"`: Use `default_pools`.
* - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
* requests, the country for `country_pools` is determined by
* `location_strategy`.
* - `"random"`: Select a pool randomly.
* - `"dynamic_latency"`: Use round trip time to select the closest pool in
* default_pools (requires pool health checks).
* - `"proximity"`: Use the pools' latitude and longitude to select the closest
* pool using the Cloudflare PoP location for proxied requests or the location
* determined by `location_strategy` for non-proxied requests.
* - `"least_outstanding_requests"`: Select a pool by taking into consideration
* `random_steering` weights, as well as each pool's number of outstanding
* requests. Pools with more pending requests are weighted proportionately less
* relative to others.
* - `"least_connections"`: Select a pool by taking into consideration
* `random_steering` weights, as well as each pool's number of open connections.
* Pools with more open connections are weighted proportionately less relative to
* others. Supported for HTTP/1 and HTTP/2 connections.
* - `""`: Will map to `"geo"` if you use
* `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
*/
export type SteeringPolicyParam =
| 'off'
| 'geo'
| 'random'
| 'dynamic_latency'
| 'proximity'
| 'least_outstanding_requests'
| 'least_connections'
| '""';

export interface LoadBalancerDeleteResponse {
id?: string;
}
Expand Down Expand Up @@ -1521,7 +1619,7 @@ export interface LoadBalancerCreateParams {
* `headers` in `session_affinity_attributes` for additional required
* configuration.
*/
session_affinity?: 'none' | 'cookie' | 'ip_cookie' | 'header' | '""';
session_affinity?: SessionAffinityParam;

/**
* Body param: Configures attributes for session affinity.
Expand Down Expand Up @@ -1567,15 +1665,7 @@ export interface LoadBalancerCreateParams {
* - `""`: Will map to `"geo"` if you use
* `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
*/
steering_policy?:
| 'off'
| 'geo'
| 'random'
| 'dynamic_latency'
| 'proximity'
| 'least_outstanding_requests'
| 'least_connections'
| '""';
steering_policy?: SteeringPolicyParam;

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

/**
* Body param: Configures attributes for session affinity.
Expand Down Expand Up @@ -1754,15 +1844,7 @@ export interface LoadBalancerUpdateParams {
* - `""`: Will map to `"geo"` if you use
* `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
*/
steering_policy?:
| 'off'
| 'geo'
| 'random'
| 'dynamic_latency'
| 'proximity'
| 'least_outstanding_requests'
| 'least_connections'
| '""';
steering_policy?: SteeringPolicyParam;

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

/**
* Body param: Configures attributes for session affinity.
Expand Down Expand Up @@ -1949,15 +2031,7 @@ export interface LoadBalancerEditParams {
* - `""`: Will map to `"geo"` if you use
* `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
*/
steering_policy?:
| 'off'
| 'geo'
| 'random'
| 'dynamic_latency'
| 'proximity'
| 'least_outstanding_requests'
| 'least_connections'
| '""';
steering_policy?: SteeringPolicyParam;

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

0 comments on commit 72c9a7a

Please sign in to comment.