// AUTO-GENERATED by scripts/generate.ts from .generated-specs. Do not edit. import * as S from "@distilled.cloud/core/schema"; import * as API from "@distilled.cloud/core/api"; import * as T from "../traits.ts"; import { CloudflareProtocol, CloudflarePaginatedProtocol, type CloudflareOpError, type CloudflareOpContext, } from "../protocol.ts"; import { cloudflarePaginate, ResultInfo } from "../pagination.ts"; import { CloudflareError, CloudflareRateLimited } from "../errors.ts"; import * as Retry from "../retry.ts"; export type { CloudflareOpError, CloudflareOpContext }; /** Fallback camelCase→wire mapping for opaque content (mined from the distilled SDK). */ const KEY_DICTIONARY: Record> = { adaptiveRouting: "adaptive_routing", allowInsecure: "allow_insecure", checkRegions: "check_regions", consecutiveDown: "consecutive_down", consecutiveUp: "consecutive_up", contentType: "content_type", countryPools: "country_pools", createdAt: "created_at", createdOn: "created_on", defaultPercent: "default_percent", defaultPolicy: "default_policy", defaultPools: "default_pools", defaultWeight: "default_weight", disabledAt: "disabled_at", drainDuration: "drain_duration", expectedBody: "expected_body", expectedCodes: "expected_codes", failoverAcrossPools: "failover_across_pools", failureReason: "failure_reason", fallbackPool: "fallback_pool", fixedResponse: "fixed_response", flattenCname: "flatten_cname", followRedirects: "follow_redirects", host: "Host", loadShedding: "load_shedding", locationStrategy: "location_strategy", messageBody: "message_body", minimumOrigins: "minimum_origins", modifiedOn: "modified_on", monitorGroup: "monitor_group", monitorId: "monitor_id", monitoringOnly: "monitoring_only", mustBeHealthy: "must_be_healthy", notificationEmail: "notification_email", notificationFilter: "notification_filter", originSteering: "origin_steering", perPage: "per_page", poolId: "pool_id", poolWeights: "pool_weights", popHealth: "pop_health", popPools: "pop_pools", preferEcs: "prefer_ecs", previewId: "preview_id", probeZone: "probe_zone", randomSteering: "random_steering", referenceType: "reference_type", regionPools: "region_pools", requireAllHeaders: "require_all_headers", resourceId: "resource_id", resourceName: "resource_name", resourceType: "resource_type", responseCode: "response_code", resultInfo: "result_info", sessionAffinity: "session_affinity", sessionAffinityAttributes: "session_affinity_attributes", sessionAffinityTtl: "session_affinity_ttl", sessionPercent: "session_percent", sessionPolicy: "session_policy", statusCode: "status_code", steeringPolicy: "steering_policy", totalCount: "total_count", updatedAt: "updated_at", virtualNetworkId: "virtual_network_id", zeroDowntimeFailover: "zero_downtime_failover", zoneName: "zone_name", }; export class Forbidden extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("Forbidden", { code: S.Number, message: S.String, }), [{ status: 403 }], ) {} export class LoadBalancerNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "LoadBalancerNotFound", { code: S.Number, message: S.String, }, ), [{ code: 1001 }], ) {} export class LoadBalancingNotEnabledForZone extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "LoadBalancingNotEnabledForZone", { code: S.Number, message: S.String, }, ), [{ code: 1002, message: { includes: "load balancing not enabled" } }], ) {} export class MonitorGroupInUse extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("MonitorGroupInUse", { code: S.Number, message: S.String, }), [{ code: 1002, message: { includes: "still referenced" } }], ) {} export class MonitorGroupNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "MonitorGroupNotFound", { code: S.Number, message: S.String, }, ), [{ code: 1001 }], ) {} export class MonitorGroupsNotEnabled extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "MonitorGroupsNotEnabled", { code: S.Number, message: S.String, }, ), [{ code: 1002, message: { includes: "monitor groups not enabled" } }], ) {} export class MonitorIntervalOutOfRange extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "MonitorIntervalOutOfRange", { code: S.Number, message: S.String, }, ), [{ code: 1002, message: { includes: "interval is not in range" } }], ) {} export class MonitorInUse extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("MonitorInUse", { code: S.Number, message: S.String, }), [{ code: 1002, message: { includes: "still referenced" } }], ) {} export class MonitorNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("MonitorNotFound", { code: S.Number, message: S.String, }), [{ code: 1001 }], ) {} export class PoolAccessFailed extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("PoolAccessFailed", { code: S.Number, message: S.String, }), [{ code: 1002, message: { includes: "Access Failed" } }], ) {} export class PoolInUse extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("PoolInUse", { code: S.Number, message: S.String, }), [{ code: 1002, message: { includes: "still referenced" } }], ) {} export class PoolNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("PoolNotFound", { code: S.Number, message: S.String, }), [{ code: 1001 }], ) {} export type PoolsBulkEditRequestNotificationEmail = ""; export const PoolsBulkEditRequestNotificationEmail = /*@__PURE__*/ S.String; export interface BulkPatchPoolsRequest { /** Identifier. */ accountId: string; /** The email address to send health status notifications to. This field is now deprecated in favor of Cloudflare Notifications for Load Balancing, so only resetting this field with an empty string `""` is accepted. */ notificationEmail?: PoolsBulkEditRequestNotificationEmail | (string & {}); } export const BulkPatchPoolsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), notificationEmail: S.optional( PoolsBulkEditRequestNotificationEmail.pipe(T.Body("notification_email")), ), }) .pipe( T.Http({ method: "PATCH", uri: "/accounts/{account_id}/load_balancers/pools", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "BulkPatchPoolsRequest", }) as any as S.Schema; export type PoolsBulkEditResultItemCheckRegionsItem = | "WNAM" | "ENAM" | "WEU" | "EEU" | "NSAM" | "SSAM" | "OC" | "ME" | "NAF" | "SAF" | "SAS" | "SEAS" | "NEAS" | "ALL_REGIONS"; export const PoolsBulkEditResultItemCheckRegionsItem = /*@__PURE__*/ S.String; export type PoolsBulkEditResultItemCheckRegionsList = Array; export const PoolsBulkEditResultItemCheckRegionsList = /*@__PURE__*/ S.Array( PoolsBulkEditResultItemCheckRegionsItem, ) as any as S.Schema; export type PoolsBulkEditResultItemLoadSheddingDefaultPolicy = | "random" | "hash"; export const PoolsBulkEditResultItemLoadSheddingDefaultPolicy = /*@__PURE__*/ S.String; export type PoolsBulkEditResultItemLoadSheddingSessionPolicy = "hash"; export const PoolsBulkEditResultItemLoadSheddingSessionPolicy = /*@__PURE__*/ S.String; export interface PoolsBulkEditResultItemLoadShedding { /** The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity. */ defaultPercent?: number | null; /** The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs. */ defaultPolicy?: PoolsBulkEditResultItemLoadSheddingDefaultPolicy | null; /** The percent of existing sessions to shed from the pool, according to the session policy. */ sessionPercent?: number | null; /** Only the hash policy is supported for existing sessions (to avoid exponential decay). */ sessionPolicy?: PoolsBulkEditResultItemLoadSheddingSessionPolicy | null; } export const PoolsBulkEditResultItemLoadShedding = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultPercent: S.optional( S.NullOr(S.Number).pipe(T.Body("default_percent")), ), defaultPolicy: S.optional( S.NullOr(PoolsBulkEditResultItemLoadSheddingDefaultPolicy).pipe( T.Body("default_policy"), ), ), sessionPercent: S.optional( S.NullOr(S.Number).pipe(T.Body("session_percent")), ), sessionPolicy: S.optional( S.NullOr(PoolsBulkEditResultItemLoadSheddingSessionPolicy).pipe( T.Body("session_policy"), ), ), }), ).annotate({ identifier: "PoolsBulkEditResultItemLoadShedding", }) as any as S.Schema; export type PoolsBulkEditResultItemNetworksList = Array; export const PoolsBulkEditResultItemNetworksList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface PoolsBulkEditResultItemNotificationFilterOrigin { /** If set true, disable notifications for this type of resource (pool or origin). */ disable?: boolean | null; /** If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events). */ healthy?: boolean | null; } export const PoolsBulkEditResultItemNotificationFilterOrigin = /*@__PURE__*/ S.suspend(() => S.Struct({ disable: S.optional(S.NullOr(S.Boolean)), healthy: S.optional(S.NullOr(S.Boolean)), }), ).annotate({ identifier: "PoolsBulkEditResultItemNotificationFilterOrigin", }) as any as S.Schema; export interface PoolsBulkEditResultItemNotificationFilter { /** Filter options for a particular resource type (pool or origin). Use null to reset. */ origin?: PoolsBulkEditResultItemNotificationFilterOrigin | null; /** Filter options for a particular resource type (pool or origin). Use null to reset. */ pool?: PoolsBulkEditResultItemNotificationFilterOrigin | null; } export const PoolsBulkEditResultItemNotificationFilter = /*@__PURE__*/ S.suspend(() => S.Struct({ origin: S.optional( S.NullOr(PoolsBulkEditResultItemNotificationFilterOrigin), ), pool: S.optional( S.NullOr(PoolsBulkEditResultItemNotificationFilterOrigin), ), }), ).annotate({ identifier: "PoolsBulkEditResultItemNotificationFilter", }) as any as S.Schema; export type PoolsBulkEditResultItemOriginSteeringPolicy = | "random" | "hash" | "least_outstanding_requests" | "least_connections"; export const PoolsBulkEditResultItemOriginSteeringPolicy = /*@__PURE__*/ S.String; export interface PoolsBulkEditResultItemOriginSteering { /** The type of origin steering policy to use. */ policy?: PoolsBulkEditResultItemOriginSteeringPolicy | null; } export const PoolsBulkEditResultItemOriginSteering = /*@__PURE__*/ S.suspend( () => S.Struct({ policy: S.optional(S.NullOr(PoolsBulkEditResultItemOriginSteeringPolicy)), }), ).annotate({ identifier: "PoolsBulkEditResultItemOriginSteering", }) as any as S.Schema; export type PoolsBulkEditResultItemOriginsItemHeaderHostList = Array; export const PoolsBulkEditResultItemOriginsItemHeaderHostList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface PoolsBulkEditResultItemOriginsItemHeader { /** The 'Host' header allows to override the hostname set in the HTTP request. Current support is 1 'Host' header override per origin. */ host?: PoolsBulkEditResultItemOriginsItemHeaderHostList | null; } export const PoolsBulkEditResultItemOriginsItemHeader = /*@__PURE__*/ S.suspend( () => S.Struct({ host: S.optional( S.NullOr(PoolsBulkEditResultItemOriginsItemHeaderHostList).pipe( T.Body("Host"), ), ), }), ).annotate({ identifier: "PoolsBulkEditResultItemOriginsItemHeader", }) as any as S.Schema; export interface PoolsBulkEditResultItemOriginsItem { /** The IP address (IPv4 or IPv6) of the origin, or its publicly addressable hostname. Hostnames entered here should resolve directly to the origin, and not be a hostname proxied by Cloudflare. To set an internal/reserved address, virtual_network_id must also be set. */ address?: string | null; /** This field shows up only if the origin is disabled. This field is set with the time the origin was disabled. */ disabledAt?: string | null; /** Whether to enable (the default) this origin within the pool. Disabled origins will not receive traffic and are excluded from health checks. The origin will only be disabled for the current pool. */ enabled?: boolean | null; /** Whether to flatten CNAME records for this origin, resolving them to A/AAAA records before returning to the client. When true (the default), the director resolves CNAME addresses to their underlying A/AAAA records. When false, the origin address is returned as a raw CNAME record without resolution. This setting mirrors the DNS API record flatten_cname setting. */ flattenCname?: boolean | null; /** The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'. */ header?: PoolsBulkEditResultItemOriginsItemHeader | null; /** A human-identifiable name for the origin. */ name?: string | null; /** The port for upstream connections. A value of 0 means the default port for the protocol will be used. */ port?: number | null; /** The virtual network subnet ID the origin belongs in. Virtual network must also belong to the account. */ virtualNetworkId?: string | null; /** The weight of this origin relative to other origins in the pool. Based on the configured weight the total traffic is distributed among origins within the pool. */ weight?: number | null; } export const PoolsBulkEditResultItemOriginsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ address: S.optional(S.NullOr(S.String)), disabledAt: S.optional(S.NullOr(S.String).pipe(T.Body("disabled_at"))), enabled: S.optional(S.NullOr(S.Boolean)), flattenCname: S.optional(S.NullOr(S.Boolean).pipe(T.Body("flatten_cname"))), header: S.optional(S.NullOr(PoolsBulkEditResultItemOriginsItemHeader)), name: S.optional(S.NullOr(S.String)), port: S.optional(S.NullOr(S.Number)), virtualNetworkId: S.optional( S.NullOr(S.String).pipe(T.Body("virtual_network_id")), ), weight: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "PoolsBulkEditResultItemOriginsItem", }) as any as S.Schema; export type PoolsBulkEditResultItemOriginsList = Array; export const PoolsBulkEditResultItemOriginsList = /*@__PURE__*/ S.Array( PoolsBulkEditResultItemOriginsItem, ) as any as S.Schema; export interface PoolsBulkEditResultItem { id?: string | null; /** A list of regions from which to run health checks. Null means every Cloudflare data center. */ checkRegions?: PoolsBulkEditResultItemCheckRegionsList | null; createdOn?: string | null; /** A human-readable description of the pool. */ description?: string | null; /** This field shows up only if the pool is disabled. This field is set with the time the pool was disabled at. */ disabledAt?: string | null; /** Whether to enable (the default) or disable this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any). */ enabled?: boolean | null; /** The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set. */ latitude?: number | null; /** Configures load shedding policies and percentages for the pool. */ loadShedding?: PoolsBulkEditResultItemLoadShedding | null; /** The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set. */ longitude?: number | null; /** The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and will failover to the next available pool. */ minimumOrigins?: number | null; modifiedOn?: string | null; /** The ID of the Monitor to use for checking the health of origins within this pool. */ monitor?: string | null; /** The ID of the Monitor Group to use for checking the health of origins within this pool. */ monitorGroup?: string | null; /** A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed. */ name?: string | null; /** List of networks where Load Balancer or Pool is enabled. */ networks?: PoolsBulkEditResultItemNetworksList | null; /** This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address to send health status notifications to. This can be an individual mailbox or a mailing list. Multiple emails can be supplied as a comma delimited list. */ notificationEmail?: string | null; /** Filter pool and origin health notifications by resource type or health status. Use null to reset. */ notificationFilter?: PoolsBulkEditResultItemNotificationFilter | null; /** Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity. */ originSteering?: PoolsBulkEditResultItemOriginSteering | null; /** The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. */ origins?: PoolsBulkEditResultItemOriginsList | null; } export const PoolsBulkEditResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), checkRegions: S.optional( S.NullOr(PoolsBulkEditResultItemCheckRegionsList).pipe( T.Body("check_regions"), ), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), description: S.optional(S.NullOr(S.String)), disabledAt: S.optional(S.NullOr(S.String).pipe(T.Body("disabled_at"))), enabled: S.optional(S.NullOr(S.Boolean)), latitude: S.optional(S.NullOr(S.Number)), loadShedding: S.optional( S.NullOr(PoolsBulkEditResultItemLoadShedding).pipe( T.Body("load_shedding"), ), ), longitude: S.optional(S.NullOr(S.Number)), minimumOrigins: S.optional( S.NullOr(S.Number).pipe(T.Body("minimum_origins")), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), monitor: S.optional(S.NullOr(S.String)), monitorGroup: S.optional(S.NullOr(S.String).pipe(T.Body("monitor_group"))), name: S.optional(S.NullOr(S.String)), networks: S.optional(S.NullOr(PoolsBulkEditResultItemNetworksList)), notificationEmail: S.optional( S.NullOr(S.String).pipe(T.Body("notification_email")), ), notificationFilter: S.optional( S.NullOr(PoolsBulkEditResultItemNotificationFilter).pipe( T.Body("notification_filter"), ), ), originSteering: S.optional( S.NullOr(PoolsBulkEditResultItemOriginSteering).pipe( T.Body("origin_steering"), ), ), origins: S.optional(S.NullOr(PoolsBulkEditResultItemOriginsList)), }), ).annotate({ identifier: "PoolsBulkEditResultItem", }) as any as S.Schema; export type PoolsBulkEditResultList = Array; export const PoolsBulkEditResultList = /*@__PURE__*/ S.Array( PoolsBulkEditResultItem, ) as any as S.Schema; export interface BulkPatchPoolsResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: PoolsBulkEditResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const BulkPatchPoolsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: PoolsBulkEditResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "BulkPatchPoolsResponse", }) as any as S.Schema; export type CreateRequestDefaultPoolsList = Array; export const CreateRequestDefaultPoolsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface CreateRequestAdaptiveRouting { /** Extends zero-downtime failover of requests to healthy origins from alternate pools, when no healthy alternate exists in the same pool, according to the failover order defined by traffic and origin steering. When set false (the default) zero-downtime failover will only occur between origins within the same pool. See `session_affinity_attributes` for control over when sessions are broken or reassigned. */ failoverAcrossPools?: boolean; } export const CreateRequestAdaptiveRouting = /*@__PURE__*/ S.suspend(() => S.Struct({ failoverAcrossPools: S.optional( S.Boolean.pipe(T.Body("failover_across_pools")), ), }), ).annotate({ identifier: "CreateRequestAdaptiveRouting", }) as any as S.Schema; export type CreateRequestCountryPoolsMap = { [key: string]: unknown | undefined; }; export const CreateRequestCountryPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type CreateRequestLocationStrategyMode = "pop" | "resolver_ip"; export const CreateRequestLocationStrategyMode = /*@__PURE__*/ S.String; export type CreateRequestLocationStrategyPreferEcs = | "always" | "never" | "proximity" | "geo"; export const CreateRequestLocationStrategyPreferEcs = /*@__PURE__*/ S.String; export interface CreateRequestLocationStrategy { /** Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful. */ mode?: CreateRequestLocationStrategyMode | (string & {}); /** Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location. */ preferEcs?: CreateRequestLocationStrategyPreferEcs | (string & {}); } export const CreateRequestLocationStrategy = /*@__PURE__*/ S.suspend(() => S.Struct({ mode: S.optional(CreateRequestLocationStrategyMode), preferEcs: S.optional( CreateRequestLocationStrategyPreferEcs.pipe(T.Body("prefer_ecs")), ), }), ).annotate({ identifier: "CreateRequestLocationStrategy", }) as any as S.Schema; export type CreateRequestNetworksList = Array; export const CreateRequestNetworksList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type CreateRequestPopPoolsMap = { [key: string]: unknown | undefined }; export const CreateRequestPopPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type CreateRequestRandomSteeringPoolWeightsMap = { [key: string]: number | undefined; }; export const CreateRequestRandomSteeringPoolWeightsMap = /*@__PURE__*/ S.Record( S.String, S.Number, ) as any as S.Schema; export interface CreateRequestRandomSteering { /** The default weight for pools in the load balancer that are not specified in the pool_weights map. */ defaultWeight?: number; /** A mapping of pool IDs to custom weights. The weight is relative to other pools in the load balancer. */ poolWeights?: CreateRequestRandomSteeringPoolWeightsMap; } export const CreateRequestRandomSteering = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultWeight: S.optional(S.Number.pipe(T.Body("default_weight"))), poolWeights: S.optional( CreateRequestRandomSteeringPoolWeightsMap.pipe(T.Body("pool_weights")), ), }), ).annotate({ identifier: "CreateRequestRandomSteering", }) as any as S.Schema; export type CreateRequestRegionPoolsMap = { [key: string]: unknown | undefined; }; export const CreateRequestRegionPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export interface CreateRequestRulesItemFixedResponse { /** The http 'Content-Type' header to include in the response. */ contentType?: string; /** The http 'Location' header to include in the response. */ location?: string; /** Text to include as the http body. */ messageBody?: string; /** The http status code to respond with. */ statusCode?: number; } export const CreateRequestRulesItemFixedResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ contentType: S.optional(S.String.pipe(T.Body("content_type"))), location: S.optional(S.String), messageBody: S.optional(S.String.pipe(T.Body("message_body"))), statusCode: S.optional(S.Number.pipe(T.Body("status_code"))), }), ).annotate({ identifier: "CreateRequestRulesItemFixedResponse", }) as any as S.Schema; export type CreateRequestRulesItemOverridesCountryPoolsMap = { [key: string]: unknown | undefined; }; export const CreateRequestRulesItemOverridesCountryPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type CreateRequestRulesItemOverridesDefaultPoolsList = Array; export const CreateRequestRulesItemOverridesDefaultPoolsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type CreateRequestRulesItemOverridesPopPoolsMap = { [key: string]: unknown | undefined; }; export const CreateRequestRulesItemOverridesPopPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type CreateRequestRulesItemOverridesRegionPoolsMap = { [key: string]: unknown | undefined; }; export const CreateRequestRulesItemOverridesRegionPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type CreateRequestRulesItemOverridesSessionAffinity = | "none" | "cookie" | "ip_cookie" | "header"; export const CreateRequestRulesItemOverridesSessionAffinity = /*@__PURE__*/ S.String; export type CreateRequestRulesItemOverridesSessionAffinityAttributesHeadersList = Array; export const CreateRequestRulesItemOverridesSessionAffinityAttributesHeadersList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type CreateRequestRulesItemOverridesSessionAffinityAttributesSamesite = | "Auto" | "Lax" | "None" | "Strict"; export const CreateRequestRulesItemOverridesSessionAffinityAttributesSamesite = /*@__PURE__*/ S.String; export type CreateRequestRulesItemOverridesSessionAffinityAttributesSecure = | "Auto" | "Always" | "Never"; export const CreateRequestRulesItemOverridesSessionAffinityAttributesSecure = /*@__PURE__*/ S.String; export type CreateRequestRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover = | "none" | "temporary" | "sticky"; export const CreateRequestRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover = /*@__PURE__*/ S.String; export interface CreateRequestRulesItemOverridesSessionAffinityAttributes { /** Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer. */ drainDuration?: number; /** Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:,"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans. */ headers?: CreateRequestRulesItemOverridesSessionAffinityAttributesHeadersList; /** When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren't created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren't created. */ requireAllHeaders?: boolean; /** Configures the SameSite attribute on session affinity cookie. Value "Auto" will be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: when using value "None", the secure attribute can not be set to "Never". */ samesite?: | CreateRequestRulesItemOverridesSessionAffinityAttributesSamesite | (string & {}); /** Configures the Secure attribute on session affinity cookie. Value "Always" indicates the Secure attribute will be set in the Set-Cookie header, "Never" indicates the Secure attribute will not be set, and "Auto" will set the Secure attribute depending if Always Use HTTPS is enabled. */ secure?: | CreateRequestRulesItemOverridesSessionAffinityAttributesSecure | (string & {}); /** Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are: - `"none"`: No failover takes place for sessions pinned to the origin (default). - `"temporary"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. - `"sticky"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header. */ zeroDowntimeFailover?: | CreateRequestRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover | (string & {}); } export const CreateRequestRulesItemOverridesSessionAffinityAttributes = /*@__PURE__*/ S.suspend(() => S.Struct({ drainDuration: S.optional(S.Number.pipe(T.Body("drain_duration"))), headers: S.optional( CreateRequestRulesItemOverridesSessionAffinityAttributesHeadersList, ), requireAllHeaders: S.optional( S.Boolean.pipe(T.Body("require_all_headers")), ), samesite: S.optional( CreateRequestRulesItemOverridesSessionAffinityAttributesSamesite, ), secure: S.optional( CreateRequestRulesItemOverridesSessionAffinityAttributesSecure, ), zeroDowntimeFailover: S.optional( CreateRequestRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover.pipe( T.Body("zero_downtime_failover"), ), ), }), ).annotate({ identifier: "CreateRequestRulesItemOverridesSessionAffinityAttributes", }) as any as S.Schema; export type CreateRequestRulesItemOverridesSteeringPolicy = | "off" | "geo" | "random" | "dynamic_latency" | "proximity" | "least_outstanding_requests" | "least_connections" | ""; export const CreateRequestRulesItemOverridesSteeringPolicy = /*@__PURE__*/ S.String; export interface CreateRequestRulesItemOverrides { /** Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin. */ adaptiveRouting?: CreateRequestAdaptiveRouting; /** A mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools. */ countryPools?: CreateRequestRulesItemOverridesCountryPoolsMap; /** A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region. */ defaultPools?: CreateRequestRulesItemOverridesDefaultPoolsList; /** The pool ID to use when all other pools are detected as unhealthy. */ fallbackPool?: string; /** Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected. */ locationStrategy?: CreateRequestLocationStrategy; /** Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. */ popPools?: CreateRequestRulesItemOverridesPopPoolsMap; /** Configures pool weights. */ randomSteering?: CreateRequestRandomSteering; /** A mapping of region codes to a list of pool IDs (ordered by their failover priority) for the given region. Any regions not explicitly defined will fall back to using default_pools. */ regionPools?: CreateRequestRulesItemOverridesRegionPoolsMap; /** Specifies the type of session affinity the load balancer should use unless specified as `"none"`. 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. */ sessionAffinity?: | CreateRequestRulesItemOverridesSessionAffinity | (string & {}); /** Configures attributes for session affinity. */ sessionAffinityAttributes?: CreateRequestRulesItemOverridesSessionAffinityAttributes; /** Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven't been used for the number of seconds specified. */ sessionAffinityTtl?: number; /** Steering Policy for this load balancer. */ steeringPolicy?: | CreateRequestRulesItemOverridesSteeringPolicy | (string & {}); /** Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers. */ ttl?: number; } export const CreateRequestRulesItemOverrides = /*@__PURE__*/ S.suspend(() => S.Struct({ adaptiveRouting: S.optional( CreateRequestAdaptiveRouting.pipe(T.Body("adaptive_routing")), ), countryPools: S.optional( CreateRequestRulesItemOverridesCountryPoolsMap.pipe( T.Body("country_pools"), ), ), defaultPools: S.optional( CreateRequestRulesItemOverridesDefaultPoolsList.pipe( T.Body("default_pools"), ), ), fallbackPool: S.optional(S.String.pipe(T.Body("fallback_pool"))), locationStrategy: S.optional( CreateRequestLocationStrategy.pipe(T.Body("location_strategy")), ), popPools: S.optional( CreateRequestRulesItemOverridesPopPoolsMap.pipe(T.Body("pop_pools")), ), randomSteering: S.optional( CreateRequestRandomSteering.pipe(T.Body("random_steering")), ), regionPools: S.optional( CreateRequestRulesItemOverridesRegionPoolsMap.pipe( T.Body("region_pools"), ), ), sessionAffinity: S.optional( CreateRequestRulesItemOverridesSessionAffinity.pipe( T.Body("session_affinity"), ), ), sessionAffinityAttributes: S.optional( CreateRequestRulesItemOverridesSessionAffinityAttributes.pipe( T.Body("session_affinity_attributes"), ), ), sessionAffinityTtl: S.optional( S.Number.pipe(T.Body("session_affinity_ttl")), ), steeringPolicy: S.optional( CreateRequestRulesItemOverridesSteeringPolicy.pipe( T.Body("steering_policy"), ), ), ttl: S.optional(S.Number), }), ).annotate({ identifier: "CreateRequestRulesItemOverrides", }) as any as S.Schema; export interface CreateRequestRulesItem { /** The condition expressions to evaluate. If the condition evaluates to true, the overrides or fixed_response in this rule will be applied. An empty condition is always true. For more details on condition expressions, please see https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions. */ condition?: string; /** Disable this specific rule. It will no longer be evaluated by this load balancer. */ disabled?: boolean; /** A collection of fields used to directly respond to the eyeball instead of routing to a pool. If a fixed_response is supplied the rule will be marked as terminates. */ fixedResponse?: CreateRequestRulesItemFixedResponse; /** Name of this rule. Only used for human readability. */ name?: string; /** A collection of overrides to apply to the load balancer when this rule's condition is true. All fields are optional. */ overrides?: CreateRequestRulesItemOverrides; /** The order in which rules should be executed in relation to each other. Lower values are executed first. Values do not need to be sequential. If no value is provided for any rule the array order of the rules field will be used to assign a priority. */ priority?: number; /** If this rule's condition is true, this causes rule evaluation to stop after processing this rule. */ terminates?: boolean; } export const CreateRequestRulesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ condition: S.optional(S.String), disabled: S.optional(S.Boolean), fixedResponse: S.optional( CreateRequestRulesItemFixedResponse.pipe(T.Body("fixed_response")), ), name: S.optional(S.String), overrides: S.optional(CreateRequestRulesItemOverrides), priority: S.optional(S.Number), terminates: S.optional(S.Boolean), }), ).annotate({ identifier: "CreateRequestRulesItem", }) as any as S.Schema; export type CreateRequestRulesList = Array; export const CreateRequestRulesList = /*@__PURE__*/ S.Array( CreateRequestRulesItem, ) as any as S.Schema; export interface CreateLoadBalancerRequest { zoneId: string; /** A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region. */ defaultPools: CreateRequestDefaultPoolsList; /** The pool ID to use when all other pools are detected as unhealthy. */ fallbackPool: string; /** The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used. */ name: string; /** Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin. */ adaptiveRouting?: CreateRequestAdaptiveRouting; /** A mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools. */ countryPools?: CreateRequestCountryPoolsMap; /** Object description. */ description?: string; /** Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected. */ locationStrategy?: CreateRequestLocationStrategy; /** List of networks where Load Balancer or Pool is enabled. */ networks?: CreateRequestNetworksList; /** Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. */ popPools?: CreateRequestPopPoolsMap; /** Whether the hostname should be gray clouded (false) or orange clouded (true). */ proxied?: boolean; /** Configures pool weights. */ randomSteering?: CreateRequestRandomSteering; /** A mapping of region codes to a list of pool IDs (ordered by their failover priority) for the given region. Any regions not explicitly defined will fall back to using default_pools. */ regionPools?: CreateRequestRegionPoolsMap; /** BETA Field Not General Access: A list of rules for this load balancer to execute. */ rules?: CreateRequestRulesList; /** Specifies the type of session affinity the load balancer should use unless specified as `"none"`. 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. */ sessionAffinity?: | CreateRequestRulesItemOverridesSessionAffinity | (string & {}); /** Configures attributes for session affinity. */ sessionAffinityAttributes?: CreateRequestRulesItemOverridesSessionAffinityAttributes; /** Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven't been used for the number of seconds specified. */ sessionAffinityTtl?: number; /** Steering Policy for this load balancer. */ steeringPolicy?: | CreateRequestRulesItemOverridesSteeringPolicy | (string & {}); /** Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers. */ ttl?: number; } export const CreateLoadBalancerRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), defaultPools: CreateRequestDefaultPoolsList.pipe(T.Body("default_pools")), fallbackPool: S.String.pipe(T.Body("fallback_pool")), name: S.String, adaptiveRouting: S.optional( CreateRequestAdaptiveRouting.pipe(T.Body("adaptive_routing")), ), countryPools: S.optional( CreateRequestCountryPoolsMap.pipe(T.Body("country_pools")), ), description: S.optional(S.String), locationStrategy: S.optional( CreateRequestLocationStrategy.pipe(T.Body("location_strategy")), ), networks: S.optional(CreateRequestNetworksList), popPools: S.optional(CreateRequestPopPoolsMap.pipe(T.Body("pop_pools"))), proxied: S.optional(S.Boolean), randomSteering: S.optional( CreateRequestRandomSteering.pipe(T.Body("random_steering")), ), regionPools: S.optional( CreateRequestRegionPoolsMap.pipe(T.Body("region_pools")), ), rules: S.optional(CreateRequestRulesList), sessionAffinity: S.optional( CreateRequestRulesItemOverridesSessionAffinity.pipe( T.Body("session_affinity"), ), ), sessionAffinityAttributes: S.optional( CreateRequestRulesItemOverridesSessionAffinityAttributes.pipe( T.Body("session_affinity_attributes"), ), ), sessionAffinityTtl: S.optional( S.Number.pipe(T.Body("session_affinity_ttl")), ), steeringPolicy: S.optional( CreateRequestRulesItemOverridesSteeringPolicy.pipe( T.Body("steering_policy"), ), ), ttl: S.optional(S.Number), }) .pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/load_balancers", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateLoadBalancerRequest", }) as any as S.Schema; export interface CreateResponseAdaptiveRouting { /** Extends zero-downtime failover of requests to healthy origins from alternate pools, when no healthy alternate exists in the same pool, according to the failover order defined by traffic and origin steering. When set false (the default) zero-downtime failover will only occur between origins within the same pool. See `session_affinity_attributes` for control over when sessions are broken or reassigned. */ failoverAcrossPools?: boolean | null; } export const CreateResponseAdaptiveRouting = /*@__PURE__*/ S.suspend(() => S.Struct({ failoverAcrossPools: S.optional( S.NullOr(S.Boolean).pipe(T.Body("failover_across_pools")), ), }), ).annotate({ identifier: "CreateResponseAdaptiveRouting", }) as any as S.Schema; export type CreateResponseCountryPoolsMap = { [key: string]: unknown | undefined; }; export const CreateResponseCountryPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type CreateResponseDefaultPoolsList = Array; export const CreateResponseDefaultPoolsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type CreateResponseLocationStrategyMode = "pop" | "resolver_ip"; export const CreateResponseLocationStrategyMode = /*@__PURE__*/ S.String; export type CreateResponseLocationStrategyPreferEcs = | "always" | "never" | "proximity" | "geo"; export const CreateResponseLocationStrategyPreferEcs = /*@__PURE__*/ S.String; export interface CreateResponseLocationStrategy { /** Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful. */ mode?: CreateResponseLocationStrategyMode | null; /** Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location. */ preferEcs?: CreateResponseLocationStrategyPreferEcs | null; } export const CreateResponseLocationStrategy = /*@__PURE__*/ S.suspend(() => S.Struct({ mode: S.optional(S.NullOr(CreateResponseLocationStrategyMode)), preferEcs: S.optional( S.NullOr(CreateResponseLocationStrategyPreferEcs).pipe( T.Body("prefer_ecs"), ), ), }), ).annotate({ identifier: "CreateResponseLocationStrategy", }) as any as S.Schema; export type CreateResponseNetworksList = Array; export const CreateResponseNetworksList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type CreateResponsePopPoolsMap = { [key: string]: unknown | undefined }; export const CreateResponsePopPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type CreateResponseRandomSteeringPoolWeightsMap = { [key: string]: number | undefined; }; export const CreateResponseRandomSteeringPoolWeightsMap = /*@__PURE__*/ S.Record( S.String, S.Number, ) as any as S.Schema; export interface CreateResponseRandomSteering { /** The default weight for pools in the load balancer that are not specified in the pool_weights map. */ defaultWeight?: number | null; /** A mapping of pool IDs to custom weights. The weight is relative to other pools in the load balancer. */ poolWeights?: CreateResponseRandomSteeringPoolWeightsMap | null; } export const CreateResponseRandomSteering = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultWeight: S.optional( S.NullOr(S.Number).pipe(T.Body("default_weight")), ), poolWeights: S.optional( S.NullOr(CreateResponseRandomSteeringPoolWeightsMap).pipe( T.Body("pool_weights"), ), ), }), ).annotate({ identifier: "CreateResponseRandomSteering", }) as any as S.Schema; export type CreateResponseRegionPoolsMap = { [key: string]: unknown | undefined; }; export const CreateResponseRegionPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export interface CreateResponseRulesItemFixedResponse { /** The http 'Content-Type' header to include in the response. */ contentType?: string | null; /** The http 'Location' header to include in the response. */ location?: string | null; /** Text to include as the http body. */ messageBody?: string | null; /** The http status code to respond with. */ statusCode?: number | null; } export const CreateResponseRulesItemFixedResponse = /*@__PURE__*/ S.suspend( () => S.Struct({ contentType: S.optional(S.NullOr(S.String).pipe(T.Body("content_type"))), location: S.optional(S.NullOr(S.String)), messageBody: S.optional(S.NullOr(S.String).pipe(T.Body("message_body"))), statusCode: S.optional(S.NullOr(S.Number).pipe(T.Body("status_code"))), }), ).annotate({ identifier: "CreateResponseRulesItemFixedResponse", }) as any as S.Schema; export type CreateResponseRulesItemOverridesCountryPoolsMap = { [key: string]: unknown | undefined; }; export const CreateResponseRulesItemOverridesCountryPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type CreateResponseRulesItemOverridesDefaultPoolsList = Array; export const CreateResponseRulesItemOverridesDefaultPoolsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type CreateResponseRulesItemOverridesPopPoolsMap = { [key: string]: unknown | undefined; }; export const CreateResponseRulesItemOverridesPopPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type CreateResponseRulesItemOverridesRegionPoolsMap = { [key: string]: unknown | undefined; }; export const CreateResponseRulesItemOverridesRegionPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type CreateResponseRulesItemOverridesSessionAffinity = | "none" | "cookie" | "ip_cookie" | "header"; export const CreateResponseRulesItemOverridesSessionAffinity = /*@__PURE__*/ S.String; export type CreateResponseRulesItemOverridesSessionAffinityAttributesHeadersList = Array; export const CreateResponseRulesItemOverridesSessionAffinityAttributesHeadersList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type CreateResponseRulesItemOverridesSessionAffinityAttributesSamesite = | "Auto" | "Lax" | "None" | "Strict"; export const CreateResponseRulesItemOverridesSessionAffinityAttributesSamesite = /*@__PURE__*/ S.String; export type CreateResponseRulesItemOverridesSessionAffinityAttributesSecure = | "Auto" | "Always" | "Never"; export const CreateResponseRulesItemOverridesSessionAffinityAttributesSecure = /*@__PURE__*/ S.String; export type CreateResponseRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover = | "none" | "temporary" | "sticky"; export const CreateResponseRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover = /*@__PURE__*/ S.String; export interface CreateResponseRulesItemOverridesSessionAffinityAttributes { /** Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer. */ drainDuration?: number | null; /** Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:,"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans. */ headers?: CreateResponseRulesItemOverridesSessionAffinityAttributesHeadersList | null; /** When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren't created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren't created. */ requireAllHeaders?: boolean | null; /** Configures the SameSite attribute on session affinity cookie. Value "Auto" will be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: when using value "None", the secure attribute can not be set to "Never". */ samesite?: CreateResponseRulesItemOverridesSessionAffinityAttributesSamesite | null; /** Configures the Secure attribute on session affinity cookie. Value "Always" indicates the Secure attribute will be set in the Set-Cookie header, "Never" indicates the Secure attribute will not be set, and "Auto" will set the Secure attribute depending if Always Use HTTPS is enabled. */ secure?: CreateResponseRulesItemOverridesSessionAffinityAttributesSecure | null; /** Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are: - `"none"`: No failover takes place for sessions pinned to the origin (default). - `"temporary"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. - `"sticky"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header. */ zeroDowntimeFailover?: CreateResponseRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover | null; } export const CreateResponseRulesItemOverridesSessionAffinityAttributes = /*@__PURE__*/ S.suspend(() => S.Struct({ drainDuration: S.optional( S.NullOr(S.Number).pipe(T.Body("drain_duration")), ), headers: S.optional( S.NullOr( CreateResponseRulesItemOverridesSessionAffinityAttributesHeadersList, ), ), requireAllHeaders: S.optional( S.NullOr(S.Boolean).pipe(T.Body("require_all_headers")), ), samesite: S.optional( S.NullOr( CreateResponseRulesItemOverridesSessionAffinityAttributesSamesite, ), ), secure: S.optional( S.NullOr( CreateResponseRulesItemOverridesSessionAffinityAttributesSecure, ), ), zeroDowntimeFailover: S.optional( S.NullOr( CreateResponseRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover, ).pipe(T.Body("zero_downtime_failover")), ), }), ).annotate({ identifier: "CreateResponseRulesItemOverridesSessionAffinityAttributes", }) as any as S.Schema; export type CreateResponseRulesItemOverridesSteeringPolicy = | "off" | "geo" | "random" | "dynamic_latency" | "proximity" | "least_outstanding_requests" | "least_connections" | ""; export const CreateResponseRulesItemOverridesSteeringPolicy = /*@__PURE__*/ S.String; export interface CreateResponseRulesItemOverrides { /** Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin. */ adaptiveRouting?: CreateResponseAdaptiveRouting | null; /** A mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools. */ countryPools?: CreateResponseRulesItemOverridesCountryPoolsMap | null; /** A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region. */ defaultPools?: CreateResponseRulesItemOverridesDefaultPoolsList | null; /** The pool ID to use when all other pools are detected as unhealthy. */ fallbackPool?: string | null; /** Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected. */ locationStrategy?: CreateResponseLocationStrategy | null; /** Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. */ popPools?: CreateResponseRulesItemOverridesPopPoolsMap | null; /** Configures pool weights. */ randomSteering?: CreateResponseRandomSteering | null; /** A mapping of region codes to a list of pool IDs (ordered by their failover priority) for the given region. Any regions not explicitly defined will fall back to using default_pools. */ regionPools?: CreateResponseRulesItemOverridesRegionPoolsMap | null; /** Specifies the type of session affinity the load balancer should use unless specified as `"none"`. 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. */ sessionAffinity?: CreateResponseRulesItemOverridesSessionAffinity | null; /** Configures attributes for session affinity. */ sessionAffinityAttributes?: CreateResponseRulesItemOverridesSessionAffinityAttributes | null; /** Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven't been used for the number of seconds specified. */ sessionAffinityTtl?: number | null; /** Steering Policy for this load balancer. */ steeringPolicy?: CreateResponseRulesItemOverridesSteeringPolicy | null; /** Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers. */ ttl?: number | null; } export const CreateResponseRulesItemOverrides = /*@__PURE__*/ S.suspend(() => S.Struct({ adaptiveRouting: S.optional( S.NullOr(CreateResponseAdaptiveRouting).pipe(T.Body("adaptive_routing")), ), countryPools: S.optional( S.NullOr(CreateResponseRulesItemOverridesCountryPoolsMap).pipe( T.Body("country_pools"), ), ), defaultPools: S.optional( S.NullOr(CreateResponseRulesItemOverridesDefaultPoolsList).pipe( T.Body("default_pools"), ), ), fallbackPool: S.optional(S.NullOr(S.String).pipe(T.Body("fallback_pool"))), locationStrategy: S.optional( S.NullOr(CreateResponseLocationStrategy).pipe( T.Body("location_strategy"), ), ), popPools: S.optional( S.NullOr(CreateResponseRulesItemOverridesPopPoolsMap).pipe( T.Body("pop_pools"), ), ), randomSteering: S.optional( S.NullOr(CreateResponseRandomSteering).pipe(T.Body("random_steering")), ), regionPools: S.optional( S.NullOr(CreateResponseRulesItemOverridesRegionPoolsMap).pipe( T.Body("region_pools"), ), ), sessionAffinity: S.optional( S.NullOr(CreateResponseRulesItemOverridesSessionAffinity).pipe( T.Body("session_affinity"), ), ), sessionAffinityAttributes: S.optional( S.NullOr(CreateResponseRulesItemOverridesSessionAffinityAttributes).pipe( T.Body("session_affinity_attributes"), ), ), sessionAffinityTtl: S.optional( S.NullOr(S.Number).pipe(T.Body("session_affinity_ttl")), ), steeringPolicy: S.optional( S.NullOr(CreateResponseRulesItemOverridesSteeringPolicy).pipe( T.Body("steering_policy"), ), ), ttl: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "CreateResponseRulesItemOverrides", }) as any as S.Schema; export interface CreateResponseRulesItem { /** The condition expressions to evaluate. If the condition evaluates to true, the overrides or fixed_response in this rule will be applied. An empty condition is always true. For more details on condition expressions, please see https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions. */ condition?: string | null; /** Disable this specific rule. It will no longer be evaluated by this load balancer. */ disabled?: boolean | null; /** A collection of fields used to directly respond to the eyeball instead of routing to a pool. If a fixed_response is supplied the rule will be marked as terminates. */ fixedResponse?: CreateResponseRulesItemFixedResponse | null; /** Name of this rule. Only used for human readability. */ name?: string | null; /** A collection of overrides to apply to the load balancer when this rule's condition is true. All fields are optional. */ overrides?: CreateResponseRulesItemOverrides | null; /** The order in which rules should be executed in relation to each other. Lower values are executed first. Values do not need to be sequential. If no value is provided for any rule the array order of the rules field will be used to assign a priority. */ priority?: number | null; /** If this rule's condition is true, this causes rule evaluation to stop after processing this rule. */ terminates?: boolean | null; } export const CreateResponseRulesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ condition: S.optional(S.NullOr(S.String)), disabled: S.optional(S.NullOr(S.Boolean)), fixedResponse: S.optional( S.NullOr(CreateResponseRulesItemFixedResponse).pipe( T.Body("fixed_response"), ), ), name: S.optional(S.NullOr(S.String)), overrides: S.optional(S.NullOr(CreateResponseRulesItemOverrides)), priority: S.optional(S.NullOr(S.Number)), terminates: S.optional(S.NullOr(S.Boolean)), }), ).annotate({ identifier: "CreateResponseRulesItem", }) as any as S.Schema; export type CreateResponseRulesList = Array; export const CreateResponseRulesList = /*@__PURE__*/ S.Array( CreateResponseRulesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateLoadBalancerResponse { id?: string | null; /** Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin. */ adaptiveRouting?: CreateResponseAdaptiveRouting | null; /** A mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools. */ countryPools?: CreateResponseCountryPoolsMap | null; createdOn?: string | null; /** A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region. */ defaultPools?: CreateResponseDefaultPoolsList | null; /** Object description. */ description?: string | null; /** Whether to enable (the default) this load balancer. */ enabled?: boolean | null; /** The pool ID to use when all other pools are detected as unhealthy. */ fallbackPool?: string | null; /** Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected. */ locationStrategy?: CreateResponseLocationStrategy | null; modifiedOn?: string | null; /** The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used. */ name?: string | null; /** List of networks where Load Balancer or Pool is enabled. */ networks?: CreateResponseNetworksList | null; /** Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. */ popPools?: CreateResponsePopPoolsMap | null; /** Whether the hostname should be gray clouded (false) or orange clouded (true). */ proxied?: boolean | null; /** Configures pool weights. */ randomSteering?: CreateResponseRandomSteering | null; /** A mapping of region codes to a list of pool IDs (ordered by their failover priority) for the given region. Any regions not explicitly defined will fall back to using default_pools. */ regionPools?: CreateResponseRegionPoolsMap | null; /** BETA Field Not General Access: A list of rules for this load balancer to execute. */ rules?: CreateResponseRulesList | null; /** Specifies the type of session affinity the load balancer should use unless specified as `"none"`. 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. */ sessionAffinity?: CreateResponseRulesItemOverridesSessionAffinity | null; /** Configures attributes for session affinity. */ sessionAffinityAttributes?: CreateResponseRulesItemOverridesSessionAffinityAttributes | null; /** Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven't been used for the number of seconds specified. */ sessionAffinityTtl?: number | null; /** Steering Policy for this load balancer. */ steeringPolicy?: CreateResponseRulesItemOverridesSteeringPolicy | null; /** Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers. */ ttl?: number | null; zoneName?: string | null; } export const CreateLoadBalancerResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), adaptiveRouting: S.optional( S.NullOr(CreateResponseAdaptiveRouting).pipe(T.Body("adaptive_routing")), ), countryPools: S.optional( S.NullOr(CreateResponseCountryPoolsMap).pipe(T.Body("country_pools")), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), defaultPools: S.optional( S.NullOr(CreateResponseDefaultPoolsList).pipe(T.Body("default_pools")), ), description: S.optional(S.NullOr(S.String)), enabled: S.optional(S.NullOr(S.Boolean)), fallbackPool: S.optional(S.NullOr(S.String).pipe(T.Body("fallback_pool"))), locationStrategy: S.optional( S.NullOr(CreateResponseLocationStrategy).pipe( T.Body("location_strategy"), ), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), networks: S.optional(S.NullOr(CreateResponseNetworksList)), popPools: S.optional( S.NullOr(CreateResponsePopPoolsMap).pipe(T.Body("pop_pools")), ), proxied: S.optional(S.NullOr(S.Boolean)), randomSteering: S.optional( S.NullOr(CreateResponseRandomSteering).pipe(T.Body("random_steering")), ), regionPools: S.optional( S.NullOr(CreateResponseRegionPoolsMap).pipe(T.Body("region_pools")), ), rules: S.optional(S.NullOr(CreateResponseRulesList)), sessionAffinity: S.optional( S.NullOr(CreateResponseRulesItemOverridesSessionAffinity).pipe( T.Body("session_affinity"), ), ), sessionAffinityAttributes: S.optional( S.NullOr(CreateResponseRulesItemOverridesSessionAffinityAttributes).pipe( T.Body("session_affinity_attributes"), ), ), sessionAffinityTtl: S.optional( S.NullOr(S.Number).pipe(T.Body("session_affinity_ttl")), ), steeringPolicy: S.optional( S.NullOr(CreateResponseRulesItemOverridesSteeringPolicy).pipe( T.Body("steering_policy"), ), ), ttl: S.optional(S.NullOr(S.Number)), zoneName: S.optional(S.NullOr(S.String).pipe(T.Body("zone_name"))), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateLoadBalancerResponse", }) as any as S.Schema; export type MonitorsCreateRequestHeaderMap = { [key: string]: unknown | undefined; }; export const MonitorsCreateRequestHeaderMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type MonitorsCreateRequestType = | "http" | "https" | "tcp" | "udp_icmp" | "icmp_ping" | "smtp"; export const MonitorsCreateRequestType = /*@__PURE__*/ S.String; export interface CreateMonitorRequest { /** Identifier. */ accountId: string; /** Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. */ allowInsecure?: boolean; /** To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times. */ consecutiveDown?: number; /** To be marked healthy the monitored origin must pass this healthcheck N consecutive times. */ consecutiveUp?: number; /** Object description. */ description?: string; /** A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors. */ expectedBody?: string; /** The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors. */ expectedCodes?: string; /** Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors. */ followRedirects?: boolean; /** The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors. */ header?: MonitorsCreateRequestHeaderMap; /** The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations. */ interval?: number; /** The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks. */ method?: string; /** The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors. */ path?: string; /** The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443). */ port?: number; /** Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors. */ probeZone?: string; /** The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. */ retries?: number; /** The timeout (in seconds) before marking the health check as failed. */ timeout?: number; /** The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. */ type?: MonitorsCreateRequestType | (string & {}); } export const CreateMonitorRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), allowInsecure: S.optional(S.Boolean.pipe(T.Body("allow_insecure"))), consecutiveDown: S.optional(S.Number.pipe(T.Body("consecutive_down"))), consecutiveUp: S.optional(S.Number.pipe(T.Body("consecutive_up"))), description: S.optional(S.String), expectedBody: S.optional(S.String.pipe(T.Body("expected_body"))), expectedCodes: S.optional(S.String.pipe(T.Body("expected_codes"))), followRedirects: S.optional(S.Boolean.pipe(T.Body("follow_redirects"))), header: S.optional(MonitorsCreateRequestHeaderMap), interval: S.optional(S.Number), method: S.optional(S.String), path: S.optional(S.String), port: S.optional(S.Number), probeZone: S.optional(S.String.pipe(T.Body("probe_zone"))), retries: S.optional(S.Number), timeout: S.optional(S.Number), type: S.optional(MonitorsCreateRequestType), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/load_balancers/monitors", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateMonitorRequest", }) as any as S.Schema; export type MonitorsCreateResponseHeaderMap = { [key: string]: unknown | undefined; }; export const MonitorsCreateResponseHeaderMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type MonitorsCreateResponseType = | "http" | "https" | "tcp" | "udp_icmp" | "icmp_ping" | "smtp"; export const MonitorsCreateResponseType = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateMonitorResponse { id?: string | null; /** Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. */ allowInsecure?: boolean | null; /** To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times. */ consecutiveDown?: number | null; /** To be marked healthy the monitored origin must pass this healthcheck N consecutive times. */ consecutiveUp?: number | null; createdOn?: string | null; /** Object description. */ description?: string | null; /** A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors. */ expectedBody?: string | null; /** The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors. */ expectedCodes?: string | null; /** Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors. */ followRedirects?: boolean | null; /** The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors. */ header?: MonitorsCreateResponseHeaderMap | null; /** The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations. */ interval?: number | null; /** The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks. */ method?: string | null; modifiedOn?: string | null; /** The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors. */ path?: string | null; /** The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443). */ port?: number | null; /** Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors. */ probeZone?: string | null; /** The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. */ retries?: number | null; /** The timeout (in seconds) before marking the health check as failed. */ timeout?: number | null; /** The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. */ type?: MonitorsCreateResponseType | null; } export const CreateMonitorResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), allowInsecure: S.optional( S.NullOr(S.Boolean).pipe(T.Body("allow_insecure")), ), consecutiveDown: S.optional( S.NullOr(S.Number).pipe(T.Body("consecutive_down")), ), consecutiveUp: S.optional( S.NullOr(S.Number).pipe(T.Body("consecutive_up")), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), description: S.optional(S.NullOr(S.String)), expectedBody: S.optional(S.NullOr(S.String).pipe(T.Body("expected_body"))), expectedCodes: S.optional( S.NullOr(S.String).pipe(T.Body("expected_codes")), ), followRedirects: S.optional( S.NullOr(S.Boolean).pipe(T.Body("follow_redirects")), ), header: S.optional(S.NullOr(MonitorsCreateResponseHeaderMap)), interval: S.optional(S.NullOr(S.Number)), method: S.optional(S.NullOr(S.String)), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), path: S.optional(S.NullOr(S.String)), port: S.optional(S.NullOr(S.Number)), probeZone: S.optional(S.NullOr(S.String).pipe(T.Body("probe_zone"))), retries: S.optional(S.NullOr(S.Number)), timeout: S.optional(S.NullOr(S.Number)), type: S.optional(S.NullOr(MonitorsCreateResponseType)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateMonitorResponse", }) as any as S.Schema; export interface MonitorGroupsCreateRequestMembersItem { /** Whether this monitor is enabled in the group */ enabled: boolean; /** The ID of the Monitor to use for checking the health of origins within this pool. */ monitorId: string; /** Whether this monitor is used for monitoring only (does not affect pool health) */ monitoringOnly: boolean; /** Whether this monitor must be healthy for the pool to be considered healthy */ mustBeHealthy: boolean; /** The timestamp of when the monitor was added to the group */ createdAt?: string; /** The timestamp of when the monitor group member was last updated */ updatedAt?: string; } export const MonitorGroupsCreateRequestMembersItem = /*@__PURE__*/ S.suspend( () => S.Struct({ enabled: S.Boolean, monitorId: S.String.pipe(T.Body("monitor_id")), monitoringOnly: S.Boolean.pipe(T.Body("monitoring_only")), mustBeHealthy: S.Boolean.pipe(T.Body("must_be_healthy")), createdAt: S.optional(S.String.pipe(T.Body("created_at"))), updatedAt: S.optional(S.String.pipe(T.Body("updated_at"))), }), ).annotate({ identifier: "MonitorGroupsCreateRequestMembersItem", }) as any as S.Schema; export type MonitorGroupsCreateRequestMembersList = Array; export const MonitorGroupsCreateRequestMembersList = /*@__PURE__*/ S.Array( MonitorGroupsCreateRequestMembersItem, ) as any as S.Schema; export interface CreateMonitorGroupRequest { /** Identifier. */ accountId: string; /** A short description of the monitor group */ description: string; /** List of monitors in this group */ members: MonitorGroupsCreateRequestMembersList; } export const CreateMonitorGroupRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), description: S.String, members: MonitorGroupsCreateRequestMembersList, }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/load_balancers/monitor_groups", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateMonitorGroupRequest", }) as any as S.Schema; export interface MonitorGroupsCreateResponseMembersItem { /** Whether this monitor is enabled in the group */ enabled: boolean; /** The ID of the Monitor to use for checking the health of origins within this pool. */ monitorId: string; /** Whether this monitor is used for monitoring only (does not affect pool health) */ monitoringOnly: boolean; /** Whether this monitor must be healthy for the pool to be considered healthy */ mustBeHealthy: boolean; /** The timestamp of when the monitor was added to the group */ createdAt?: string | null; /** The timestamp of when the monitor group member was last updated */ updatedAt?: string | null; } export const MonitorGroupsCreateResponseMembersItem = /*@__PURE__*/ S.suspend( () => S.Struct({ enabled: S.Boolean, monitorId: S.String.pipe(T.Body("monitor_id")), monitoringOnly: S.Boolean.pipe(T.Body("monitoring_only")), mustBeHealthy: S.Boolean.pipe(T.Body("must_be_healthy")), createdAt: S.optional(S.NullOr(S.String).pipe(T.Body("created_at"))), updatedAt: S.optional(S.NullOr(S.String).pipe(T.Body("updated_at"))), }), ).annotate({ identifier: "MonitorGroupsCreateResponseMembersItem", }) as any as S.Schema; export type MonitorGroupsCreateResponseMembersList = Array; export const MonitorGroupsCreateResponseMembersList = /*@__PURE__*/ S.Array( MonitorGroupsCreateResponseMembersItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateMonitorGroupResponse { /** The ID of the Monitor Group to use for checking the health of origins within this pool. */ id: string; /** A short description of the monitor group */ description: string; /** List of monitors in this group */ members: MonitorGroupsCreateResponseMembersList; /** The timestamp of when the monitor group was created */ createdOn?: string | null; /** The timestamp of when the monitor group was last updated */ modifiedOn?: string | null; } export const CreateMonitorGroupResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, description: S.String, members: MonitorGroupsCreateResponseMembersList, createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateMonitorGroupResponse", }) as any as S.Schema; export type MonitorsPreviewsCreateRequestHeaderMap = { [key: string]: unknown | undefined; }; export const MonitorsPreviewsCreateRequestHeaderMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type MonitorsPreviewsCreateRequestType = | "http" | "https" | "tcp" | "udp_icmp" | "icmp_ping" | "smtp"; export const MonitorsPreviewsCreateRequestType = /*@__PURE__*/ S.String; export interface CreateMonitorPreviewRequest { /** Identifier. */ accountId: string; monitorId: string; /** Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. */ allowInsecure?: boolean; /** To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times. */ consecutiveDown?: number; /** To be marked healthy the monitored origin must pass this healthcheck N consecutive times. */ consecutiveUp?: number; /** Object description. */ description?: string; /** A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors. */ expectedBody?: string; /** The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors. */ expectedCodes?: string; /** Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors. */ followRedirects?: boolean; /** The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors. */ header?: MonitorsPreviewsCreateRequestHeaderMap; /** The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations. */ interval?: number; /** The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks. */ method?: string; /** The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors. */ path?: string; /** The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443). */ port?: number; /** Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors. */ probeZone?: string; /** The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. */ retries?: number; /** The timeout (in seconds) before marking the health check as failed. */ timeout?: number; /** The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. */ type?: MonitorsPreviewsCreateRequestType | (string & {}); } export const CreateMonitorPreviewRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), monitorId: S.String.pipe(T.Label("monitor_id")), allowInsecure: S.optional(S.Boolean.pipe(T.Body("allow_insecure"))), consecutiveDown: S.optional(S.Number.pipe(T.Body("consecutive_down"))), consecutiveUp: S.optional(S.Number.pipe(T.Body("consecutive_up"))), description: S.optional(S.String), expectedBody: S.optional(S.String.pipe(T.Body("expected_body"))), expectedCodes: S.optional(S.String.pipe(T.Body("expected_codes"))), followRedirects: S.optional(S.Boolean.pipe(T.Body("follow_redirects"))), header: S.optional(MonitorsPreviewsCreateRequestHeaderMap), interval: S.optional(S.Number), method: S.optional(S.String), path: S.optional(S.String), port: S.optional(S.Number), probeZone: S.optional(S.String.pipe(T.Body("probe_zone"))), retries: S.optional(S.Number), timeout: S.optional(S.Number), type: S.optional(MonitorsPreviewsCreateRequestType), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/load_balancers/monitors/{monitor_id}/preview", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateMonitorPreviewRequest", }) as any as S.Schema; export type MonitorsPreviewsCreateResponsePoolsMap = { [key: string]: string | undefined; }; export const MonitorsPreviewsCreateResponsePoolsMap = /*@__PURE__*/ S.Record( S.String, S.String, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateMonitorPreviewResponse { /** Monitored pool IDs mapped to their respective names. */ pools?: MonitorsPreviewsCreateResponsePoolsMap | null; previewId?: string | null; } export const CreateMonitorPreviewResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ pools: S.optional(S.NullOr(MonitorsPreviewsCreateResponsePoolsMap)), previewId: S.optional(S.NullOr(S.String).pipe(T.Body("preview_id"))), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateMonitorPreviewResponse", }) as any as S.Schema; export type PoolsCreateRequestOriginsItemHeaderHostList = Array; export const PoolsCreateRequestOriginsItemHeaderHostList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface PoolsCreateRequestOriginsItemHeader { /** The 'Host' header allows to override the hostname set in the HTTP request. Current support is 1 'Host' header override per origin. */ host?: PoolsCreateRequestOriginsItemHeaderHostList; } export const PoolsCreateRequestOriginsItemHeader = /*@__PURE__*/ S.suspend(() => S.Struct({ host: S.optional( PoolsCreateRequestOriginsItemHeaderHostList.pipe(T.Body("Host")), ), }), ).annotate({ identifier: "PoolsCreateRequestOriginsItemHeader", }) as any as S.Schema; export interface PoolsCreateRequestOriginsItem { /** The IP address (IPv4 or IPv6) of the origin, or its publicly addressable hostname. Hostnames entered here should resolve directly to the origin, and not be a hostname proxied by Cloudflare. To set an internal/reserved address, virtual_network_id must also be set. */ address?: string; /** This field shows up only if the origin is disabled. This field is set with the time the origin was disabled. */ disabledAt?: string; /** Whether to enable (the default) this origin within the pool. Disabled origins will not receive traffic and are excluded from health checks. The origin will only be disabled for the current pool. */ enabled?: boolean; /** Whether to flatten CNAME records for this origin, resolving them to A/AAAA records before returning to the client. When true (the default), the director resolves CNAME addresses to their underlying A/AAAA records. When false, the origin address is returned as a raw CNAME record without resolution. This setting mirrors the DNS API record flatten_cname setting. */ flattenCname?: boolean; /** The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'. */ header?: PoolsCreateRequestOriginsItemHeader; /** A human-identifiable name for the origin. */ name?: string; /** The port for upstream connections. A value of 0 means the default port for the protocol will be used. */ port?: number; /** The virtual network subnet ID the origin belongs in. Virtual network must also belong to the account. */ virtualNetworkId?: string; /** The weight of this origin relative to other origins in the pool. Based on the configured weight the total traffic is distributed among origins within the pool. */ weight?: number; } export const PoolsCreateRequestOriginsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ address: S.optional(S.String), disabledAt: S.optional(S.String.pipe(T.Body("disabled_at"))), enabled: S.optional(S.Boolean), flattenCname: S.optional(S.Boolean.pipe(T.Body("flatten_cname"))), header: S.optional(PoolsCreateRequestOriginsItemHeader), name: S.optional(S.String), port: S.optional(S.Number), virtualNetworkId: S.optional(S.String.pipe(T.Body("virtual_network_id"))), weight: S.optional(S.Number), }), ).annotate({ identifier: "PoolsCreateRequestOriginsItem", }) as any as S.Schema; export type PoolsCreateRequestOriginsList = Array; export const PoolsCreateRequestOriginsList = /*@__PURE__*/ S.Array( PoolsCreateRequestOriginsItem, ) as any as S.Schema; export type PoolsCreateRequestLoadSheddingDefaultPolicy = "random" | "hash"; export const PoolsCreateRequestLoadSheddingDefaultPolicy = /*@__PURE__*/ S.String; export type PoolsCreateRequestLoadSheddingSessionPolicy = "hash"; export const PoolsCreateRequestLoadSheddingSessionPolicy = /*@__PURE__*/ S.String; export interface PoolsCreateRequestLoadShedding { /** The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity. */ defaultPercent?: number; /** The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs. */ defaultPolicy?: PoolsCreateRequestLoadSheddingDefaultPolicy | (string & {}); /** The percent of existing sessions to shed from the pool, according to the session policy. */ sessionPercent?: number; /** Only the hash policy is supported for existing sessions (to avoid exponential decay). */ sessionPolicy?: PoolsCreateRequestLoadSheddingSessionPolicy | (string & {}); } export const PoolsCreateRequestLoadShedding = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultPercent: S.optional(S.Number.pipe(T.Body("default_percent"))), defaultPolicy: S.optional( PoolsCreateRequestLoadSheddingDefaultPolicy.pipe( T.Body("default_policy"), ), ), sessionPercent: S.optional(S.Number.pipe(T.Body("session_percent"))), sessionPolicy: S.optional( PoolsCreateRequestLoadSheddingSessionPolicy.pipe( T.Body("session_policy"), ), ), }), ).annotate({ identifier: "PoolsCreateRequestLoadShedding", }) as any as S.Schema; export interface PoolsCreateRequestNotificationFilterOrigin { /** If set true, disable notifications for this type of resource (pool or origin). */ disable?: boolean; /** If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events). */ healthy?: boolean; } export const PoolsCreateRequestNotificationFilterOrigin = /*@__PURE__*/ S.suspend(() => S.Struct({ disable: S.optional(S.Boolean), healthy: S.optional(S.Boolean), }), ).annotate({ identifier: "PoolsCreateRequestNotificationFilterOrigin", }) as any as S.Schema; export interface PoolsCreateRequestNotificationFilter { /** Filter options for a particular resource type (pool or origin). Use null to reset. */ origin?: PoolsCreateRequestNotificationFilterOrigin; /** Filter options for a particular resource type (pool or origin). Use null to reset. */ pool?: PoolsCreateRequestNotificationFilterOrigin; } export const PoolsCreateRequestNotificationFilter = /*@__PURE__*/ S.suspend( () => S.Struct({ origin: S.optional(PoolsCreateRequestNotificationFilterOrigin), pool: S.optional(PoolsCreateRequestNotificationFilterOrigin), }), ).annotate({ identifier: "PoolsCreateRequestNotificationFilter", }) as any as S.Schema; export type PoolsCreateRequestOriginSteeringPolicy = | "random" | "hash" | "least_outstanding_requests" | "least_connections"; export const PoolsCreateRequestOriginSteeringPolicy = /*@__PURE__*/ S.String; export interface PoolsCreateRequestOriginSteering { /** The type of origin steering policy to use. */ policy?: PoolsCreateRequestOriginSteeringPolicy | (string & {}); } export const PoolsCreateRequestOriginSteering = /*@__PURE__*/ S.suspend(() => S.Struct({ policy: S.optional(PoolsCreateRequestOriginSteeringPolicy), }), ).annotate({ identifier: "PoolsCreateRequestOriginSteering", }) as any as S.Schema; export interface CreatePoolRequest { /** Identifier. */ accountId: string; /** A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed. */ name: string; /** The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. */ origins: PoolsCreateRequestOriginsList; /** A human-readable description of the pool. */ description?: string; /** Whether to enable (the default) or disable this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any). */ enabled?: boolean; /** The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set. */ latitude?: number; /** Configures load shedding policies and percentages for the pool. */ loadShedding?: PoolsCreateRequestLoadShedding; /** The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set. */ longitude?: number; /** The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and will failover to the next available pool. */ minimumOrigins?: number; /** The ID of the Monitor to use for checking the health of origins within this pool. */ monitor?: string; /** The ID of the Monitor Group to use for checking the health of origins within this pool. */ monitorGroup?: string; /** This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address to send health status notifications to. This can be an individual mailbox or a mailing list. Multiple emails can be supplied as a comma delimited list. */ notificationEmail?: string; /** Filter pool and origin health notifications by resource type or health status. Use null to reset. */ notificationFilter?: PoolsCreateRequestNotificationFilter; /** Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity. */ originSteering?: PoolsCreateRequestOriginSteering; } export const CreatePoolRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), name: S.String, origins: PoolsCreateRequestOriginsList, description: S.optional(S.String), enabled: S.optional(S.Boolean), latitude: S.optional(S.Number), loadShedding: S.optional( PoolsCreateRequestLoadShedding.pipe(T.Body("load_shedding")), ), longitude: S.optional(S.Number), minimumOrigins: S.optional(S.Number.pipe(T.Body("minimum_origins"))), monitor: S.optional(S.String), monitorGroup: S.optional(S.String.pipe(T.Body("monitor_group"))), notificationEmail: S.optional(S.String.pipe(T.Body("notification_email"))), notificationFilter: S.optional( PoolsCreateRequestNotificationFilter.pipe(T.Body("notification_filter")), ), originSteering: S.optional( PoolsCreateRequestOriginSteering.pipe(T.Body("origin_steering")), ), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/load_balancers/pools", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreatePoolRequest", }) as any as S.Schema; export type PoolsCreateResponseCheckRegionsItem = | "WNAM" | "ENAM" | "WEU" | "EEU" | "NSAM" | "SSAM" | "OC" | "ME" | "NAF" | "SAF" | "SAS" | "SEAS" | "NEAS" | "ALL_REGIONS"; export const PoolsCreateResponseCheckRegionsItem = /*@__PURE__*/ S.String; export type PoolsCreateResponseCheckRegionsList = Array; export const PoolsCreateResponseCheckRegionsList = /*@__PURE__*/ S.Array( PoolsCreateResponseCheckRegionsItem, ) as any as S.Schema; export type PoolsCreateResponseLoadSheddingDefaultPolicy = "random" | "hash"; export const PoolsCreateResponseLoadSheddingDefaultPolicy = /*@__PURE__*/ S.String; export type PoolsCreateResponseLoadSheddingSessionPolicy = "hash"; export const PoolsCreateResponseLoadSheddingSessionPolicy = /*@__PURE__*/ S.String; export interface PoolsCreateResponseLoadShedding { /** The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity. */ defaultPercent?: number | null; /** The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs. */ defaultPolicy?: PoolsCreateResponseLoadSheddingDefaultPolicy | null; /** The percent of existing sessions to shed from the pool, according to the session policy. */ sessionPercent?: number | null; /** Only the hash policy is supported for existing sessions (to avoid exponential decay). */ sessionPolicy?: PoolsCreateResponseLoadSheddingSessionPolicy | null; } export const PoolsCreateResponseLoadShedding = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultPercent: S.optional( S.NullOr(S.Number).pipe(T.Body("default_percent")), ), defaultPolicy: S.optional( S.NullOr(PoolsCreateResponseLoadSheddingDefaultPolicy).pipe( T.Body("default_policy"), ), ), sessionPercent: S.optional( S.NullOr(S.Number).pipe(T.Body("session_percent")), ), sessionPolicy: S.optional( S.NullOr(PoolsCreateResponseLoadSheddingSessionPolicy).pipe( T.Body("session_policy"), ), ), }), ).annotate({ identifier: "PoolsCreateResponseLoadShedding", }) as any as S.Schema; export type PoolsCreateResponseNetworksList = Array; export const PoolsCreateResponseNetworksList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type PoolsCreateResponseNotificationFilterOrigin = PoolsBulkEditResultItemNotificationFilterOrigin; export const PoolsCreateResponseNotificationFilterOrigin = PoolsBulkEditResultItemNotificationFilterOrigin; export type PoolsCreateResponseNotificationFilter = PoolsBulkEditResultItemNotificationFilter; export const PoolsCreateResponseNotificationFilter = PoolsBulkEditResultItemNotificationFilter; export type PoolsCreateResponseOriginSteeringPolicy = | "random" | "hash" | "least_outstanding_requests" | "least_connections"; export const PoolsCreateResponseOriginSteeringPolicy = /*@__PURE__*/ S.String; export interface PoolsCreateResponseOriginSteering { /** The type of origin steering policy to use. */ policy?: PoolsCreateResponseOriginSteeringPolicy | null; } export const PoolsCreateResponseOriginSteering = /*@__PURE__*/ S.suspend(() => S.Struct({ policy: S.optional(S.NullOr(PoolsCreateResponseOriginSteeringPolicy)), }), ).annotate({ identifier: "PoolsCreateResponseOriginSteering", }) as any as S.Schema; export type PoolsCreateResponseOriginsItemHeaderHostList = Array; export const PoolsCreateResponseOriginsItemHeaderHostList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface PoolsCreateResponseOriginsItemHeader { /** The 'Host' header allows to override the hostname set in the HTTP request. Current support is 1 'Host' header override per origin. */ host?: PoolsCreateResponseOriginsItemHeaderHostList | null; } export const PoolsCreateResponseOriginsItemHeader = /*@__PURE__*/ S.suspend( () => S.Struct({ host: S.optional( S.NullOr(PoolsCreateResponseOriginsItemHeaderHostList).pipe( T.Body("Host"), ), ), }), ).annotate({ identifier: "PoolsCreateResponseOriginsItemHeader", }) as any as S.Schema; export interface PoolsCreateResponseOriginsItem { /** The IP address (IPv4 or IPv6) of the origin, or its publicly addressable hostname. Hostnames entered here should resolve directly to the origin, and not be a hostname proxied by Cloudflare. To set an internal/reserved address, virtual_network_id must also be set. */ address?: string | null; /** This field shows up only if the origin is disabled. This field is set with the time the origin was disabled. */ disabledAt?: string | null; /** Whether to enable (the default) this origin within the pool. Disabled origins will not receive traffic and are excluded from health checks. The origin will only be disabled for the current pool. */ enabled?: boolean | null; /** Whether to flatten CNAME records for this origin, resolving them to A/AAAA records before returning to the client. When true (the default), the director resolves CNAME addresses to their underlying A/AAAA records. When false, the origin address is returned as a raw CNAME record without resolution. This setting mirrors the DNS API record flatten_cname setting. */ flattenCname?: boolean | null; /** The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'. */ header?: PoolsCreateResponseOriginsItemHeader | null; /** A human-identifiable name for the origin. */ name?: string | null; /** The port for upstream connections. A value of 0 means the default port for the protocol will be used. */ port?: number | null; /** The virtual network subnet ID the origin belongs in. Virtual network must also belong to the account. */ virtualNetworkId?: string | null; /** The weight of this origin relative to other origins in the pool. Based on the configured weight the total traffic is distributed among origins within the pool. */ weight?: number | null; } export const PoolsCreateResponseOriginsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ address: S.optional(S.NullOr(S.String)), disabledAt: S.optional(S.NullOr(S.String).pipe(T.Body("disabled_at"))), enabled: S.optional(S.NullOr(S.Boolean)), flattenCname: S.optional(S.NullOr(S.Boolean).pipe(T.Body("flatten_cname"))), header: S.optional(S.NullOr(PoolsCreateResponseOriginsItemHeader)), name: S.optional(S.NullOr(S.String)), port: S.optional(S.NullOr(S.Number)), virtualNetworkId: S.optional( S.NullOr(S.String).pipe(T.Body("virtual_network_id")), ), weight: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "PoolsCreateResponseOriginsItem", }) as any as S.Schema; export type PoolsCreateResponseOriginsList = Array; export const PoolsCreateResponseOriginsList = /*@__PURE__*/ S.Array( PoolsCreateResponseOriginsItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreatePoolResponse { id?: string | null; /** A list of regions from which to run health checks. Null means every Cloudflare data center. */ checkRegions?: PoolsCreateResponseCheckRegionsList | null; createdOn?: string | null; /** A human-readable description of the pool. */ description?: string | null; /** This field shows up only if the pool is disabled. This field is set with the time the pool was disabled at. */ disabledAt?: string | null; /** Whether to enable (the default) or disable this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any). */ enabled?: boolean | null; /** The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set. */ latitude?: number | null; /** Configures load shedding policies and percentages for the pool. */ loadShedding?: PoolsCreateResponseLoadShedding | null; /** The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set. */ longitude?: number | null; /** The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and will failover to the next available pool. */ minimumOrigins?: number | null; modifiedOn?: string | null; /** The ID of the Monitor to use for checking the health of origins within this pool. */ monitor?: string | null; /** The ID of the Monitor Group to use for checking the health of origins within this pool. */ monitorGroup?: string | null; /** A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed. */ name?: string | null; /** List of networks where Load Balancer or Pool is enabled. */ networks?: PoolsCreateResponseNetworksList | null; /** This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address to send health status notifications to. This can be an individual mailbox or a mailing list. Multiple emails can be supplied as a comma delimited list. */ notificationEmail?: string | null; /** Filter pool and origin health notifications by resource type or health status. Use null to reset. */ notificationFilter?: PoolsBulkEditResultItemNotificationFilter | null; /** Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity. */ originSteering?: PoolsCreateResponseOriginSteering | null; /** The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. */ origins?: PoolsCreateResponseOriginsList | null; } export const CreatePoolResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), checkRegions: S.optional( S.NullOr(PoolsCreateResponseCheckRegionsList).pipe( T.Body("check_regions"), ), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), description: S.optional(S.NullOr(S.String)), disabledAt: S.optional(S.NullOr(S.String).pipe(T.Body("disabled_at"))), enabled: S.optional(S.NullOr(S.Boolean)), latitude: S.optional(S.NullOr(S.Number)), loadShedding: S.optional( S.NullOr(PoolsCreateResponseLoadShedding).pipe(T.Body("load_shedding")), ), longitude: S.optional(S.NullOr(S.Number)), minimumOrigins: S.optional( S.NullOr(S.Number).pipe(T.Body("minimum_origins")), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), monitor: S.optional(S.NullOr(S.String)), monitorGroup: S.optional(S.NullOr(S.String).pipe(T.Body("monitor_group"))), name: S.optional(S.NullOr(S.String)), networks: S.optional(S.NullOr(PoolsCreateResponseNetworksList)), notificationEmail: S.optional( S.NullOr(S.String).pipe(T.Body("notification_email")), ), notificationFilter: S.optional( S.NullOr(PoolsBulkEditResultItemNotificationFilter).pipe( T.Body("notification_filter"), ), ), originSteering: S.optional( S.NullOr(PoolsCreateResponseOriginSteering).pipe( T.Body("origin_steering"), ), ), origins: S.optional(S.NullOr(PoolsCreateResponseOriginsList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreatePoolResponse", }) as any as S.Schema; export type PoolsHealthCreateRequestHeaderMap = { [key: string]: unknown | undefined; }; export const PoolsHealthCreateRequestHeaderMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type PoolsHealthCreateRequestType = | "http" | "https" | "tcp" | "udp_icmp" | "icmp_ping" | "smtp"; export const PoolsHealthCreateRequestType = /*@__PURE__*/ S.String; export interface CreatePoolHealthRequest { /** Identifier. */ accountId: string; poolId: string; /** Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. */ allowInsecure?: boolean; /** To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times. */ consecutiveDown?: number; /** To be marked healthy the monitored origin must pass this healthcheck N consecutive times. */ consecutiveUp?: number; /** Object description. */ description?: string; /** A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors. */ expectedBody?: string; /** The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors. */ expectedCodes?: string; /** Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors. */ followRedirects?: boolean; /** The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors. */ header?: PoolsHealthCreateRequestHeaderMap; /** The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations. */ interval?: number; /** The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks. */ method?: string; /** The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors. */ path?: string; /** The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443). */ port?: number; /** Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors. */ probeZone?: string; /** The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. */ retries?: number; /** The timeout (in seconds) before marking the health check as failed. */ timeout?: number; /** The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. */ type?: PoolsHealthCreateRequestType | (string & {}); } export const CreatePoolHealthRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), poolId: S.String.pipe(T.Label("pool_id")), allowInsecure: S.optional(S.Boolean.pipe(T.Body("allow_insecure"))), consecutiveDown: S.optional(S.Number.pipe(T.Body("consecutive_down"))), consecutiveUp: S.optional(S.Number.pipe(T.Body("consecutive_up"))), description: S.optional(S.String), expectedBody: S.optional(S.String.pipe(T.Body("expected_body"))), expectedCodes: S.optional(S.String.pipe(T.Body("expected_codes"))), followRedirects: S.optional(S.Boolean.pipe(T.Body("follow_redirects"))), header: S.optional(PoolsHealthCreateRequestHeaderMap), interval: S.optional(S.Number), method: S.optional(S.String), path: S.optional(S.String), port: S.optional(S.Number), probeZone: S.optional(S.String.pipe(T.Body("probe_zone"))), retries: S.optional(S.Number), timeout: S.optional(S.Number), type: S.optional(PoolsHealthCreateRequestType), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/load_balancers/pools/{pool_id}/preview", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreatePoolHealthRequest", }) as any as S.Schema; export type PoolsHealthCreateResponsePoolsMap = { [key: string]: string | undefined; }; export const PoolsHealthCreateResponsePoolsMap = /*@__PURE__*/ S.Record( S.String, S.String, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreatePoolHealthResponse { /** Monitored pool IDs mapped to their respective names. */ pools?: PoolsHealthCreateResponsePoolsMap | null; previewId?: string | null; } export const CreatePoolHealthResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ pools: S.optional(S.NullOr(PoolsHealthCreateResponsePoolsMap)), previewId: S.optional(S.NullOr(S.String).pipe(T.Body("preview_id"))), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreatePoolHealthResponse", }) as any as S.Schema; export interface DeleteLoadBalancerRequest { zoneId: string; loadBalancerId: string; } export const DeleteLoadBalancerRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), loadBalancerId: S.String.pipe(T.Label("load_balancer_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/zones/{zone_id}/load_balancers/{load_balancer_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteLoadBalancerRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteLoadBalancerResponse { id?: string | null; } export const DeleteLoadBalancerResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteLoadBalancerResponse", }) as any as S.Schema; export interface DeleteMonitorRequest { /** Identifier. */ accountId: string; monitorId: string; } export const DeleteMonitorRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), monitorId: S.String.pipe(T.Label("monitor_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/load_balancers/monitors/{monitor_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteMonitorRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteMonitorResponse { id?: string | null; } export const DeleteMonitorResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteMonitorResponse", }) as any as S.Schema; export interface DeleteMonitorGroupRequest { /** Identifier. */ accountId: string; monitorGroupId: string; } export const DeleteMonitorGroupRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), monitorGroupId: S.String.pipe(T.Label("monitor_group_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/load_balancers/monitor_groups/{monitor_group_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteMonitorGroupRequest", }) as any as S.Schema; export type MonitorGroupsDeleteResponseMembersItem = MonitorGroupsCreateResponseMembersItem; export const MonitorGroupsDeleteResponseMembersItem = MonitorGroupsCreateResponseMembersItem; export type MonitorGroupsDeleteResponseMembersList = Array; export const MonitorGroupsDeleteResponseMembersList = /*@__PURE__*/ S.Array( MonitorGroupsCreateResponseMembersItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteMonitorGroupResponse { /** The ID of the Monitor Group to use for checking the health of origins within this pool. */ id: string; /** A short description of the monitor group */ description: string; /** List of monitors in this group */ members: MonitorGroupsDeleteResponseMembersList; /** The timestamp of when the monitor group was created */ createdOn?: string | null; /** The timestamp of when the monitor group was last updated */ modifiedOn?: string | null; } export const DeleteMonitorGroupResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, description: S.String, members: MonitorGroupsDeleteResponseMembersList, createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteMonitorGroupResponse", }) as any as S.Schema; export interface DeletePoolRequest { /** Identifier. */ accountId: string; poolId: string; } export const DeletePoolRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), poolId: S.String.pipe(T.Label("pool_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/load_balancers/pools/{pool_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeletePoolRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeletePoolResponse { id?: string | null; } export const DeletePoolResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeletePoolResponse", }) as any as S.Schema; export interface GetLoadBalancerRequest { zoneId: string; loadBalancerId: string; } export const GetLoadBalancerRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), loadBalancerId: S.String.pipe(T.Label("load_balancer_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/load_balancers/{load_balancer_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetLoadBalancerRequest", }) as any as S.Schema; export type GetResponseAdaptiveRouting = CreateResponseAdaptiveRouting; export const GetResponseAdaptiveRouting = CreateResponseAdaptiveRouting; export type GetResponseCountryPoolsMap = { [key: string]: unknown | undefined }; export const GetResponseCountryPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type GetResponseDefaultPoolsList = Array; export const GetResponseDefaultPoolsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type GetResponseLocationStrategyMode = "pop" | "resolver_ip"; export const GetResponseLocationStrategyMode = /*@__PURE__*/ S.String; export type GetResponseLocationStrategyPreferEcs = | "always" | "never" | "proximity" | "geo"; export const GetResponseLocationStrategyPreferEcs = /*@__PURE__*/ S.String; export interface GetResponseLocationStrategy { /** Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful. */ mode?: GetResponseLocationStrategyMode | null; /** Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location. */ preferEcs?: GetResponseLocationStrategyPreferEcs | null; } export const GetResponseLocationStrategy = /*@__PURE__*/ S.suspend(() => S.Struct({ mode: S.optional(S.NullOr(GetResponseLocationStrategyMode)), preferEcs: S.optional( S.NullOr(GetResponseLocationStrategyPreferEcs).pipe(T.Body("prefer_ecs")), ), }), ).annotate({ identifier: "GetResponseLocationStrategy", }) as any as S.Schema; export type GetResponseNetworksList = Array; export const GetResponseNetworksList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type GetResponsePopPoolsMap = { [key: string]: unknown | undefined }; export const GetResponsePopPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type GetResponseRandomSteeringPoolWeightsMap = { [key: string]: number | undefined; }; export const GetResponseRandomSteeringPoolWeightsMap = /*@__PURE__*/ S.Record( S.String, S.Number, ) as any as S.Schema; export interface GetResponseRandomSteering { /** The default weight for pools in the load balancer that are not specified in the pool_weights map. */ defaultWeight?: number | null; /** A mapping of pool IDs to custom weights. The weight is relative to other pools in the load balancer. */ poolWeights?: GetResponseRandomSteeringPoolWeightsMap | null; } export const GetResponseRandomSteering = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultWeight: S.optional( S.NullOr(S.Number).pipe(T.Body("default_weight")), ), poolWeights: S.optional( S.NullOr(GetResponseRandomSteeringPoolWeightsMap).pipe( T.Body("pool_weights"), ), ), }), ).annotate({ identifier: "GetResponseRandomSteering", }) as any as S.Schema; export type GetResponseRegionPoolsMap = { [key: string]: unknown | undefined }; export const GetResponseRegionPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type GetResponseRulesItemFixedResponse = CreateResponseRulesItemFixedResponse; export const GetResponseRulesItemFixedResponse = CreateResponseRulesItemFixedResponse; export type GetResponseRulesItemOverridesCountryPoolsMap = { [key: string]: unknown | undefined; }; export const GetResponseRulesItemOverridesCountryPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type GetResponseRulesItemOverridesDefaultPoolsList = Array; export const GetResponseRulesItemOverridesDefaultPoolsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type GetResponseRulesItemOverridesPopPoolsMap = { [key: string]: unknown | undefined; }; export const GetResponseRulesItemOverridesPopPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type GetResponseRulesItemOverridesRegionPoolsMap = { [key: string]: unknown | undefined; }; export const GetResponseRulesItemOverridesRegionPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type GetResponseRulesItemOverridesSessionAffinity = | "none" | "cookie" | "ip_cookie" | "header"; export const GetResponseRulesItemOverridesSessionAffinity = /*@__PURE__*/ S.String; export type GetResponseRulesItemOverridesSessionAffinityAttributesHeadersList = Array; export const GetResponseRulesItemOverridesSessionAffinityAttributesHeadersList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type GetResponseRulesItemOverridesSessionAffinityAttributesSamesite = | "Auto" | "Lax" | "None" | "Strict"; export const GetResponseRulesItemOverridesSessionAffinityAttributesSamesite = /*@__PURE__*/ S.String; export type GetResponseRulesItemOverridesSessionAffinityAttributesSecure = | "Auto" | "Always" | "Never"; export const GetResponseRulesItemOverridesSessionAffinityAttributesSecure = /*@__PURE__*/ S.String; export type GetResponseRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover = | "none" | "temporary" | "sticky"; export const GetResponseRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover = /*@__PURE__*/ S.String; export interface GetResponseRulesItemOverridesSessionAffinityAttributes { /** Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer. */ drainDuration?: number | null; /** Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:,"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans. */ headers?: GetResponseRulesItemOverridesSessionAffinityAttributesHeadersList | null; /** When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren't created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren't created. */ requireAllHeaders?: boolean | null; /** Configures the SameSite attribute on session affinity cookie. Value "Auto" will be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: when using value "None", the secure attribute can not be set to "Never". */ samesite?: GetResponseRulesItemOverridesSessionAffinityAttributesSamesite | null; /** Configures the Secure attribute on session affinity cookie. Value "Always" indicates the Secure attribute will be set in the Set-Cookie header, "Never" indicates the Secure attribute will not be set, and "Auto" will set the Secure attribute depending if Always Use HTTPS is enabled. */ secure?: GetResponseRulesItemOverridesSessionAffinityAttributesSecure | null; /** Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are: - `"none"`: No failover takes place for sessions pinned to the origin (default). - `"temporary"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. - `"sticky"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header. */ zeroDowntimeFailover?: GetResponseRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover | null; } export const GetResponseRulesItemOverridesSessionAffinityAttributes = /*@__PURE__*/ S.suspend(() => S.Struct({ drainDuration: S.optional( S.NullOr(S.Number).pipe(T.Body("drain_duration")), ), headers: S.optional( S.NullOr( GetResponseRulesItemOverridesSessionAffinityAttributesHeadersList, ), ), requireAllHeaders: S.optional( S.NullOr(S.Boolean).pipe(T.Body("require_all_headers")), ), samesite: S.optional( S.NullOr( GetResponseRulesItemOverridesSessionAffinityAttributesSamesite, ), ), secure: S.optional( S.NullOr(GetResponseRulesItemOverridesSessionAffinityAttributesSecure), ), zeroDowntimeFailover: S.optional( S.NullOr( GetResponseRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover, ).pipe(T.Body("zero_downtime_failover")), ), }), ).annotate({ identifier: "GetResponseRulesItemOverridesSessionAffinityAttributes", }) as any as S.Schema; export type GetResponseRulesItemOverridesSteeringPolicy = | "off" | "geo" | "random" | "dynamic_latency" | "proximity" | "least_outstanding_requests" | "least_connections" | ""; export const GetResponseRulesItemOverridesSteeringPolicy = /*@__PURE__*/ S.String; export interface GetResponseRulesItemOverrides { /** Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin. */ adaptiveRouting?: CreateResponseAdaptiveRouting | null; /** A mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools. */ countryPools?: GetResponseRulesItemOverridesCountryPoolsMap | null; /** A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region. */ defaultPools?: GetResponseRulesItemOverridesDefaultPoolsList | null; /** The pool ID to use when all other pools are detected as unhealthy. */ fallbackPool?: string | null; /** Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected. */ locationStrategy?: GetResponseLocationStrategy | null; /** Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. */ popPools?: GetResponseRulesItemOverridesPopPoolsMap | null; /** Configures pool weights. */ randomSteering?: GetResponseRandomSteering | null; /** A mapping of region codes to a list of pool IDs (ordered by their failover priority) for the given region. Any regions not explicitly defined will fall back to using default_pools. */ regionPools?: GetResponseRulesItemOverridesRegionPoolsMap | null; /** Specifies the type of session affinity the load balancer should use unless specified as `"none"`. 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. */ sessionAffinity?: GetResponseRulesItemOverridesSessionAffinity | null; /** Configures attributes for session affinity. */ sessionAffinityAttributes?: GetResponseRulesItemOverridesSessionAffinityAttributes | null; /** Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven't been used for the number of seconds specified. */ sessionAffinityTtl?: number | null; /** Steering Policy for this load balancer. */ steeringPolicy?: GetResponseRulesItemOverridesSteeringPolicy | null; /** Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers. */ ttl?: number | null; } export const GetResponseRulesItemOverrides = /*@__PURE__*/ S.suspend(() => S.Struct({ adaptiveRouting: S.optional( S.NullOr(CreateResponseAdaptiveRouting).pipe(T.Body("adaptive_routing")), ), countryPools: S.optional( S.NullOr(GetResponseRulesItemOverridesCountryPoolsMap).pipe( T.Body("country_pools"), ), ), defaultPools: S.optional( S.NullOr(GetResponseRulesItemOverridesDefaultPoolsList).pipe( T.Body("default_pools"), ), ), fallbackPool: S.optional(S.NullOr(S.String).pipe(T.Body("fallback_pool"))), locationStrategy: S.optional( S.NullOr(GetResponseLocationStrategy).pipe(T.Body("location_strategy")), ), popPools: S.optional( S.NullOr(GetResponseRulesItemOverridesPopPoolsMap).pipe( T.Body("pop_pools"), ), ), randomSteering: S.optional( S.NullOr(GetResponseRandomSteering).pipe(T.Body("random_steering")), ), regionPools: S.optional( S.NullOr(GetResponseRulesItemOverridesRegionPoolsMap).pipe( T.Body("region_pools"), ), ), sessionAffinity: S.optional( S.NullOr(GetResponseRulesItemOverridesSessionAffinity).pipe( T.Body("session_affinity"), ), ), sessionAffinityAttributes: S.optional( S.NullOr(GetResponseRulesItemOverridesSessionAffinityAttributes).pipe( T.Body("session_affinity_attributes"), ), ), sessionAffinityTtl: S.optional( S.NullOr(S.Number).pipe(T.Body("session_affinity_ttl")), ), steeringPolicy: S.optional( S.NullOr(GetResponseRulesItemOverridesSteeringPolicy).pipe( T.Body("steering_policy"), ), ), ttl: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "GetResponseRulesItemOverrides", }) as any as S.Schema; export interface GetResponseRulesItem { /** The condition expressions to evaluate. If the condition evaluates to true, the overrides or fixed_response in this rule will be applied. An empty condition is always true. For more details on condition expressions, please see https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions. */ condition?: string | null; /** Disable this specific rule. It will no longer be evaluated by this load balancer. */ disabled?: boolean | null; /** A collection of fields used to directly respond to the eyeball instead of routing to a pool. If a fixed_response is supplied the rule will be marked as terminates. */ fixedResponse?: CreateResponseRulesItemFixedResponse | null; /** Name of this rule. Only used for human readability. */ name?: string | null; /** A collection of overrides to apply to the load balancer when this rule's condition is true. All fields are optional. */ overrides?: GetResponseRulesItemOverrides | null; /** The order in which rules should be executed in relation to each other. Lower values are executed first. Values do not need to be sequential. If no value is provided for any rule the array order of the rules field will be used to assign a priority. */ priority?: number | null; /** If this rule's condition is true, this causes rule evaluation to stop after processing this rule. */ terminates?: boolean | null; } export const GetResponseRulesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ condition: S.optional(S.NullOr(S.String)), disabled: S.optional(S.NullOr(S.Boolean)), fixedResponse: S.optional( S.NullOr(CreateResponseRulesItemFixedResponse).pipe( T.Body("fixed_response"), ), ), name: S.optional(S.NullOr(S.String)), overrides: S.optional(S.NullOr(GetResponseRulesItemOverrides)), priority: S.optional(S.NullOr(S.Number)), terminates: S.optional(S.NullOr(S.Boolean)), }), ).annotate({ identifier: "GetResponseRulesItem", }) as any as S.Schema; export type GetResponseRulesList = Array; export const GetResponseRulesList = /*@__PURE__*/ S.Array( GetResponseRulesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetLoadBalancerResponse { id?: string | null; /** Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin. */ adaptiveRouting?: CreateResponseAdaptiveRouting | null; /** A mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools. */ countryPools?: GetResponseCountryPoolsMap | null; createdOn?: string | null; /** A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region. */ defaultPools?: GetResponseDefaultPoolsList | null; /** Object description. */ description?: string | null; /** Whether to enable (the default) this load balancer. */ enabled?: boolean | null; /** The pool ID to use when all other pools are detected as unhealthy. */ fallbackPool?: string | null; /** Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected. */ locationStrategy?: GetResponseLocationStrategy | null; modifiedOn?: string | null; /** The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used. */ name?: string | null; /** List of networks where Load Balancer or Pool is enabled. */ networks?: GetResponseNetworksList | null; /** Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. */ popPools?: GetResponsePopPoolsMap | null; /** Whether the hostname should be gray clouded (false) or orange clouded (true). */ proxied?: boolean | null; /** Configures pool weights. */ randomSteering?: GetResponseRandomSteering | null; /** A mapping of region codes to a list of pool IDs (ordered by their failover priority) for the given region. Any regions not explicitly defined will fall back to using default_pools. */ regionPools?: GetResponseRegionPoolsMap | null; /** BETA Field Not General Access: A list of rules for this load balancer to execute. */ rules?: GetResponseRulesList | null; /** Specifies the type of session affinity the load balancer should use unless specified as `"none"`. 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. */ sessionAffinity?: GetResponseRulesItemOverridesSessionAffinity | null; /** Configures attributes for session affinity. */ sessionAffinityAttributes?: GetResponseRulesItemOverridesSessionAffinityAttributes | null; /** Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven't been used for the number of seconds specified. */ sessionAffinityTtl?: number | null; /** Steering Policy for this load balancer. */ steeringPolicy?: GetResponseRulesItemOverridesSteeringPolicy | null; /** Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers. */ ttl?: number | null; zoneName?: string | null; } export const GetLoadBalancerResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), adaptiveRouting: S.optional( S.NullOr(CreateResponseAdaptiveRouting).pipe(T.Body("adaptive_routing")), ), countryPools: S.optional( S.NullOr(GetResponseCountryPoolsMap).pipe(T.Body("country_pools")), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), defaultPools: S.optional( S.NullOr(GetResponseDefaultPoolsList).pipe(T.Body("default_pools")), ), description: S.optional(S.NullOr(S.String)), enabled: S.optional(S.NullOr(S.Boolean)), fallbackPool: S.optional(S.NullOr(S.String).pipe(T.Body("fallback_pool"))), locationStrategy: S.optional( S.NullOr(GetResponseLocationStrategy).pipe(T.Body("location_strategy")), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), networks: S.optional(S.NullOr(GetResponseNetworksList)), popPools: S.optional( S.NullOr(GetResponsePopPoolsMap).pipe(T.Body("pop_pools")), ), proxied: S.optional(S.NullOr(S.Boolean)), randomSteering: S.optional( S.NullOr(GetResponseRandomSteering).pipe(T.Body("random_steering")), ), regionPools: S.optional( S.NullOr(GetResponseRegionPoolsMap).pipe(T.Body("region_pools")), ), rules: S.optional(S.NullOr(GetResponseRulesList)), sessionAffinity: S.optional( S.NullOr(GetResponseRulesItemOverridesSessionAffinity).pipe( T.Body("session_affinity"), ), ), sessionAffinityAttributes: S.optional( S.NullOr(GetResponseRulesItemOverridesSessionAffinityAttributes).pipe( T.Body("session_affinity_attributes"), ), ), sessionAffinityTtl: S.optional( S.NullOr(S.Number).pipe(T.Body("session_affinity_ttl")), ), steeringPolicy: S.optional( S.NullOr(GetResponseRulesItemOverridesSteeringPolicy).pipe( T.Body("steering_policy"), ), ), ttl: S.optional(S.NullOr(S.Number)), zoneName: S.optional(S.NullOr(S.String).pipe(T.Body("zone_name"))), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetLoadBalancerResponse", }) as any as S.Schema; export interface GetMonitorRequest { /** Identifier. */ accountId: string; monitorId: string; } export const GetMonitorRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), monitorId: S.String.pipe(T.Label("monitor_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/load_balancers/monitors/{monitor_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetMonitorRequest", }) as any as S.Schema; export type MonitorsGetResponseHeaderMap = { [key: string]: unknown | undefined; }; export const MonitorsGetResponseHeaderMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type MonitorsGetResponseType = | "http" | "https" | "tcp" | "udp_icmp" | "icmp_ping" | "smtp"; export const MonitorsGetResponseType = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetMonitorResponse { id?: string | null; /** Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. */ allowInsecure?: boolean | null; /** To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times. */ consecutiveDown?: number | null; /** To be marked healthy the monitored origin must pass this healthcheck N consecutive times. */ consecutiveUp?: number | null; createdOn?: string | null; /** Object description. */ description?: string | null; /** A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors. */ expectedBody?: string | null; /** The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors. */ expectedCodes?: string | null; /** Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors. */ followRedirects?: boolean | null; /** The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors. */ header?: MonitorsGetResponseHeaderMap | null; /** The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations. */ interval?: number | null; /** The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks. */ method?: string | null; modifiedOn?: string | null; /** The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors. */ path?: string | null; /** The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443). */ port?: number | null; /** Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors. */ probeZone?: string | null; /** The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. */ retries?: number | null; /** The timeout (in seconds) before marking the health check as failed. */ timeout?: number | null; /** The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. */ type?: MonitorsGetResponseType | null; } export const GetMonitorResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), allowInsecure: S.optional( S.NullOr(S.Boolean).pipe(T.Body("allow_insecure")), ), consecutiveDown: S.optional( S.NullOr(S.Number).pipe(T.Body("consecutive_down")), ), consecutiveUp: S.optional( S.NullOr(S.Number).pipe(T.Body("consecutive_up")), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), description: S.optional(S.NullOr(S.String)), expectedBody: S.optional(S.NullOr(S.String).pipe(T.Body("expected_body"))), expectedCodes: S.optional( S.NullOr(S.String).pipe(T.Body("expected_codes")), ), followRedirects: S.optional( S.NullOr(S.Boolean).pipe(T.Body("follow_redirects")), ), header: S.optional(S.NullOr(MonitorsGetResponseHeaderMap)), interval: S.optional(S.NullOr(S.Number)), method: S.optional(S.NullOr(S.String)), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), path: S.optional(S.NullOr(S.String)), port: S.optional(S.NullOr(S.Number)), probeZone: S.optional(S.NullOr(S.String).pipe(T.Body("probe_zone"))), retries: S.optional(S.NullOr(S.Number)), timeout: S.optional(S.NullOr(S.Number)), type: S.optional(S.NullOr(MonitorsGetResponseType)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetMonitorResponse", }) as any as S.Schema; export interface GetMonitorGroupRequest { /** Identifier. */ accountId: string; monitorGroupId: string; } export const GetMonitorGroupRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), monitorGroupId: S.String.pipe(T.Label("monitor_group_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/load_balancers/monitor_groups/{monitor_group_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetMonitorGroupRequest", }) as any as S.Schema; export type MonitorGroupsGetResponseMembersItem = MonitorGroupsCreateResponseMembersItem; export const MonitorGroupsGetResponseMembersItem = MonitorGroupsCreateResponseMembersItem; export type MonitorGroupsGetResponseMembersList = Array; export const MonitorGroupsGetResponseMembersList = /*@__PURE__*/ S.Array( MonitorGroupsCreateResponseMembersItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetMonitorGroupResponse { /** The ID of the Monitor Group to use for checking the health of origins within this pool. */ id: string; /** A short description of the monitor group */ description: string; /** List of monitors in this group */ members: MonitorGroupsGetResponseMembersList; /** The timestamp of when the monitor group was created */ createdOn?: string | null; /** The timestamp of when the monitor group was last updated */ modifiedOn?: string | null; } export const GetMonitorGroupResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, description: S.String, members: MonitorGroupsGetResponseMembersList, createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetMonitorGroupResponse", }) as any as S.Schema; export interface GetMonitorGroupReferenceRequest { /** Identifier. */ accountId: string; monitorGroupId: string; } export const GetMonitorGroupReferenceRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), monitorGroupId: S.String.pipe(T.Label("monitor_group_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/load_balancers/monitor_groups/{monitor_group_id}/references", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetMonitorGroupReferenceRequest", }) as any as S.Schema; export type MonitorGroupsReferencesGetResultItemReferenceType = | "*" | "referral" | "referrer"; export const MonitorGroupsReferencesGetResultItemReferenceType = /*@__PURE__*/ S.String; export interface MonitorGroupsReferencesGetResultItem { referenceType?: MonitorGroupsReferencesGetResultItemReferenceType | null; resourceId?: string | null; resourceName?: string | null; resourceType?: string | null; } export const MonitorGroupsReferencesGetResultItem = /*@__PURE__*/ S.suspend( () => S.Struct({ referenceType: S.optional( S.NullOr(MonitorGroupsReferencesGetResultItemReferenceType).pipe( T.Body("reference_type"), ), ), resourceId: S.optional(S.NullOr(S.String).pipe(T.Body("resource_id"))), resourceName: S.optional( S.NullOr(S.String).pipe(T.Body("resource_name")), ), resourceType: S.optional( S.NullOr(S.String).pipe(T.Body("resource_type")), ), }), ).annotate({ identifier: "MonitorGroupsReferencesGetResultItem", }) as any as S.Schema; export type MonitorGroupsReferencesGetResultList = Array; export const MonitorGroupsReferencesGetResultList = /*@__PURE__*/ S.Array( MonitorGroupsReferencesGetResultItem, ) as any as S.Schema; export interface GetMonitorGroupReferenceResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: MonitorGroupsReferencesGetResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const GetMonitorGroupReferenceResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: MonitorGroupsReferencesGetResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetMonitorGroupReferenceResponse", }) as any as S.Schema; export interface GetMonitorReferenceRequest { /** Identifier. */ accountId: string; monitorId: string; } export const GetMonitorReferenceRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), monitorId: S.String.pipe(T.Label("monitor_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/load_balancers/monitors/{monitor_id}/references", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetMonitorReferenceRequest", }) as any as S.Schema; export type MonitorsReferencesGetResultItemReferenceType = | "*" | "referral" | "referrer"; export const MonitorsReferencesGetResultItemReferenceType = /*@__PURE__*/ S.String; export interface MonitorsReferencesGetResultItem { referenceType?: MonitorsReferencesGetResultItemReferenceType | null; resourceId?: string | null; resourceName?: string | null; resourceType?: string | null; } export const MonitorsReferencesGetResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ referenceType: S.optional( S.NullOr(MonitorsReferencesGetResultItemReferenceType).pipe( T.Body("reference_type"), ), ), resourceId: S.optional(S.NullOr(S.String).pipe(T.Body("resource_id"))), resourceName: S.optional(S.NullOr(S.String).pipe(T.Body("resource_name"))), resourceType: S.optional(S.NullOr(S.String).pipe(T.Body("resource_type"))), }), ).annotate({ identifier: "MonitorsReferencesGetResultItem", }) as any as S.Schema; export type MonitorsReferencesGetResultList = Array; export const MonitorsReferencesGetResultList = /*@__PURE__*/ S.Array( MonitorsReferencesGetResultItem, ) as any as S.Schema; export interface GetMonitorReferenceResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: MonitorsReferencesGetResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const GetMonitorReferenceResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: MonitorsReferencesGetResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetMonitorReferenceResponse", }) as any as S.Schema; export interface GetPoolRequest { /** Identifier. */ accountId: string; poolId: string; } export const GetPoolRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), poolId: S.String.pipe(T.Label("pool_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/load_balancers/pools/{pool_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetPoolRequest" }) as any as S.Schema; export type PoolsGetResponseCheckRegionsItem = | "WNAM" | "ENAM" | "WEU" | "EEU" | "NSAM" | "SSAM" | "OC" | "ME" | "NAF" | "SAF" | "SAS" | "SEAS" | "NEAS" | "ALL_REGIONS"; export const PoolsGetResponseCheckRegionsItem = /*@__PURE__*/ S.String; export type PoolsGetResponseCheckRegionsList = Array; export const PoolsGetResponseCheckRegionsList = /*@__PURE__*/ S.Array( PoolsGetResponseCheckRegionsItem, ) as any as S.Schema; export type PoolsGetResponseLoadSheddingDefaultPolicy = "random" | "hash"; export const PoolsGetResponseLoadSheddingDefaultPolicy = /*@__PURE__*/ S.String; export type PoolsGetResponseLoadSheddingSessionPolicy = "hash"; export const PoolsGetResponseLoadSheddingSessionPolicy = /*@__PURE__*/ S.String; export interface PoolsGetResponseLoadShedding { /** The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity. */ defaultPercent?: number | null; /** The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs. */ defaultPolicy?: PoolsGetResponseLoadSheddingDefaultPolicy | null; /** The percent of existing sessions to shed from the pool, according to the session policy. */ sessionPercent?: number | null; /** Only the hash policy is supported for existing sessions (to avoid exponential decay). */ sessionPolicy?: PoolsGetResponseLoadSheddingSessionPolicy | null; } export const PoolsGetResponseLoadShedding = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultPercent: S.optional( S.NullOr(S.Number).pipe(T.Body("default_percent")), ), defaultPolicy: S.optional( S.NullOr(PoolsGetResponseLoadSheddingDefaultPolicy).pipe( T.Body("default_policy"), ), ), sessionPercent: S.optional( S.NullOr(S.Number).pipe(T.Body("session_percent")), ), sessionPolicy: S.optional( S.NullOr(PoolsGetResponseLoadSheddingSessionPolicy).pipe( T.Body("session_policy"), ), ), }), ).annotate({ identifier: "PoolsGetResponseLoadShedding", }) as any as S.Schema; export type PoolsGetResponseNetworksList = Array; export const PoolsGetResponseNetworksList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type PoolsGetResponseNotificationFilterOrigin = PoolsBulkEditResultItemNotificationFilterOrigin; export const PoolsGetResponseNotificationFilterOrigin = PoolsBulkEditResultItemNotificationFilterOrigin; export type PoolsGetResponseNotificationFilter = PoolsBulkEditResultItemNotificationFilter; export const PoolsGetResponseNotificationFilter = PoolsBulkEditResultItemNotificationFilter; export type PoolsGetResponseOriginSteeringPolicy = | "random" | "hash" | "least_outstanding_requests" | "least_connections"; export const PoolsGetResponseOriginSteeringPolicy = /*@__PURE__*/ S.String; export interface PoolsGetResponseOriginSteering { /** The type of origin steering policy to use. */ policy?: PoolsGetResponseOriginSteeringPolicy | null; } export const PoolsGetResponseOriginSteering = /*@__PURE__*/ S.suspend(() => S.Struct({ policy: S.optional(S.NullOr(PoolsGetResponseOriginSteeringPolicy)), }), ).annotate({ identifier: "PoolsGetResponseOriginSteering", }) as any as S.Schema; export type PoolsGetResponseOriginsItemHeaderHostList = Array; export const PoolsGetResponseOriginsItemHeaderHostList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface PoolsGetResponseOriginsItemHeader { /** The 'Host' header allows to override the hostname set in the HTTP request. Current support is 1 'Host' header override per origin. */ host?: PoolsGetResponseOriginsItemHeaderHostList | null; } export const PoolsGetResponseOriginsItemHeader = /*@__PURE__*/ S.suspend(() => S.Struct({ host: S.optional( S.NullOr(PoolsGetResponseOriginsItemHeaderHostList).pipe(T.Body("Host")), ), }), ).annotate({ identifier: "PoolsGetResponseOriginsItemHeader", }) as any as S.Schema; export interface PoolsGetResponseOriginsItem { /** The IP address (IPv4 or IPv6) of the origin, or its publicly addressable hostname. Hostnames entered here should resolve directly to the origin, and not be a hostname proxied by Cloudflare. To set an internal/reserved address, virtual_network_id must also be set. */ address?: string | null; /** This field shows up only if the origin is disabled. This field is set with the time the origin was disabled. */ disabledAt?: string | null; /** Whether to enable (the default) this origin within the pool. Disabled origins will not receive traffic and are excluded from health checks. The origin will only be disabled for the current pool. */ enabled?: boolean | null; /** Whether to flatten CNAME records for this origin, resolving them to A/AAAA records before returning to the client. When true (the default), the director resolves CNAME addresses to their underlying A/AAAA records. When false, the origin address is returned as a raw CNAME record without resolution. This setting mirrors the DNS API record flatten_cname setting. */ flattenCname?: boolean | null; /** The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'. */ header?: PoolsGetResponseOriginsItemHeader | null; /** A human-identifiable name for the origin. */ name?: string | null; /** The port for upstream connections. A value of 0 means the default port for the protocol will be used. */ port?: number | null; /** The virtual network subnet ID the origin belongs in. Virtual network must also belong to the account. */ virtualNetworkId?: string | null; /** The weight of this origin relative to other origins in the pool. Based on the configured weight the total traffic is distributed among origins within the pool. */ weight?: number | null; } export const PoolsGetResponseOriginsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ address: S.optional(S.NullOr(S.String)), disabledAt: S.optional(S.NullOr(S.String).pipe(T.Body("disabled_at"))), enabled: S.optional(S.NullOr(S.Boolean)), flattenCname: S.optional(S.NullOr(S.Boolean).pipe(T.Body("flatten_cname"))), header: S.optional(S.NullOr(PoolsGetResponseOriginsItemHeader)), name: S.optional(S.NullOr(S.String)), port: S.optional(S.NullOr(S.Number)), virtualNetworkId: S.optional( S.NullOr(S.String).pipe(T.Body("virtual_network_id")), ), weight: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "PoolsGetResponseOriginsItem", }) as any as S.Schema; export type PoolsGetResponseOriginsList = Array; export const PoolsGetResponseOriginsList = /*@__PURE__*/ S.Array( PoolsGetResponseOriginsItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetPoolResponse { id?: string | null; /** A list of regions from which to run health checks. Null means every Cloudflare data center. */ checkRegions?: PoolsGetResponseCheckRegionsList | null; createdOn?: string | null; /** A human-readable description of the pool. */ description?: string | null; /** This field shows up only if the pool is disabled. This field is set with the time the pool was disabled at. */ disabledAt?: string | null; /** Whether to enable (the default) or disable this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any). */ enabled?: boolean | null; /** The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set. */ latitude?: number | null; /** Configures load shedding policies and percentages for the pool. */ loadShedding?: PoolsGetResponseLoadShedding | null; /** The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set. */ longitude?: number | null; /** The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and will failover to the next available pool. */ minimumOrigins?: number | null; modifiedOn?: string | null; /** The ID of the Monitor to use for checking the health of origins within this pool. */ monitor?: string | null; /** The ID of the Monitor Group to use for checking the health of origins within this pool. */ monitorGroup?: string | null; /** A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed. */ name?: string | null; /** List of networks where Load Balancer or Pool is enabled. */ networks?: PoolsGetResponseNetworksList | null; /** This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address to send health status notifications to. This can be an individual mailbox or a mailing list. Multiple emails can be supplied as a comma delimited list. */ notificationEmail?: string | null; /** Filter pool and origin health notifications by resource type or health status. Use null to reset. */ notificationFilter?: PoolsBulkEditResultItemNotificationFilter | null; /** Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity. */ originSteering?: PoolsGetResponseOriginSteering | null; /** The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. */ origins?: PoolsGetResponseOriginsList | null; } export const GetPoolResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), checkRegions: S.optional( S.NullOr(PoolsGetResponseCheckRegionsList).pipe(T.Body("check_regions")), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), description: S.optional(S.NullOr(S.String)), disabledAt: S.optional(S.NullOr(S.String).pipe(T.Body("disabled_at"))), enabled: S.optional(S.NullOr(S.Boolean)), latitude: S.optional(S.NullOr(S.Number)), loadShedding: S.optional( S.NullOr(PoolsGetResponseLoadShedding).pipe(T.Body("load_shedding")), ), longitude: S.optional(S.NullOr(S.Number)), minimumOrigins: S.optional( S.NullOr(S.Number).pipe(T.Body("minimum_origins")), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), monitor: S.optional(S.NullOr(S.String)), monitorGroup: S.optional(S.NullOr(S.String).pipe(T.Body("monitor_group"))), name: S.optional(S.NullOr(S.String)), networks: S.optional(S.NullOr(PoolsGetResponseNetworksList)), notificationEmail: S.optional( S.NullOr(S.String).pipe(T.Body("notification_email")), ), notificationFilter: S.optional( S.NullOr(PoolsBulkEditResultItemNotificationFilter).pipe( T.Body("notification_filter"), ), ), originSteering: S.optional( S.NullOr(PoolsGetResponseOriginSteering).pipe(T.Body("origin_steering")), ), origins: S.optional(S.NullOr(PoolsGetResponseOriginsList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetPoolResponse", }) as any as S.Schema; export interface GetPoolHealthRequest { /** Identifier. */ accountId: string; poolId: string; } export const GetPoolHealthRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), poolId: S.String.pipe(T.Label("pool_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/load_balancers/pools/{pool_id}/health", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetPoolHealthRequest", }) as any as S.Schema; export interface PoolsHealthGetResponsePopHealthOriginsItemIp { /** Failure reason. */ failureReason?: string | null; /** Origin health status. */ healthy?: boolean | null; /** Response code from origin health check. */ responseCode?: number | null; /** Origin RTT (Round Trip Time) response. */ rtt?: string | null; } export const PoolsHealthGetResponsePopHealthOriginsItemIp = /*@__PURE__*/ S.suspend(() => S.Struct({ failureReason: S.optional( S.NullOr(S.String).pipe(T.Body("failure_reason")), ), healthy: S.optional(S.NullOr(S.Boolean)), responseCode: S.optional( S.NullOr(S.Number).pipe(T.Body("response_code")), ), rtt: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "PoolsHealthGetResponsePopHealthOriginsItemIp", }) as any as S.Schema; export interface PoolsHealthGetResponsePopHealthOriginsItem { ip?: PoolsHealthGetResponsePopHealthOriginsItemIp | null; } export const PoolsHealthGetResponsePopHealthOriginsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ ip: S.optional(S.NullOr(PoolsHealthGetResponsePopHealthOriginsItemIp)), }), ).annotate({ identifier: "PoolsHealthGetResponsePopHealthOriginsItem", }) as any as S.Schema; export type PoolsHealthGetResponsePopHealthOriginsList = Array; export const PoolsHealthGetResponsePopHealthOriginsList = /*@__PURE__*/ S.Array( PoolsHealthGetResponsePopHealthOriginsItem, ) as any as S.Schema; export interface PoolsHealthGetResponsePopHealth { /** Whether health check in region is healthy. */ healthy?: boolean | null; origins?: PoolsHealthGetResponsePopHealthOriginsList | null; } export const PoolsHealthGetResponsePopHealth = /*@__PURE__*/ S.suspend(() => S.Struct({ healthy: S.optional(S.NullOr(S.Boolean)), origins: S.optional(S.NullOr(PoolsHealthGetResponsePopHealthOriginsList)), }), ).annotate({ identifier: "PoolsHealthGetResponsePopHealth", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetPoolHealthResponse { /** Pool ID. */ poolId?: string | null; /** List of regions and associated health status. */ popHealth?: PoolsHealthGetResponsePopHealth | null; } export const GetPoolHealthResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ poolId: S.optional(S.NullOr(S.String).pipe(T.Body("pool_id"))), popHealth: S.optional( S.NullOr(PoolsHealthGetResponsePopHealth).pipe(T.Body("pop_health")), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetPoolHealthResponse", }) as any as S.Schema; export interface GetPoolReferenceRequest { /** Identifier. */ accountId: string; poolId: string; } export const GetPoolReferenceRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), poolId: S.String.pipe(T.Label("pool_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/load_balancers/pools/{pool_id}/references", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetPoolReferenceRequest", }) as any as S.Schema; export type PoolsReferencesGetResultItemReferenceType = | "*" | "referral" | "referrer"; export const PoolsReferencesGetResultItemReferenceType = /*@__PURE__*/ S.String; export interface PoolsReferencesGetResultItem { referenceType?: PoolsReferencesGetResultItemReferenceType | null; resourceId?: string | null; resourceName?: string | null; resourceType?: string | null; } export const PoolsReferencesGetResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ referenceType: S.optional( S.NullOr(PoolsReferencesGetResultItemReferenceType).pipe( T.Body("reference_type"), ), ), resourceId: S.optional(S.NullOr(S.String).pipe(T.Body("resource_id"))), resourceName: S.optional(S.NullOr(S.String).pipe(T.Body("resource_name"))), resourceType: S.optional(S.NullOr(S.String).pipe(T.Body("resource_type"))), }), ).annotate({ identifier: "PoolsReferencesGetResultItem", }) as any as S.Schema; export type PoolsReferencesGetResultList = Array; export const PoolsReferencesGetResultList = /*@__PURE__*/ S.Array( PoolsReferencesGetResultItem, ) as any as S.Schema; export interface GetPoolReferenceResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: PoolsReferencesGetResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const GetPoolReferenceResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: PoolsReferencesGetResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetPoolReferenceResponse", }) as any as S.Schema; export interface GetPreviewRequest { /** Identifier. */ accountId: string; previewId: string; } export const GetPreviewRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), previewId: S.String.pipe(T.Label("preview_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/load_balancers/preview/{preview_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetPreviewRequest", }) as any as S.Schema; export interface PreviewsGetResultValueOriginsItemValue { failureReason?: string | null; healthy?: boolean | null; responseCode?: number | null; rtt?: string | null; } export const PreviewsGetResultValueOriginsItemValue = /*@__PURE__*/ S.suspend( () => S.Struct({ failureReason: S.optional( S.NullOr(S.String).pipe(T.Body("failure_reason")), ), healthy: S.optional(S.NullOr(S.Boolean)), responseCode: S.optional( S.NullOr(S.Number).pipe(T.Body("response_code")), ), rtt: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "PreviewsGetResultValueOriginsItemValue", }) as any as S.Schema; export type PreviewsGetResultValueOriginsItemMap = { [key: string]: PreviewsGetResultValueOriginsItemValue | undefined; }; export const PreviewsGetResultValueOriginsItemMap = /*@__PURE__*/ S.Record( S.String, PreviewsGetResultValueOriginsItemValue, ) as any as S.Schema; export type PreviewsGetResultValueOriginsList = Array; export const PreviewsGetResultValueOriginsList = /*@__PURE__*/ S.Array( PreviewsGetResultValueOriginsItemMap, ) as any as S.Schema; export interface PreviewsGetResultValue { healthy?: boolean | null; origins?: PreviewsGetResultValueOriginsList | null; } export const PreviewsGetResultValue = /*@__PURE__*/ S.suspend(() => S.Struct({ healthy: S.optional(S.NullOr(S.Boolean)), origins: S.optional(S.NullOr(PreviewsGetResultValueOriginsList)), }), ).annotate({ identifier: "PreviewsGetResultValue", }) as any as S.Schema; export type PreviewsGetResultMap = { [key: string]: PreviewsGetResultValue | undefined; }; export const PreviewsGetResultMap = /*@__PURE__*/ S.Record( S.String, PreviewsGetResultValue, ) as any as S.Schema; export type GetPreviewResponse = PreviewsGetResultMap; export const GetPreviewResponse = /*@__PURE__*/ S.suspend(() => PreviewsGetResultMap.pipe( T.EnvelopePayloadRoot(), T.KeyDictionary(KEY_DICTIONARY), ), ).annotate({ identifier: "GetPreviewResponse", }) as any as S.Schema; export type RegionsGetRequestRegionId = | "WNAM" | "ENAM" | "WEU" | "EEU" | "NSAM" | "SSAM" | "OC" | "ME" | "NAF" | "SAF" | "SAS" | "SEAS" | "NEAS"; export const RegionsGetRequestRegionId = /*@__PURE__*/ S.String; export interface GetRegionRequest { /** Identifier. */ accountId: string; /** A list of Cloudflare regions. WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe, EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America, OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS: Southern Asia, SEAS: South East Asia, NEAS: North East Asia). */ regionId: RegionsGetRequestRegionId | (string & {}); } export const GetRegionRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), regionId: RegionsGetRequestRegionId.pipe(T.Label("region_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/load_balancers/regions/{region_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetRegionRequest", }) as any as S.Schema; export type GetRegionResponse = unknown; export const GetRegionResponse = /*@__PURE__*/ S.suspend(() => S.Unknown.pipe(T.EnvelopePayloadRoot(), T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetRegionResponse", }) as any as S.Schema; export interface ListLoadBalancersRequest { zoneId: string; } export const ListLoadBalancersRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/load_balancers", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListLoadBalancersRequest", }) as any as S.Schema; export type ListResultItemAdaptiveRouting = CreateResponseAdaptiveRouting; export const ListResultItemAdaptiveRouting = CreateResponseAdaptiveRouting; export type ListResultItemCountryPoolsMap = { [key: string]: unknown | undefined; }; export const ListResultItemCountryPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type ListResultItemDefaultPoolsList = Array; export const ListResultItemDefaultPoolsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ListResultItemLocationStrategyMode = "pop" | "resolver_ip"; export const ListResultItemLocationStrategyMode = /*@__PURE__*/ S.String; export type ListResultItemLocationStrategyPreferEcs = | "always" | "never" | "proximity" | "geo"; export const ListResultItemLocationStrategyPreferEcs = /*@__PURE__*/ S.String; export interface ListResultItemLocationStrategy { /** Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful. */ mode?: ListResultItemLocationStrategyMode | null; /** Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location. */ preferEcs?: ListResultItemLocationStrategyPreferEcs | null; } export const ListResultItemLocationStrategy = /*@__PURE__*/ S.suspend(() => S.Struct({ mode: S.optional(S.NullOr(ListResultItemLocationStrategyMode)), preferEcs: S.optional( S.NullOr(ListResultItemLocationStrategyPreferEcs).pipe( T.Body("prefer_ecs"), ), ), }), ).annotate({ identifier: "ListResultItemLocationStrategy", }) as any as S.Schema; export type ListResultItemNetworksList = Array; export const ListResultItemNetworksList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ListResultItemPopPoolsMap = { [key: string]: unknown | undefined }; export const ListResultItemPopPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type ListResultItemRandomSteeringPoolWeightsMap = { [key: string]: number | undefined; }; export const ListResultItemRandomSteeringPoolWeightsMap = /*@__PURE__*/ S.Record( S.String, S.Number, ) as any as S.Schema; export interface ListResultItemRandomSteering { /** The default weight for pools in the load balancer that are not specified in the pool_weights map. */ defaultWeight?: number | null; /** A mapping of pool IDs to custom weights. The weight is relative to other pools in the load balancer. */ poolWeights?: ListResultItemRandomSteeringPoolWeightsMap | null; } export const ListResultItemRandomSteering = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultWeight: S.optional( S.NullOr(S.Number).pipe(T.Body("default_weight")), ), poolWeights: S.optional( S.NullOr(ListResultItemRandomSteeringPoolWeightsMap).pipe( T.Body("pool_weights"), ), ), }), ).annotate({ identifier: "ListResultItemRandomSteering", }) as any as S.Schema; export type ListResultItemRegionPoolsMap = { [key: string]: unknown | undefined; }; export const ListResultItemRegionPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type ListResultItemRulesItemFixedResponse = CreateResponseRulesItemFixedResponse; export const ListResultItemRulesItemFixedResponse = CreateResponseRulesItemFixedResponse; export type ListResultItemRulesItemOverridesCountryPoolsMap = { [key: string]: unknown | undefined; }; export const ListResultItemRulesItemOverridesCountryPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type ListResultItemRulesItemOverridesDefaultPoolsList = Array; export const ListResultItemRulesItemOverridesDefaultPoolsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ListResultItemRulesItemOverridesPopPoolsMap = { [key: string]: unknown | undefined; }; export const ListResultItemRulesItemOverridesPopPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type ListResultItemRulesItemOverridesRegionPoolsMap = { [key: string]: unknown | undefined; }; export const ListResultItemRulesItemOverridesRegionPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type ListResultItemRulesItemOverridesSessionAffinity = | "none" | "cookie" | "ip_cookie" | "header"; export const ListResultItemRulesItemOverridesSessionAffinity = /*@__PURE__*/ S.String; export type ListResultItemRulesItemOverridesSessionAffinityAttributesHeadersList = Array; export const ListResultItemRulesItemOverridesSessionAffinityAttributesHeadersList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ListResultItemRulesItemOverridesSessionAffinityAttributesSamesite = | "Auto" | "Lax" | "None" | "Strict"; export const ListResultItemRulesItemOverridesSessionAffinityAttributesSamesite = /*@__PURE__*/ S.String; export type ListResultItemRulesItemOverridesSessionAffinityAttributesSecure = | "Auto" | "Always" | "Never"; export const ListResultItemRulesItemOverridesSessionAffinityAttributesSecure = /*@__PURE__*/ S.String; export type ListResultItemRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover = | "none" | "temporary" | "sticky"; export const ListResultItemRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover = /*@__PURE__*/ S.String; export interface ListResultItemRulesItemOverridesSessionAffinityAttributes { /** Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer. */ drainDuration?: number | null; /** Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:,"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans. */ headers?: ListResultItemRulesItemOverridesSessionAffinityAttributesHeadersList | null; /** When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren't created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren't created. */ requireAllHeaders?: boolean | null; /** Configures the SameSite attribute on session affinity cookie. Value "Auto" will be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: when using value "None", the secure attribute can not be set to "Never". */ samesite?: ListResultItemRulesItemOverridesSessionAffinityAttributesSamesite | null; /** Configures the Secure attribute on session affinity cookie. Value "Always" indicates the Secure attribute will be set in the Set-Cookie header, "Never" indicates the Secure attribute will not be set, and "Auto" will set the Secure attribute depending if Always Use HTTPS is enabled. */ secure?: ListResultItemRulesItemOverridesSessionAffinityAttributesSecure | null; /** Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are: - `"none"`: No failover takes place for sessions pinned to the origin (default). - `"temporary"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. - `"sticky"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header. */ zeroDowntimeFailover?: ListResultItemRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover | null; } export const ListResultItemRulesItemOverridesSessionAffinityAttributes = /*@__PURE__*/ S.suspend(() => S.Struct({ drainDuration: S.optional( S.NullOr(S.Number).pipe(T.Body("drain_duration")), ), headers: S.optional( S.NullOr( ListResultItemRulesItemOverridesSessionAffinityAttributesHeadersList, ), ), requireAllHeaders: S.optional( S.NullOr(S.Boolean).pipe(T.Body("require_all_headers")), ), samesite: S.optional( S.NullOr( ListResultItemRulesItemOverridesSessionAffinityAttributesSamesite, ), ), secure: S.optional( S.NullOr( ListResultItemRulesItemOverridesSessionAffinityAttributesSecure, ), ), zeroDowntimeFailover: S.optional( S.NullOr( ListResultItemRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover, ).pipe(T.Body("zero_downtime_failover")), ), }), ).annotate({ identifier: "ListResultItemRulesItemOverridesSessionAffinityAttributes", }) as any as S.Schema; export type ListResultItemRulesItemOverridesSteeringPolicy = | "off" | "geo" | "random" | "dynamic_latency" | "proximity" | "least_outstanding_requests" | "least_connections" | ""; export const ListResultItemRulesItemOverridesSteeringPolicy = /*@__PURE__*/ S.String; export interface ListResultItemRulesItemOverrides { /** Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin. */ adaptiveRouting?: CreateResponseAdaptiveRouting | null; /** A mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools. */ countryPools?: ListResultItemRulesItemOverridesCountryPoolsMap | null; /** A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region. */ defaultPools?: ListResultItemRulesItemOverridesDefaultPoolsList | null; /** The pool ID to use when all other pools are detected as unhealthy. */ fallbackPool?: string | null; /** Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected. */ locationStrategy?: ListResultItemLocationStrategy | null; /** Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. */ popPools?: ListResultItemRulesItemOverridesPopPoolsMap | null; /** Configures pool weights. */ randomSteering?: ListResultItemRandomSteering | null; /** A mapping of region codes to a list of pool IDs (ordered by their failover priority) for the given region. Any regions not explicitly defined will fall back to using default_pools. */ regionPools?: ListResultItemRulesItemOverridesRegionPoolsMap | null; /** Specifies the type of session affinity the load balancer should use unless specified as `"none"`. 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. */ sessionAffinity?: ListResultItemRulesItemOverridesSessionAffinity | null; /** Configures attributes for session affinity. */ sessionAffinityAttributes?: ListResultItemRulesItemOverridesSessionAffinityAttributes | null; /** Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven't been used for the number of seconds specified. */ sessionAffinityTtl?: number | null; /** Steering Policy for this load balancer. */ steeringPolicy?: ListResultItemRulesItemOverridesSteeringPolicy | null; /** Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers. */ ttl?: number | null; } export const ListResultItemRulesItemOverrides = /*@__PURE__*/ S.suspend(() => S.Struct({ adaptiveRouting: S.optional( S.NullOr(CreateResponseAdaptiveRouting).pipe(T.Body("adaptive_routing")), ), countryPools: S.optional( S.NullOr(ListResultItemRulesItemOverridesCountryPoolsMap).pipe( T.Body("country_pools"), ), ), defaultPools: S.optional( S.NullOr(ListResultItemRulesItemOverridesDefaultPoolsList).pipe( T.Body("default_pools"), ), ), fallbackPool: S.optional(S.NullOr(S.String).pipe(T.Body("fallback_pool"))), locationStrategy: S.optional( S.NullOr(ListResultItemLocationStrategy).pipe( T.Body("location_strategy"), ), ), popPools: S.optional( S.NullOr(ListResultItemRulesItemOverridesPopPoolsMap).pipe( T.Body("pop_pools"), ), ), randomSteering: S.optional( S.NullOr(ListResultItemRandomSteering).pipe(T.Body("random_steering")), ), regionPools: S.optional( S.NullOr(ListResultItemRulesItemOverridesRegionPoolsMap).pipe( T.Body("region_pools"), ), ), sessionAffinity: S.optional( S.NullOr(ListResultItemRulesItemOverridesSessionAffinity).pipe( T.Body("session_affinity"), ), ), sessionAffinityAttributes: S.optional( S.NullOr(ListResultItemRulesItemOverridesSessionAffinityAttributes).pipe( T.Body("session_affinity_attributes"), ), ), sessionAffinityTtl: S.optional( S.NullOr(S.Number).pipe(T.Body("session_affinity_ttl")), ), steeringPolicy: S.optional( S.NullOr(ListResultItemRulesItemOverridesSteeringPolicy).pipe( T.Body("steering_policy"), ), ), ttl: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "ListResultItemRulesItemOverrides", }) as any as S.Schema; export interface ListResultItemRulesItem { /** The condition expressions to evaluate. If the condition evaluates to true, the overrides or fixed_response in this rule will be applied. An empty condition is always true. For more details on condition expressions, please see https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions. */ condition?: string | null; /** Disable this specific rule. It will no longer be evaluated by this load balancer. */ disabled?: boolean | null; /** A collection of fields used to directly respond to the eyeball instead of routing to a pool. If a fixed_response is supplied the rule will be marked as terminates. */ fixedResponse?: CreateResponseRulesItemFixedResponse | null; /** Name of this rule. Only used for human readability. */ name?: string | null; /** A collection of overrides to apply to the load balancer when this rule's condition is true. All fields are optional. */ overrides?: ListResultItemRulesItemOverrides | null; /** The order in which rules should be executed in relation to each other. Lower values are executed first. Values do not need to be sequential. If no value is provided for any rule the array order of the rules field will be used to assign a priority. */ priority?: number | null; /** If this rule's condition is true, this causes rule evaluation to stop after processing this rule. */ terminates?: boolean | null; } export const ListResultItemRulesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ condition: S.optional(S.NullOr(S.String)), disabled: S.optional(S.NullOr(S.Boolean)), fixedResponse: S.optional( S.NullOr(CreateResponseRulesItemFixedResponse).pipe( T.Body("fixed_response"), ), ), name: S.optional(S.NullOr(S.String)), overrides: S.optional(S.NullOr(ListResultItemRulesItemOverrides)), priority: S.optional(S.NullOr(S.Number)), terminates: S.optional(S.NullOr(S.Boolean)), }), ).annotate({ identifier: "ListResultItemRulesItem", }) as any as S.Schema; export type ListResultItemRulesList = Array; export const ListResultItemRulesList = /*@__PURE__*/ S.Array( ListResultItemRulesItem, ) as any as S.Schema; export interface ListResultItem { id?: string | null; /** Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin. */ adaptiveRouting?: CreateResponseAdaptiveRouting | null; /** A mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools. */ countryPools?: ListResultItemCountryPoolsMap | null; createdOn?: string | null; /** A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region. */ defaultPools?: ListResultItemDefaultPoolsList | null; /** Object description. */ description?: string | null; /** Whether to enable (the default) this load balancer. */ enabled?: boolean | null; /** The pool ID to use when all other pools are detected as unhealthy. */ fallbackPool?: string | null; /** Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected. */ locationStrategy?: ListResultItemLocationStrategy | null; modifiedOn?: string | null; /** The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used. */ name?: string | null; /** List of networks where Load Balancer or Pool is enabled. */ networks?: ListResultItemNetworksList | null; /** Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. */ popPools?: ListResultItemPopPoolsMap | null; /** Whether the hostname should be gray clouded (false) or orange clouded (true). */ proxied?: boolean | null; /** Configures pool weights. */ randomSteering?: ListResultItemRandomSteering | null; /** A mapping of region codes to a list of pool IDs (ordered by their failover priority) for the given region. Any regions not explicitly defined will fall back to using default_pools. */ regionPools?: ListResultItemRegionPoolsMap | null; /** BETA Field Not General Access: A list of rules for this load balancer to execute. */ rules?: ListResultItemRulesList | null; /** Specifies the type of session affinity the load balancer should use unless specified as `"none"`. 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. */ sessionAffinity?: ListResultItemRulesItemOverridesSessionAffinity | null; /** Configures attributes for session affinity. */ sessionAffinityAttributes?: ListResultItemRulesItemOverridesSessionAffinityAttributes | null; /** Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven't been used for the number of seconds specified. */ sessionAffinityTtl?: number | null; /** Steering Policy for this load balancer. */ steeringPolicy?: ListResultItemRulesItemOverridesSteeringPolicy | null; /** Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers. */ ttl?: number | null; zoneName?: string | null; } export const ListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), adaptiveRouting: S.optional( S.NullOr(CreateResponseAdaptiveRouting).pipe(T.Body("adaptive_routing")), ), countryPools: S.optional( S.NullOr(ListResultItemCountryPoolsMap).pipe(T.Body("country_pools")), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), defaultPools: S.optional( S.NullOr(ListResultItemDefaultPoolsList).pipe(T.Body("default_pools")), ), description: S.optional(S.NullOr(S.String)), enabled: S.optional(S.NullOr(S.Boolean)), fallbackPool: S.optional(S.NullOr(S.String).pipe(T.Body("fallback_pool"))), locationStrategy: S.optional( S.NullOr(ListResultItemLocationStrategy).pipe( T.Body("location_strategy"), ), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), networks: S.optional(S.NullOr(ListResultItemNetworksList)), popPools: S.optional( S.NullOr(ListResultItemPopPoolsMap).pipe(T.Body("pop_pools")), ), proxied: S.optional(S.NullOr(S.Boolean)), randomSteering: S.optional( S.NullOr(ListResultItemRandomSteering).pipe(T.Body("random_steering")), ), regionPools: S.optional( S.NullOr(ListResultItemRegionPoolsMap).pipe(T.Body("region_pools")), ), rules: S.optional(S.NullOr(ListResultItemRulesList)), sessionAffinity: S.optional( S.NullOr(ListResultItemRulesItemOverridesSessionAffinity).pipe( T.Body("session_affinity"), ), ), sessionAffinityAttributes: S.optional( S.NullOr(ListResultItemRulesItemOverridesSessionAffinityAttributes).pipe( T.Body("session_affinity_attributes"), ), ), sessionAffinityTtl: S.optional( S.NullOr(S.Number).pipe(T.Body("session_affinity_ttl")), ), steeringPolicy: S.optional( S.NullOr(ListResultItemRulesItemOverridesSteeringPolicy).pipe( T.Body("steering_policy"), ), ), ttl: S.optional(S.NullOr(S.Number)), zoneName: S.optional(S.NullOr(S.String).pipe(T.Body("zone_name"))), }), ).annotate({ identifier: "ListResultItem" }) as any as S.Schema; export type ListResultList = Array; export const ListResultList = /*@__PURE__*/ S.Array( ListResultItem, ) as any as S.Schema; export interface ListLoadBalancersResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: ListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListLoadBalancersResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: ListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListLoadBalancersResponse", }) as any as S.Schema; export interface ListMonitorGroupsRequest { /** Identifier. */ accountId: string; } export const ListMonitorGroupsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/load_balancers/monitor_groups", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListMonitorGroupsRequest", }) as any as S.Schema; export type MonitorGroupsListResultItemMembersItem = MonitorGroupsCreateResponseMembersItem; export const MonitorGroupsListResultItemMembersItem = MonitorGroupsCreateResponseMembersItem; export type MonitorGroupsListResultItemMembersList = Array; export const MonitorGroupsListResultItemMembersList = /*@__PURE__*/ S.Array( MonitorGroupsCreateResponseMembersItem, ) as any as S.Schema; export interface MonitorGroupsListResultItem { /** The ID of the Monitor Group to use for checking the health of origins within this pool. */ id: string; /** A short description of the monitor group */ description: string; /** List of monitors in this group */ members: MonitorGroupsListResultItemMembersList; /** The timestamp of when the monitor group was created */ createdOn?: string | null; /** The timestamp of when the monitor group was last updated */ modifiedOn?: string | null; } export const MonitorGroupsListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, description: S.String, members: MonitorGroupsListResultItemMembersList, createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), }), ).annotate({ identifier: "MonitorGroupsListResultItem", }) as any as S.Schema; export type MonitorGroupsListResultList = Array; export const MonitorGroupsListResultList = /*@__PURE__*/ S.Array( MonitorGroupsListResultItem, ) as any as S.Schema; export interface ListMonitorGroupsResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: MonitorGroupsListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListMonitorGroupsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: MonitorGroupsListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListMonitorGroupsResponse", }) as any as S.Schema; export interface ListMonitorsRequest { /** Identifier. */ accountId: string; } export const ListMonitorsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/load_balancers/monitors", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListMonitorsRequest", }) as any as S.Schema; export type MonitorsListResultItemHeaderMap = { [key: string]: unknown | undefined; }; export const MonitorsListResultItemHeaderMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type MonitorsListResultItemType = | "http" | "https" | "tcp" | "udp_icmp" | "icmp_ping" | "smtp"; export const MonitorsListResultItemType = /*@__PURE__*/ S.String; export interface MonitorsListResultItem { id?: string | null; /** Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. */ allowInsecure?: boolean | null; /** To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times. */ consecutiveDown?: number | null; /** To be marked healthy the monitored origin must pass this healthcheck N consecutive times. */ consecutiveUp?: number | null; createdOn?: string | null; /** Object description. */ description?: string | null; /** A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors. */ expectedBody?: string | null; /** The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors. */ expectedCodes?: string | null; /** Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors. */ followRedirects?: boolean | null; /** The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors. */ header?: MonitorsListResultItemHeaderMap | null; /** The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations. */ interval?: number | null; /** The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks. */ method?: string | null; modifiedOn?: string | null; /** The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors. */ path?: string | null; /** The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443). */ port?: number | null; /** Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors. */ probeZone?: string | null; /** The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. */ retries?: number | null; /** The timeout (in seconds) before marking the health check as failed. */ timeout?: number | null; /** The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. */ type?: MonitorsListResultItemType | null; } export const MonitorsListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), allowInsecure: S.optional( S.NullOr(S.Boolean).pipe(T.Body("allow_insecure")), ), consecutiveDown: S.optional( S.NullOr(S.Number).pipe(T.Body("consecutive_down")), ), consecutiveUp: S.optional( S.NullOr(S.Number).pipe(T.Body("consecutive_up")), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), description: S.optional(S.NullOr(S.String)), expectedBody: S.optional(S.NullOr(S.String).pipe(T.Body("expected_body"))), expectedCodes: S.optional( S.NullOr(S.String).pipe(T.Body("expected_codes")), ), followRedirects: S.optional( S.NullOr(S.Boolean).pipe(T.Body("follow_redirects")), ), header: S.optional(S.NullOr(MonitorsListResultItemHeaderMap)), interval: S.optional(S.NullOr(S.Number)), method: S.optional(S.NullOr(S.String)), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), path: S.optional(S.NullOr(S.String)), port: S.optional(S.NullOr(S.Number)), probeZone: S.optional(S.NullOr(S.String).pipe(T.Body("probe_zone"))), retries: S.optional(S.NullOr(S.Number)), timeout: S.optional(S.NullOr(S.Number)), type: S.optional(S.NullOr(MonitorsListResultItemType)), }), ).annotate({ identifier: "MonitorsListResultItem", }) as any as S.Schema; export type MonitorsListResultList = Array; export const MonitorsListResultList = /*@__PURE__*/ S.Array( MonitorsListResultItem, ) as any as S.Schema; export interface ListMonitorsResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: MonitorsListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListMonitorsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: MonitorsListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListMonitorsResponse", }) as any as S.Schema; export interface ListPoolsRequest { /** Identifier. */ accountId: string; /** The ID of the Monitor to use for checking the health of origins within this pool. */ monitor?: string; } export const ListPoolsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), monitor: S.optional(S.String.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/load_balancers/pools", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListPoolsRequest", }) as any as S.Schema; export type PoolsListResultItemCheckRegionsItem = | "WNAM" | "ENAM" | "WEU" | "EEU" | "NSAM" | "SSAM" | "OC" | "ME" | "NAF" | "SAF" | "SAS" | "SEAS" | "NEAS" | "ALL_REGIONS"; export const PoolsListResultItemCheckRegionsItem = /*@__PURE__*/ S.String; export type PoolsListResultItemCheckRegionsList = Array; export const PoolsListResultItemCheckRegionsList = /*@__PURE__*/ S.Array( PoolsListResultItemCheckRegionsItem, ) as any as S.Schema; export type PoolsListResultItemLoadSheddingDefaultPolicy = "random" | "hash"; export const PoolsListResultItemLoadSheddingDefaultPolicy = /*@__PURE__*/ S.String; export type PoolsListResultItemLoadSheddingSessionPolicy = "hash"; export const PoolsListResultItemLoadSheddingSessionPolicy = /*@__PURE__*/ S.String; export interface PoolsListResultItemLoadShedding { /** The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity. */ defaultPercent?: number | null; /** The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs. */ defaultPolicy?: PoolsListResultItemLoadSheddingDefaultPolicy | null; /** The percent of existing sessions to shed from the pool, according to the session policy. */ sessionPercent?: number | null; /** Only the hash policy is supported for existing sessions (to avoid exponential decay). */ sessionPolicy?: PoolsListResultItemLoadSheddingSessionPolicy | null; } export const PoolsListResultItemLoadShedding = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultPercent: S.optional( S.NullOr(S.Number).pipe(T.Body("default_percent")), ), defaultPolicy: S.optional( S.NullOr(PoolsListResultItemLoadSheddingDefaultPolicy).pipe( T.Body("default_policy"), ), ), sessionPercent: S.optional( S.NullOr(S.Number).pipe(T.Body("session_percent")), ), sessionPolicy: S.optional( S.NullOr(PoolsListResultItemLoadSheddingSessionPolicy).pipe( T.Body("session_policy"), ), ), }), ).annotate({ identifier: "PoolsListResultItemLoadShedding", }) as any as S.Schema; export type PoolsListResultItemNetworksList = Array; export const PoolsListResultItemNetworksList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type PoolsListResultItemNotificationFilterOrigin = PoolsBulkEditResultItemNotificationFilterOrigin; export const PoolsListResultItemNotificationFilterOrigin = PoolsBulkEditResultItemNotificationFilterOrigin; export type PoolsListResultItemNotificationFilter = PoolsBulkEditResultItemNotificationFilter; export const PoolsListResultItemNotificationFilter = PoolsBulkEditResultItemNotificationFilter; export type PoolsListResultItemOriginSteeringPolicy = | "random" | "hash" | "least_outstanding_requests" | "least_connections"; export const PoolsListResultItemOriginSteeringPolicy = /*@__PURE__*/ S.String; export interface PoolsListResultItemOriginSteering { /** The type of origin steering policy to use. */ policy?: PoolsListResultItemOriginSteeringPolicy | null; } export const PoolsListResultItemOriginSteering = /*@__PURE__*/ S.suspend(() => S.Struct({ policy: S.optional(S.NullOr(PoolsListResultItemOriginSteeringPolicy)), }), ).annotate({ identifier: "PoolsListResultItemOriginSteering", }) as any as S.Schema; export type PoolsListResultItemOriginsItemHeaderHostList = Array; export const PoolsListResultItemOriginsItemHeaderHostList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface PoolsListResultItemOriginsItemHeader { /** The 'Host' header allows to override the hostname set in the HTTP request. Current support is 1 'Host' header override per origin. */ host?: PoolsListResultItemOriginsItemHeaderHostList | null; } export const PoolsListResultItemOriginsItemHeader = /*@__PURE__*/ S.suspend( () => S.Struct({ host: S.optional( S.NullOr(PoolsListResultItemOriginsItemHeaderHostList).pipe( T.Body("Host"), ), ), }), ).annotate({ identifier: "PoolsListResultItemOriginsItemHeader", }) as any as S.Schema; export interface PoolsListResultItemOriginsItem { /** The IP address (IPv4 or IPv6) of the origin, or its publicly addressable hostname. Hostnames entered here should resolve directly to the origin, and not be a hostname proxied by Cloudflare. To set an internal/reserved address, virtual_network_id must also be set. */ address?: string | null; /** This field shows up only if the origin is disabled. This field is set with the time the origin was disabled. */ disabledAt?: string | null; /** Whether to enable (the default) this origin within the pool. Disabled origins will not receive traffic and are excluded from health checks. The origin will only be disabled for the current pool. */ enabled?: boolean | null; /** Whether to flatten CNAME records for this origin, resolving them to A/AAAA records before returning to the client. When true (the default), the director resolves CNAME addresses to their underlying A/AAAA records. When false, the origin address is returned as a raw CNAME record without resolution. This setting mirrors the DNS API record flatten_cname setting. */ flattenCname?: boolean | null; /** The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'. */ header?: PoolsListResultItemOriginsItemHeader | null; /** A human-identifiable name for the origin. */ name?: string | null; /** The port for upstream connections. A value of 0 means the default port for the protocol will be used. */ port?: number | null; /** The virtual network subnet ID the origin belongs in. Virtual network must also belong to the account. */ virtualNetworkId?: string | null; /** The weight of this origin relative to other origins in the pool. Based on the configured weight the total traffic is distributed among origins within the pool. */ weight?: number | null; } export const PoolsListResultItemOriginsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ address: S.optional(S.NullOr(S.String)), disabledAt: S.optional(S.NullOr(S.String).pipe(T.Body("disabled_at"))), enabled: S.optional(S.NullOr(S.Boolean)), flattenCname: S.optional(S.NullOr(S.Boolean).pipe(T.Body("flatten_cname"))), header: S.optional(S.NullOr(PoolsListResultItemOriginsItemHeader)), name: S.optional(S.NullOr(S.String)), port: S.optional(S.NullOr(S.Number)), virtualNetworkId: S.optional( S.NullOr(S.String).pipe(T.Body("virtual_network_id")), ), weight: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "PoolsListResultItemOriginsItem", }) as any as S.Schema; export type PoolsListResultItemOriginsList = Array; export const PoolsListResultItemOriginsList = /*@__PURE__*/ S.Array( PoolsListResultItemOriginsItem, ) as any as S.Schema; export interface PoolsListResultItem { id?: string | null; /** A list of regions from which to run health checks. Null means every Cloudflare data center. */ checkRegions?: PoolsListResultItemCheckRegionsList | null; createdOn?: string | null; /** A human-readable description of the pool. */ description?: string | null; /** This field shows up only if the pool is disabled. This field is set with the time the pool was disabled at. */ disabledAt?: string | null; /** Whether to enable (the default) or disable this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any). */ enabled?: boolean | null; /** The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set. */ latitude?: number | null; /** Configures load shedding policies and percentages for the pool. */ loadShedding?: PoolsListResultItemLoadShedding | null; /** The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set. */ longitude?: number | null; /** The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and will failover to the next available pool. */ minimumOrigins?: number | null; modifiedOn?: string | null; /** The ID of the Monitor to use for checking the health of origins within this pool. */ monitor?: string | null; /** The ID of the Monitor Group to use for checking the health of origins within this pool. */ monitorGroup?: string | null; /** A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed. */ name?: string | null; /** List of networks where Load Balancer or Pool is enabled. */ networks?: PoolsListResultItemNetworksList | null; /** This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address to send health status notifications to. This can be an individual mailbox or a mailing list. Multiple emails can be supplied as a comma delimited list. */ notificationEmail?: string | null; /** Filter pool and origin health notifications by resource type or health status. Use null to reset. */ notificationFilter?: PoolsBulkEditResultItemNotificationFilter | null; /** Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity. */ originSteering?: PoolsListResultItemOriginSteering | null; /** The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. */ origins?: PoolsListResultItemOriginsList | null; } export const PoolsListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), checkRegions: S.optional( S.NullOr(PoolsListResultItemCheckRegionsList).pipe( T.Body("check_regions"), ), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), description: S.optional(S.NullOr(S.String)), disabledAt: S.optional(S.NullOr(S.String).pipe(T.Body("disabled_at"))), enabled: S.optional(S.NullOr(S.Boolean)), latitude: S.optional(S.NullOr(S.Number)), loadShedding: S.optional( S.NullOr(PoolsListResultItemLoadShedding).pipe(T.Body("load_shedding")), ), longitude: S.optional(S.NullOr(S.Number)), minimumOrigins: S.optional( S.NullOr(S.Number).pipe(T.Body("minimum_origins")), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), monitor: S.optional(S.NullOr(S.String)), monitorGroup: S.optional(S.NullOr(S.String).pipe(T.Body("monitor_group"))), name: S.optional(S.NullOr(S.String)), networks: S.optional(S.NullOr(PoolsListResultItemNetworksList)), notificationEmail: S.optional( S.NullOr(S.String).pipe(T.Body("notification_email")), ), notificationFilter: S.optional( S.NullOr(PoolsBulkEditResultItemNotificationFilter).pipe( T.Body("notification_filter"), ), ), originSteering: S.optional( S.NullOr(PoolsListResultItemOriginSteering).pipe( T.Body("origin_steering"), ), ), origins: S.optional(S.NullOr(PoolsListResultItemOriginsList)), }), ).annotate({ identifier: "PoolsListResultItem", }) as any as S.Schema; export type PoolsListResultList = Array; export const PoolsListResultList = /*@__PURE__*/ S.Array( PoolsListResultItem, ) as any as S.Schema; export interface ListPoolsResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: PoolsListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListPoolsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: PoolsListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListPoolsResponse", }) as any as S.Schema; export interface ListRegionsRequest { /** Identifier. */ accountId: string; /** Two-letter alpha-2 country code followed in ISO 3166-1. */ countryCodeA2?: string; /** Two-letter subdivision code followed in ISO 3166-2. */ subdivisionCode?: string; /** Two-letter subdivision code followed in ISO 3166-2. */ subdivisionCodeA2?: string; } export const ListRegionsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), countryCodeA2: S.optional(S.String.pipe(T.Query("country_code_a2"))), subdivisionCode: S.optional(S.String.pipe(T.Query("subdivision_code"))), subdivisionCodeA2: S.optional( S.String.pipe(T.Query("subdivision_code_a2")), ), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/load_balancers/regions", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListRegionsRequest", }) as any as S.Schema; export type ListRegionsResponse = unknown; export const ListRegionsResponse = /*@__PURE__*/ S.suspend(() => S.Unknown.pipe(T.EnvelopePayloadRoot(), T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListRegionsResponse", }) as any as S.Schema; export type SearchesListRequestReferences = "" | "*" | "referral" | "referrer"; export const SearchesListRequestReferences = /*@__PURE__*/ S.String; export interface ListSearchesRequest { /** Identifier. */ accountId: string; page?: number; perPage?: number; /** Search query term. */ query?: string; /** The type of references to include. "*" to include both referral and referrer references. "" to not include any reference information. */ references?: SearchesListRequestReferences | (string & {}); } export const ListSearchesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), query: S.optional(S.String.pipe(T.Query())), references: S.optional(SearchesListRequestReferences.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/load_balancers/search", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListSearchesRequest", }) as any as S.Schema; export type SearchesListResponseResourcesItemReferenceType = | "referral" | "referrer"; export const SearchesListResponseResourcesItemReferenceType = /*@__PURE__*/ S.String; export type SearchesListResponseResourcesItemReferencesList = Array; export const SearchesListResponseResourcesItemReferencesList = /*@__PURE__*/ S.Array( S.Unknown, ) as any as S.Schema; export type SearchesListResponseResourcesItemResourceType = | "load_balancer" | "monitor" | "pool"; export const SearchesListResponseResourcesItemResourceType = /*@__PURE__*/ S.String; export interface SearchesListResponseResourcesItem { /** When listed as a reference, the type (direction) of the reference. */ referenceType?: SearchesListResponseResourcesItemReferenceType | null; /** A list of references to (referrer) or from (referral) this resource. */ references?: SearchesListResponseResourcesItemReferencesList | null; resourceId?: string | null; /** The human-identifiable name of the resource. */ resourceName?: string | null; /** The type of the resource. */ resourceType?: SearchesListResponseResourcesItemResourceType | null; } export const SearchesListResponseResourcesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ referenceType: S.optional( S.NullOr(SearchesListResponseResourcesItemReferenceType).pipe( T.Body("reference_type"), ), ), references: S.optional( S.NullOr(SearchesListResponseResourcesItemReferencesList), ), resourceId: S.optional(S.NullOr(S.String).pipe(T.Body("resource_id"))), resourceName: S.optional(S.NullOr(S.String).pipe(T.Body("resource_name"))), resourceType: S.optional( S.NullOr(SearchesListResponseResourcesItemResourceType).pipe( T.Body("resource_type"), ), ), }), ).annotate({ identifier: "SearchesListResponseResourcesItem", }) as any as S.Schema; export type SearchesListResponseResourcesList = Array; export const SearchesListResponseResourcesList = /*@__PURE__*/ S.Array( SearchesListResponseResourcesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface ListSearchesResponse { /** A list of resources matching the search query. */ resources?: SearchesListResponseResourcesList | null; } export const ListSearchesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ resources: S.optional(S.NullOr(SearchesListResponseResourcesList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListSearchesResponse", }) as any as S.Schema; export type EditRequestAdaptiveRouting = CreateRequestAdaptiveRouting; export const EditRequestAdaptiveRouting = CreateRequestAdaptiveRouting; export type EditRequestCountryPoolsMap = { [key: string]: unknown | undefined }; export const EditRequestCountryPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type EditRequestDefaultPoolsList = Array; export const EditRequestDefaultPoolsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type EditRequestLocationStrategyMode = "pop" | "resolver_ip"; export const EditRequestLocationStrategyMode = /*@__PURE__*/ S.String; export type EditRequestLocationStrategyPreferEcs = | "always" | "never" | "proximity" | "geo"; export const EditRequestLocationStrategyPreferEcs = /*@__PURE__*/ S.String; export interface EditRequestLocationStrategy { /** Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful. */ mode?: EditRequestLocationStrategyMode | (string & {}); /** Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location. */ preferEcs?: EditRequestLocationStrategyPreferEcs | (string & {}); } export const EditRequestLocationStrategy = /*@__PURE__*/ S.suspend(() => S.Struct({ mode: S.optional(EditRequestLocationStrategyMode), preferEcs: S.optional( EditRequestLocationStrategyPreferEcs.pipe(T.Body("prefer_ecs")), ), }), ).annotate({ identifier: "EditRequestLocationStrategy", }) as any as S.Schema; export type EditRequestPopPoolsMap = { [key: string]: unknown | undefined }; export const EditRequestPopPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type EditRequestRandomSteeringPoolWeightsMap = { [key: string]: number | undefined; }; export const EditRequestRandomSteeringPoolWeightsMap = /*@__PURE__*/ S.Record( S.String, S.Number, ) as any as S.Schema; export interface EditRequestRandomSteering { /** The default weight for pools in the load balancer that are not specified in the pool_weights map. */ defaultWeight?: number; /** A mapping of pool IDs to custom weights. The weight is relative to other pools in the load balancer. */ poolWeights?: EditRequestRandomSteeringPoolWeightsMap; } export const EditRequestRandomSteering = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultWeight: S.optional(S.Number.pipe(T.Body("default_weight"))), poolWeights: S.optional( EditRequestRandomSteeringPoolWeightsMap.pipe(T.Body("pool_weights")), ), }), ).annotate({ identifier: "EditRequestRandomSteering", }) as any as S.Schema; export type EditRequestRegionPoolsMap = { [key: string]: unknown | undefined }; export const EditRequestRegionPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type EditRequestRulesItemFixedResponse = CreateRequestRulesItemFixedResponse; export const EditRequestRulesItemFixedResponse = CreateRequestRulesItemFixedResponse; export type EditRequestRulesItemOverridesCountryPoolsMap = { [key: string]: unknown | undefined; }; export const EditRequestRulesItemOverridesCountryPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type EditRequestRulesItemOverridesDefaultPoolsList = Array; export const EditRequestRulesItemOverridesDefaultPoolsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type EditRequestRulesItemOverridesPopPoolsMap = { [key: string]: unknown | undefined; }; export const EditRequestRulesItemOverridesPopPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type EditRequestRulesItemOverridesRegionPoolsMap = { [key: string]: unknown | undefined; }; export const EditRequestRulesItemOverridesRegionPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type EditRequestRulesItemOverridesSessionAffinity = | "none" | "cookie" | "ip_cookie" | "header"; export const EditRequestRulesItemOverridesSessionAffinity = /*@__PURE__*/ S.String; export type EditRequestRulesItemOverridesSessionAffinityAttributesHeadersList = Array; export const EditRequestRulesItemOverridesSessionAffinityAttributesHeadersList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type EditRequestRulesItemOverridesSessionAffinityAttributesSamesite = | "Auto" | "Lax" | "None" | "Strict"; export const EditRequestRulesItemOverridesSessionAffinityAttributesSamesite = /*@__PURE__*/ S.String; export type EditRequestRulesItemOverridesSessionAffinityAttributesSecure = | "Auto" | "Always" | "Never"; export const EditRequestRulesItemOverridesSessionAffinityAttributesSecure = /*@__PURE__*/ S.String; export type EditRequestRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover = | "none" | "temporary" | "sticky"; export const EditRequestRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover = /*@__PURE__*/ S.String; export interface EditRequestRulesItemOverridesSessionAffinityAttributes { /** Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer. */ drainDuration?: number; /** Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:,"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans. */ headers?: EditRequestRulesItemOverridesSessionAffinityAttributesHeadersList; /** When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren't created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren't created. */ requireAllHeaders?: boolean; /** Configures the SameSite attribute on session affinity cookie. Value "Auto" will be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: when using value "None", the secure attribute can not be set to "Never". */ samesite?: | EditRequestRulesItemOverridesSessionAffinityAttributesSamesite | (string & {}); /** Configures the Secure attribute on session affinity cookie. Value "Always" indicates the Secure attribute will be set in the Set-Cookie header, "Never" indicates the Secure attribute will not be set, and "Auto" will set the Secure attribute depending if Always Use HTTPS is enabled. */ secure?: | EditRequestRulesItemOverridesSessionAffinityAttributesSecure | (string & {}); /** Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are: - `"none"`: No failover takes place for sessions pinned to the origin (default). - `"temporary"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. - `"sticky"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header. */ zeroDowntimeFailover?: | EditRequestRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover | (string & {}); } export const EditRequestRulesItemOverridesSessionAffinityAttributes = /*@__PURE__*/ S.suspend(() => S.Struct({ drainDuration: S.optional(S.Number.pipe(T.Body("drain_duration"))), headers: S.optional( EditRequestRulesItemOverridesSessionAffinityAttributesHeadersList, ), requireAllHeaders: S.optional( S.Boolean.pipe(T.Body("require_all_headers")), ), samesite: S.optional( EditRequestRulesItemOverridesSessionAffinityAttributesSamesite, ), secure: S.optional( EditRequestRulesItemOverridesSessionAffinityAttributesSecure, ), zeroDowntimeFailover: S.optional( EditRequestRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover.pipe( T.Body("zero_downtime_failover"), ), ), }), ).annotate({ identifier: "EditRequestRulesItemOverridesSessionAffinityAttributes", }) as any as S.Schema; export type EditRequestRulesItemOverridesSteeringPolicy = | "off" | "geo" | "random" | "dynamic_latency" | "proximity" | "least_outstanding_requests" | "least_connections" | ""; export const EditRequestRulesItemOverridesSteeringPolicy = /*@__PURE__*/ S.String; export interface EditRequestRulesItemOverrides { /** Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin. */ adaptiveRouting?: CreateRequestAdaptiveRouting; /** A mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools. */ countryPools?: EditRequestRulesItemOverridesCountryPoolsMap; /** A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region. */ defaultPools?: EditRequestRulesItemOverridesDefaultPoolsList; /** The pool ID to use when all other pools are detected as unhealthy. */ fallbackPool?: string; /** Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected. */ locationStrategy?: EditRequestLocationStrategy; /** Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. */ popPools?: EditRequestRulesItemOverridesPopPoolsMap; /** Configures pool weights. */ randomSteering?: EditRequestRandomSteering; /** A mapping of region codes to a list of pool IDs (ordered by their failover priority) for the given region. Any regions not explicitly defined will fall back to using default_pools. */ regionPools?: EditRequestRulesItemOverridesRegionPoolsMap; /** Specifies the type of session affinity the load balancer should use unless specified as `"none"`. 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. */ sessionAffinity?: | EditRequestRulesItemOverridesSessionAffinity | (string & {}); /** Configures attributes for session affinity. */ sessionAffinityAttributes?: EditRequestRulesItemOverridesSessionAffinityAttributes; /** Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven't been used for the number of seconds specified. */ sessionAffinityTtl?: number; /** Steering Policy for this load balancer. */ steeringPolicy?: EditRequestRulesItemOverridesSteeringPolicy | (string & {}); /** Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers. */ ttl?: number; } export const EditRequestRulesItemOverrides = /*@__PURE__*/ S.suspend(() => S.Struct({ adaptiveRouting: S.optional( CreateRequestAdaptiveRouting.pipe(T.Body("adaptive_routing")), ), countryPools: S.optional( EditRequestRulesItemOverridesCountryPoolsMap.pipe( T.Body("country_pools"), ), ), defaultPools: S.optional( EditRequestRulesItemOverridesDefaultPoolsList.pipe( T.Body("default_pools"), ), ), fallbackPool: S.optional(S.String.pipe(T.Body("fallback_pool"))), locationStrategy: S.optional( EditRequestLocationStrategy.pipe(T.Body("location_strategy")), ), popPools: S.optional( EditRequestRulesItemOverridesPopPoolsMap.pipe(T.Body("pop_pools")), ), randomSteering: S.optional( EditRequestRandomSteering.pipe(T.Body("random_steering")), ), regionPools: S.optional( EditRequestRulesItemOverridesRegionPoolsMap.pipe(T.Body("region_pools")), ), sessionAffinity: S.optional( EditRequestRulesItemOverridesSessionAffinity.pipe( T.Body("session_affinity"), ), ), sessionAffinityAttributes: S.optional( EditRequestRulesItemOverridesSessionAffinityAttributes.pipe( T.Body("session_affinity_attributes"), ), ), sessionAffinityTtl: S.optional( S.Number.pipe(T.Body("session_affinity_ttl")), ), steeringPolicy: S.optional( EditRequestRulesItemOverridesSteeringPolicy.pipe( T.Body("steering_policy"), ), ), ttl: S.optional(S.Number), }), ).annotate({ identifier: "EditRequestRulesItemOverrides", }) as any as S.Schema; export interface EditRequestRulesItem { /** The condition expressions to evaluate. If the condition evaluates to true, the overrides or fixed_response in this rule will be applied. An empty condition is always true. For more details on condition expressions, please see https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions. */ condition?: string; /** Disable this specific rule. It will no longer be evaluated by this load balancer. */ disabled?: boolean; /** A collection of fields used to directly respond to the eyeball instead of routing to a pool. If a fixed_response is supplied the rule will be marked as terminates. */ fixedResponse?: CreateRequestRulesItemFixedResponse; /** Name of this rule. Only used for human readability. */ name?: string; /** A collection of overrides to apply to the load balancer when this rule's condition is true. All fields are optional. */ overrides?: EditRequestRulesItemOverrides; /** The order in which rules should be executed in relation to each other. Lower values are executed first. Values do not need to be sequential. If no value is provided for any rule the array order of the rules field will be used to assign a priority. */ priority?: number; /** If this rule's condition is true, this causes rule evaluation to stop after processing this rule. */ terminates?: boolean; } export const EditRequestRulesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ condition: S.optional(S.String), disabled: S.optional(S.Boolean), fixedResponse: S.optional( CreateRequestRulesItemFixedResponse.pipe(T.Body("fixed_response")), ), name: S.optional(S.String), overrides: S.optional(EditRequestRulesItemOverrides), priority: S.optional(S.Number), terminates: S.optional(S.Boolean), }), ).annotate({ identifier: "EditRequestRulesItem", }) as any as S.Schema; export type EditRequestRulesList = Array; export const EditRequestRulesList = /*@__PURE__*/ S.Array( EditRequestRulesItem, ) as any as S.Schema; export interface PatchLoadBalancerRequest { zoneId: string; loadBalancerId: string; /** Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin. */ adaptiveRouting?: CreateRequestAdaptiveRouting; /** A mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools. */ countryPools?: EditRequestCountryPoolsMap; /** A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region. */ defaultPools?: EditRequestDefaultPoolsList; /** Object description. */ description?: string; /** Whether to enable (the default) this load balancer. */ enabled?: boolean; /** The pool ID to use when all other pools are detected as unhealthy. */ fallbackPool?: string; /** Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected. */ locationStrategy?: EditRequestLocationStrategy; /** The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used. */ name?: string; /** Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. */ popPools?: EditRequestPopPoolsMap; /** Whether the hostname should be gray clouded (false) or orange clouded (true). */ proxied?: boolean; /** Configures pool weights. */ randomSteering?: EditRequestRandomSteering; /** A mapping of region codes to a list of pool IDs (ordered by their failover priority) for the given region. Any regions not explicitly defined will fall back to using default_pools. */ regionPools?: EditRequestRegionPoolsMap; /** BETA Field Not General Access: A list of rules for this load balancer to execute. */ rules?: EditRequestRulesList; /** Specifies the type of session affinity the load balancer should use unless specified as `"none"`. 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. */ sessionAffinity?: | EditRequestRulesItemOverridesSessionAffinity | (string & {}); /** Configures attributes for session affinity. */ sessionAffinityAttributes?: EditRequestRulesItemOverridesSessionAffinityAttributes; /** Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven't been used for the number of seconds specified. */ sessionAffinityTtl?: number; /** Steering Policy for this load balancer. */ steeringPolicy?: EditRequestRulesItemOverridesSteeringPolicy | (string & {}); /** Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers. */ ttl?: number; } export const PatchLoadBalancerRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), loadBalancerId: S.String.pipe(T.Label("load_balancer_id")), adaptiveRouting: S.optional( CreateRequestAdaptiveRouting.pipe(T.Body("adaptive_routing")), ), countryPools: S.optional( EditRequestCountryPoolsMap.pipe(T.Body("country_pools")), ), defaultPools: S.optional( EditRequestDefaultPoolsList.pipe(T.Body("default_pools")), ), description: S.optional(S.String), enabled: S.optional(S.Boolean), fallbackPool: S.optional(S.String.pipe(T.Body("fallback_pool"))), locationStrategy: S.optional( EditRequestLocationStrategy.pipe(T.Body("location_strategy")), ), name: S.optional(S.String), popPools: S.optional(EditRequestPopPoolsMap.pipe(T.Body("pop_pools"))), proxied: S.optional(S.Boolean), randomSteering: S.optional( EditRequestRandomSteering.pipe(T.Body("random_steering")), ), regionPools: S.optional( EditRequestRegionPoolsMap.pipe(T.Body("region_pools")), ), rules: S.optional(EditRequestRulesList), sessionAffinity: S.optional( EditRequestRulesItemOverridesSessionAffinity.pipe( T.Body("session_affinity"), ), ), sessionAffinityAttributes: S.optional( EditRequestRulesItemOverridesSessionAffinityAttributes.pipe( T.Body("session_affinity_attributes"), ), ), sessionAffinityTtl: S.optional( S.Number.pipe(T.Body("session_affinity_ttl")), ), steeringPolicy: S.optional( EditRequestRulesItemOverridesSteeringPolicy.pipe( T.Body("steering_policy"), ), ), ttl: S.optional(S.Number), }) .pipe( T.Http({ method: "PATCH", uri: "/zones/{zone_id}/load_balancers/{load_balancer_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchLoadBalancerRequest", }) as any as S.Schema; export type EditResponseAdaptiveRouting = CreateResponseAdaptiveRouting; export const EditResponseAdaptiveRouting = CreateResponseAdaptiveRouting; export type EditResponseCountryPoolsMap = { [key: string]: unknown | undefined; }; export const EditResponseCountryPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type EditResponseDefaultPoolsList = Array; export const EditResponseDefaultPoolsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type EditResponseLocationStrategyMode = "pop" | "resolver_ip"; export const EditResponseLocationStrategyMode = /*@__PURE__*/ S.String; export type EditResponseLocationStrategyPreferEcs = | "always" | "never" | "proximity" | "geo"; export const EditResponseLocationStrategyPreferEcs = /*@__PURE__*/ S.String; export interface EditResponseLocationStrategy { /** Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful. */ mode?: EditResponseLocationStrategyMode | null; /** Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location. */ preferEcs?: EditResponseLocationStrategyPreferEcs | null; } export const EditResponseLocationStrategy = /*@__PURE__*/ S.suspend(() => S.Struct({ mode: S.optional(S.NullOr(EditResponseLocationStrategyMode)), preferEcs: S.optional( S.NullOr(EditResponseLocationStrategyPreferEcs).pipe( T.Body("prefer_ecs"), ), ), }), ).annotate({ identifier: "EditResponseLocationStrategy", }) as any as S.Schema; export type EditResponseNetworksList = Array; export const EditResponseNetworksList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type EditResponsePopPoolsMap = { [key: string]: unknown | undefined }; export const EditResponsePopPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type EditResponseRandomSteeringPoolWeightsMap = { [key: string]: number | undefined; }; export const EditResponseRandomSteeringPoolWeightsMap = /*@__PURE__*/ S.Record( S.String, S.Number, ) as any as S.Schema; export interface EditResponseRandomSteering { /** The default weight for pools in the load balancer that are not specified in the pool_weights map. */ defaultWeight?: number | null; /** A mapping of pool IDs to custom weights. The weight is relative to other pools in the load balancer. */ poolWeights?: EditResponseRandomSteeringPoolWeightsMap | null; } export const EditResponseRandomSteering = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultWeight: S.optional( S.NullOr(S.Number).pipe(T.Body("default_weight")), ), poolWeights: S.optional( S.NullOr(EditResponseRandomSteeringPoolWeightsMap).pipe( T.Body("pool_weights"), ), ), }), ).annotate({ identifier: "EditResponseRandomSteering", }) as any as S.Schema; export type EditResponseRegionPoolsMap = { [key: string]: unknown | undefined }; export const EditResponseRegionPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type EditResponseRulesItemFixedResponse = CreateResponseRulesItemFixedResponse; export const EditResponseRulesItemFixedResponse = CreateResponseRulesItemFixedResponse; export type EditResponseRulesItemOverridesCountryPoolsMap = { [key: string]: unknown | undefined; }; export const EditResponseRulesItemOverridesCountryPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type EditResponseRulesItemOverridesDefaultPoolsList = Array; export const EditResponseRulesItemOverridesDefaultPoolsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type EditResponseRulesItemOverridesPopPoolsMap = { [key: string]: unknown | undefined; }; export const EditResponseRulesItemOverridesPopPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type EditResponseRulesItemOverridesRegionPoolsMap = { [key: string]: unknown | undefined; }; export const EditResponseRulesItemOverridesRegionPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type EditResponseRulesItemOverridesSessionAffinity = | "none" | "cookie" | "ip_cookie" | "header"; export const EditResponseRulesItemOverridesSessionAffinity = /*@__PURE__*/ S.String; export type EditResponseRulesItemOverridesSessionAffinityAttributesHeadersList = Array; export const EditResponseRulesItemOverridesSessionAffinityAttributesHeadersList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type EditResponseRulesItemOverridesSessionAffinityAttributesSamesite = | "Auto" | "Lax" | "None" | "Strict"; export const EditResponseRulesItemOverridesSessionAffinityAttributesSamesite = /*@__PURE__*/ S.String; export type EditResponseRulesItemOverridesSessionAffinityAttributesSecure = | "Auto" | "Always" | "Never"; export const EditResponseRulesItemOverridesSessionAffinityAttributesSecure = /*@__PURE__*/ S.String; export type EditResponseRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover = | "none" | "temporary" | "sticky"; export const EditResponseRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover = /*@__PURE__*/ S.String; export interface EditResponseRulesItemOverridesSessionAffinityAttributes { /** Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer. */ drainDuration?: number | null; /** Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:,"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans. */ headers?: EditResponseRulesItemOverridesSessionAffinityAttributesHeadersList | null; /** When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren't created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren't created. */ requireAllHeaders?: boolean | null; /** Configures the SameSite attribute on session affinity cookie. Value "Auto" will be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: when using value "None", the secure attribute can not be set to "Never". */ samesite?: EditResponseRulesItemOverridesSessionAffinityAttributesSamesite | null; /** Configures the Secure attribute on session affinity cookie. Value "Always" indicates the Secure attribute will be set in the Set-Cookie header, "Never" indicates the Secure attribute will not be set, and "Auto" will set the Secure attribute depending if Always Use HTTPS is enabled. */ secure?: EditResponseRulesItemOverridesSessionAffinityAttributesSecure | null; /** Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are: - `"none"`: No failover takes place for sessions pinned to the origin (default). - `"temporary"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. - `"sticky"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header. */ zeroDowntimeFailover?: EditResponseRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover | null; } export const EditResponseRulesItemOverridesSessionAffinityAttributes = /*@__PURE__*/ S.suspend(() => S.Struct({ drainDuration: S.optional( S.NullOr(S.Number).pipe(T.Body("drain_duration")), ), headers: S.optional( S.NullOr( EditResponseRulesItemOverridesSessionAffinityAttributesHeadersList, ), ), requireAllHeaders: S.optional( S.NullOr(S.Boolean).pipe(T.Body("require_all_headers")), ), samesite: S.optional( S.NullOr( EditResponseRulesItemOverridesSessionAffinityAttributesSamesite, ), ), secure: S.optional( S.NullOr(EditResponseRulesItemOverridesSessionAffinityAttributesSecure), ), zeroDowntimeFailover: S.optional( S.NullOr( EditResponseRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover, ).pipe(T.Body("zero_downtime_failover")), ), }), ).annotate({ identifier: "EditResponseRulesItemOverridesSessionAffinityAttributes", }) as any as S.Schema; export type EditResponseRulesItemOverridesSteeringPolicy = | "off" | "geo" | "random" | "dynamic_latency" | "proximity" | "least_outstanding_requests" | "least_connections" | ""; export const EditResponseRulesItemOverridesSteeringPolicy = /*@__PURE__*/ S.String; export interface EditResponseRulesItemOverrides { /** Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin. */ adaptiveRouting?: CreateResponseAdaptiveRouting | null; /** A mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools. */ countryPools?: EditResponseRulesItemOverridesCountryPoolsMap | null; /** A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region. */ defaultPools?: EditResponseRulesItemOverridesDefaultPoolsList | null; /** The pool ID to use when all other pools are detected as unhealthy. */ fallbackPool?: string | null; /** Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected. */ locationStrategy?: EditResponseLocationStrategy | null; /** Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. */ popPools?: EditResponseRulesItemOverridesPopPoolsMap | null; /** Configures pool weights. */ randomSteering?: EditResponseRandomSteering | null; /** A mapping of region codes to a list of pool IDs (ordered by their failover priority) for the given region. Any regions not explicitly defined will fall back to using default_pools. */ regionPools?: EditResponseRulesItemOverridesRegionPoolsMap | null; /** Specifies the type of session affinity the load balancer should use unless specified as `"none"`. 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. */ sessionAffinity?: EditResponseRulesItemOverridesSessionAffinity | null; /** Configures attributes for session affinity. */ sessionAffinityAttributes?: EditResponseRulesItemOverridesSessionAffinityAttributes | null; /** Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven't been used for the number of seconds specified. */ sessionAffinityTtl?: number | null; /** Steering Policy for this load balancer. */ steeringPolicy?: EditResponseRulesItemOverridesSteeringPolicy | null; /** Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers. */ ttl?: number | null; } export const EditResponseRulesItemOverrides = /*@__PURE__*/ S.suspend(() => S.Struct({ adaptiveRouting: S.optional( S.NullOr(CreateResponseAdaptiveRouting).pipe(T.Body("adaptive_routing")), ), countryPools: S.optional( S.NullOr(EditResponseRulesItemOverridesCountryPoolsMap).pipe( T.Body("country_pools"), ), ), defaultPools: S.optional( S.NullOr(EditResponseRulesItemOverridesDefaultPoolsList).pipe( T.Body("default_pools"), ), ), fallbackPool: S.optional(S.NullOr(S.String).pipe(T.Body("fallback_pool"))), locationStrategy: S.optional( S.NullOr(EditResponseLocationStrategy).pipe(T.Body("location_strategy")), ), popPools: S.optional( S.NullOr(EditResponseRulesItemOverridesPopPoolsMap).pipe( T.Body("pop_pools"), ), ), randomSteering: S.optional( S.NullOr(EditResponseRandomSteering).pipe(T.Body("random_steering")), ), regionPools: S.optional( S.NullOr(EditResponseRulesItemOverridesRegionPoolsMap).pipe( T.Body("region_pools"), ), ), sessionAffinity: S.optional( S.NullOr(EditResponseRulesItemOverridesSessionAffinity).pipe( T.Body("session_affinity"), ), ), sessionAffinityAttributes: S.optional( S.NullOr(EditResponseRulesItemOverridesSessionAffinityAttributes).pipe( T.Body("session_affinity_attributes"), ), ), sessionAffinityTtl: S.optional( S.NullOr(S.Number).pipe(T.Body("session_affinity_ttl")), ), steeringPolicy: S.optional( S.NullOr(EditResponseRulesItemOverridesSteeringPolicy).pipe( T.Body("steering_policy"), ), ), ttl: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "EditResponseRulesItemOverrides", }) as any as S.Schema; export interface EditResponseRulesItem { /** The condition expressions to evaluate. If the condition evaluates to true, the overrides or fixed_response in this rule will be applied. An empty condition is always true. For more details on condition expressions, please see https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions. */ condition?: string | null; /** Disable this specific rule. It will no longer be evaluated by this load balancer. */ disabled?: boolean | null; /** A collection of fields used to directly respond to the eyeball instead of routing to a pool. If a fixed_response is supplied the rule will be marked as terminates. */ fixedResponse?: CreateResponseRulesItemFixedResponse | null; /** Name of this rule. Only used for human readability. */ name?: string | null; /** A collection of overrides to apply to the load balancer when this rule's condition is true. All fields are optional. */ overrides?: EditResponseRulesItemOverrides | null; /** The order in which rules should be executed in relation to each other. Lower values are executed first. Values do not need to be sequential. If no value is provided for any rule the array order of the rules field will be used to assign a priority. */ priority?: number | null; /** If this rule's condition is true, this causes rule evaluation to stop after processing this rule. */ terminates?: boolean | null; } export const EditResponseRulesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ condition: S.optional(S.NullOr(S.String)), disabled: S.optional(S.NullOr(S.Boolean)), fixedResponse: S.optional( S.NullOr(CreateResponseRulesItemFixedResponse).pipe( T.Body("fixed_response"), ), ), name: S.optional(S.NullOr(S.String)), overrides: S.optional(S.NullOr(EditResponseRulesItemOverrides)), priority: S.optional(S.NullOr(S.Number)), terminates: S.optional(S.NullOr(S.Boolean)), }), ).annotate({ identifier: "EditResponseRulesItem", }) as any as S.Schema; export type EditResponseRulesList = Array; export const EditResponseRulesList = /*@__PURE__*/ S.Array( EditResponseRulesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PatchLoadBalancerResponse { id?: string | null; /** Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin. */ adaptiveRouting?: CreateResponseAdaptiveRouting | null; /** A mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools. */ countryPools?: EditResponseCountryPoolsMap | null; createdOn?: string | null; /** A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region. */ defaultPools?: EditResponseDefaultPoolsList | null; /** Object description. */ description?: string | null; /** Whether to enable (the default) this load balancer. */ enabled?: boolean | null; /** The pool ID to use when all other pools are detected as unhealthy. */ fallbackPool?: string | null; /** Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected. */ locationStrategy?: EditResponseLocationStrategy | null; modifiedOn?: string | null; /** The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used. */ name?: string | null; /** List of networks where Load Balancer or Pool is enabled. */ networks?: EditResponseNetworksList | null; /** Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. */ popPools?: EditResponsePopPoolsMap | null; /** Whether the hostname should be gray clouded (false) or orange clouded (true). */ proxied?: boolean | null; /** Configures pool weights. */ randomSteering?: EditResponseRandomSteering | null; /** A mapping of region codes to a list of pool IDs (ordered by their failover priority) for the given region. Any regions not explicitly defined will fall back to using default_pools. */ regionPools?: EditResponseRegionPoolsMap | null; /** BETA Field Not General Access: A list of rules for this load balancer to execute. */ rules?: EditResponseRulesList | null; /** Specifies the type of session affinity the load balancer should use unless specified as `"none"`. 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. */ sessionAffinity?: EditResponseRulesItemOverridesSessionAffinity | null; /** Configures attributes for session affinity. */ sessionAffinityAttributes?: EditResponseRulesItemOverridesSessionAffinityAttributes | null; /** Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven't been used for the number of seconds specified. */ sessionAffinityTtl?: number | null; /** Steering Policy for this load balancer. */ steeringPolicy?: EditResponseRulesItemOverridesSteeringPolicy | null; /** Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers. */ ttl?: number | null; zoneName?: string | null; } export const PatchLoadBalancerResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), adaptiveRouting: S.optional( S.NullOr(CreateResponseAdaptiveRouting).pipe(T.Body("adaptive_routing")), ), countryPools: S.optional( S.NullOr(EditResponseCountryPoolsMap).pipe(T.Body("country_pools")), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), defaultPools: S.optional( S.NullOr(EditResponseDefaultPoolsList).pipe(T.Body("default_pools")), ), description: S.optional(S.NullOr(S.String)), enabled: S.optional(S.NullOr(S.Boolean)), fallbackPool: S.optional(S.NullOr(S.String).pipe(T.Body("fallback_pool"))), locationStrategy: S.optional( S.NullOr(EditResponseLocationStrategy).pipe(T.Body("location_strategy")), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), networks: S.optional(S.NullOr(EditResponseNetworksList)), popPools: S.optional( S.NullOr(EditResponsePopPoolsMap).pipe(T.Body("pop_pools")), ), proxied: S.optional(S.NullOr(S.Boolean)), randomSteering: S.optional( S.NullOr(EditResponseRandomSteering).pipe(T.Body("random_steering")), ), regionPools: S.optional( S.NullOr(EditResponseRegionPoolsMap).pipe(T.Body("region_pools")), ), rules: S.optional(S.NullOr(EditResponseRulesList)), sessionAffinity: S.optional( S.NullOr(EditResponseRulesItemOverridesSessionAffinity).pipe( T.Body("session_affinity"), ), ), sessionAffinityAttributes: S.optional( S.NullOr(EditResponseRulesItemOverridesSessionAffinityAttributes).pipe( T.Body("session_affinity_attributes"), ), ), sessionAffinityTtl: S.optional( S.NullOr(S.Number).pipe(T.Body("session_affinity_ttl")), ), steeringPolicy: S.optional( S.NullOr(EditResponseRulesItemOverridesSteeringPolicy).pipe( T.Body("steering_policy"), ), ), ttl: S.optional(S.NullOr(S.Number)), zoneName: S.optional(S.NullOr(S.String).pipe(T.Body("zone_name"))), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchLoadBalancerResponse", }) as any as S.Schema; export type MonitorsEditRequestHeaderMap = { [key: string]: unknown | undefined; }; export const MonitorsEditRequestHeaderMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type MonitorsEditRequestType = | "http" | "https" | "tcp" | "udp_icmp" | "icmp_ping" | "smtp"; export const MonitorsEditRequestType = /*@__PURE__*/ S.String; export interface PatchMonitorRequest { /** Identifier. */ accountId: string; monitorId: string; /** Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. */ allowInsecure?: boolean; /** To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times. */ consecutiveDown?: number; /** To be marked healthy the monitored origin must pass this healthcheck N consecutive times. */ consecutiveUp?: number; /** Object description. */ description?: string; /** A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors. */ expectedBody?: string; /** The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors. */ expectedCodes?: string; /** Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors. */ followRedirects?: boolean; /** The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors. */ header?: MonitorsEditRequestHeaderMap; /** The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations. */ interval?: number; /** The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks. */ method?: string; /** The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors. */ path?: string; /** The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443). */ port?: number; /** Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors. */ probeZone?: string; /** The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. */ retries?: number; /** The timeout (in seconds) before marking the health check as failed. */ timeout?: number; /** The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. */ type?: MonitorsEditRequestType | (string & {}); } export const PatchMonitorRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), monitorId: S.String.pipe(T.Label("monitor_id")), allowInsecure: S.optional(S.Boolean.pipe(T.Body("allow_insecure"))), consecutiveDown: S.optional(S.Number.pipe(T.Body("consecutive_down"))), consecutiveUp: S.optional(S.Number.pipe(T.Body("consecutive_up"))), description: S.optional(S.String), expectedBody: S.optional(S.String.pipe(T.Body("expected_body"))), expectedCodes: S.optional(S.String.pipe(T.Body("expected_codes"))), followRedirects: S.optional(S.Boolean.pipe(T.Body("follow_redirects"))), header: S.optional(MonitorsEditRequestHeaderMap), interval: S.optional(S.Number), method: S.optional(S.String), path: S.optional(S.String), port: S.optional(S.Number), probeZone: S.optional(S.String.pipe(T.Body("probe_zone"))), retries: S.optional(S.Number), timeout: S.optional(S.Number), type: S.optional(MonitorsEditRequestType), }) .pipe( T.Http({ method: "PATCH", uri: "/accounts/{account_id}/load_balancers/monitors/{monitor_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchMonitorRequest", }) as any as S.Schema; export type MonitorsEditResponseHeaderMap = { [key: string]: unknown | undefined; }; export const MonitorsEditResponseHeaderMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type MonitorsEditResponseType = | "http" | "https" | "tcp" | "udp_icmp" | "icmp_ping" | "smtp"; export const MonitorsEditResponseType = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PatchMonitorResponse { id?: string | null; /** Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. */ allowInsecure?: boolean | null; /** To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times. */ consecutiveDown?: number | null; /** To be marked healthy the monitored origin must pass this healthcheck N consecutive times. */ consecutiveUp?: number | null; createdOn?: string | null; /** Object description. */ description?: string | null; /** A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors. */ expectedBody?: string | null; /** The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors. */ expectedCodes?: string | null; /** Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors. */ followRedirects?: boolean | null; /** The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors. */ header?: MonitorsEditResponseHeaderMap | null; /** The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations. */ interval?: number | null; /** The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks. */ method?: string | null; modifiedOn?: string | null; /** The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors. */ path?: string | null; /** The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443). */ port?: number | null; /** Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors. */ probeZone?: string | null; /** The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. */ retries?: number | null; /** The timeout (in seconds) before marking the health check as failed. */ timeout?: number | null; /** The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. */ type?: MonitorsEditResponseType | null; } export const PatchMonitorResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), allowInsecure: S.optional( S.NullOr(S.Boolean).pipe(T.Body("allow_insecure")), ), consecutiveDown: S.optional( S.NullOr(S.Number).pipe(T.Body("consecutive_down")), ), consecutiveUp: S.optional( S.NullOr(S.Number).pipe(T.Body("consecutive_up")), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), description: S.optional(S.NullOr(S.String)), expectedBody: S.optional(S.NullOr(S.String).pipe(T.Body("expected_body"))), expectedCodes: S.optional( S.NullOr(S.String).pipe(T.Body("expected_codes")), ), followRedirects: S.optional( S.NullOr(S.Boolean).pipe(T.Body("follow_redirects")), ), header: S.optional(S.NullOr(MonitorsEditResponseHeaderMap)), interval: S.optional(S.NullOr(S.Number)), method: S.optional(S.NullOr(S.String)), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), path: S.optional(S.NullOr(S.String)), port: S.optional(S.NullOr(S.Number)), probeZone: S.optional(S.NullOr(S.String).pipe(T.Body("probe_zone"))), retries: S.optional(S.NullOr(S.Number)), timeout: S.optional(S.NullOr(S.Number)), type: S.optional(S.NullOr(MonitorsEditResponseType)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchMonitorResponse", }) as any as S.Schema; export type MonitorGroupsEditRequestMembersItem = MonitorGroupsCreateRequestMembersItem; export const MonitorGroupsEditRequestMembersItem = MonitorGroupsCreateRequestMembersItem; export type MonitorGroupsEditRequestMembersList = Array; export const MonitorGroupsEditRequestMembersList = /*@__PURE__*/ S.Array( MonitorGroupsCreateRequestMembersItem, ) as any as S.Schema; export interface PatchMonitorGroupRequest { /** Identifier. */ accountId: string; monitorGroupId: string; /** A short description of the monitor group */ description: string; /** List of monitors in this group */ members: MonitorGroupsEditRequestMembersList; } export const PatchMonitorGroupRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), monitorGroupId: S.String.pipe(T.Label("monitor_group_id")), description: S.String, members: MonitorGroupsEditRequestMembersList, }) .pipe( T.Http({ method: "PATCH", uri: "/accounts/{account_id}/load_balancers/monitor_groups/{monitor_group_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchMonitorGroupRequest", }) as any as S.Schema; export type MonitorGroupsEditResponseMembersItem = MonitorGroupsCreateResponseMembersItem; export const MonitorGroupsEditResponseMembersItem = MonitorGroupsCreateResponseMembersItem; export type MonitorGroupsEditResponseMembersList = Array; export const MonitorGroupsEditResponseMembersList = /*@__PURE__*/ S.Array( MonitorGroupsCreateResponseMembersItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PatchMonitorGroupResponse { /** The ID of the Monitor Group to use for checking the health of origins within this pool. */ id: string; /** A short description of the monitor group */ description: string; /** List of monitors in this group */ members: MonitorGroupsEditResponseMembersList; /** The timestamp of when the monitor group was created */ createdOn?: string | null; /** The timestamp of when the monitor group was last updated */ modifiedOn?: string | null; } export const PatchMonitorGroupResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, description: S.String, members: MonitorGroupsEditResponseMembersList, createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchMonitorGroupResponse", }) as any as S.Schema; export type PoolsEditRequestCheckRegionsItem = | "WNAM" | "ENAM" | "WEU" | "EEU" | "NSAM" | "SSAM" | "OC" | "ME" | "NAF" | "SAF" | "SAS" | "SEAS" | "NEAS" | "ALL_REGIONS"; export const PoolsEditRequestCheckRegionsItem = /*@__PURE__*/ S.String; export type PoolsEditRequestCheckRegionsList = Array< PoolsEditRequestCheckRegionsItem | (string & {}) >; export const PoolsEditRequestCheckRegionsList = /*@__PURE__*/ S.Array( PoolsEditRequestCheckRegionsItem, ) as any as S.Schema; export type PoolsEditRequestLoadSheddingDefaultPolicy = "random" | "hash"; export const PoolsEditRequestLoadSheddingDefaultPolicy = /*@__PURE__*/ S.String; export type PoolsEditRequestLoadSheddingSessionPolicy = "hash"; export const PoolsEditRequestLoadSheddingSessionPolicy = /*@__PURE__*/ S.String; export interface PoolsEditRequestLoadShedding { /** The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity. */ defaultPercent?: number; /** The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs. */ defaultPolicy?: PoolsEditRequestLoadSheddingDefaultPolicy | (string & {}); /** The percent of existing sessions to shed from the pool, according to the session policy. */ sessionPercent?: number; /** Only the hash policy is supported for existing sessions (to avoid exponential decay). */ sessionPolicy?: PoolsEditRequestLoadSheddingSessionPolicy | (string & {}); } export const PoolsEditRequestLoadShedding = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultPercent: S.optional(S.Number.pipe(T.Body("default_percent"))), defaultPolicy: S.optional( PoolsEditRequestLoadSheddingDefaultPolicy.pipe(T.Body("default_policy")), ), sessionPercent: S.optional(S.Number.pipe(T.Body("session_percent"))), sessionPolicy: S.optional( PoolsEditRequestLoadSheddingSessionPolicy.pipe(T.Body("session_policy")), ), }), ).annotate({ identifier: "PoolsEditRequestLoadShedding", }) as any as S.Schema; export type PoolsEditRequestNotificationFilterOrigin = PoolsCreateRequestNotificationFilterOrigin; export const PoolsEditRequestNotificationFilterOrigin = PoolsCreateRequestNotificationFilterOrigin; export type PoolsEditRequestNotificationFilter = PoolsCreateRequestNotificationFilter; export const PoolsEditRequestNotificationFilter = PoolsCreateRequestNotificationFilter; export type PoolsEditRequestOriginSteeringPolicy = | "random" | "hash" | "least_outstanding_requests" | "least_connections"; export const PoolsEditRequestOriginSteeringPolicy = /*@__PURE__*/ S.String; export interface PoolsEditRequestOriginSteering { /** The type of origin steering policy to use. */ policy?: PoolsEditRequestOriginSteeringPolicy | (string & {}); } export const PoolsEditRequestOriginSteering = /*@__PURE__*/ S.suspend(() => S.Struct({ policy: S.optional(PoolsEditRequestOriginSteeringPolicy), }), ).annotate({ identifier: "PoolsEditRequestOriginSteering", }) as any as S.Schema; export type PoolsEditRequestOriginsItemHeaderHostList = Array; export const PoolsEditRequestOriginsItemHeaderHostList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface PoolsEditRequestOriginsItemHeader { /** The 'Host' header allows to override the hostname set in the HTTP request. Current support is 1 'Host' header override per origin. */ host?: PoolsEditRequestOriginsItemHeaderHostList; } export const PoolsEditRequestOriginsItemHeader = /*@__PURE__*/ S.suspend(() => S.Struct({ host: S.optional( PoolsEditRequestOriginsItemHeaderHostList.pipe(T.Body("Host")), ), }), ).annotate({ identifier: "PoolsEditRequestOriginsItemHeader", }) as any as S.Schema; export interface PoolsEditRequestOriginsItem { /** The IP address (IPv4 or IPv6) of the origin, or its publicly addressable hostname. Hostnames entered here should resolve directly to the origin, and not be a hostname proxied by Cloudflare. To set an internal/reserved address, virtual_network_id must also be set. */ address?: string; /** This field shows up only if the origin is disabled. This field is set with the time the origin was disabled. */ disabledAt?: string; /** Whether to enable (the default) this origin within the pool. Disabled origins will not receive traffic and are excluded from health checks. The origin will only be disabled for the current pool. */ enabled?: boolean; /** Whether to flatten CNAME records for this origin, resolving them to A/AAAA records before returning to the client. When true (the default), the director resolves CNAME addresses to their underlying A/AAAA records. When false, the origin address is returned as a raw CNAME record without resolution. This setting mirrors the DNS API record flatten_cname setting. */ flattenCname?: boolean; /** The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'. */ header?: PoolsEditRequestOriginsItemHeader; /** A human-identifiable name for the origin. */ name?: string; /** The port for upstream connections. A value of 0 means the default port for the protocol will be used. */ port?: number; /** The virtual network subnet ID the origin belongs in. Virtual network must also belong to the account. */ virtualNetworkId?: string; /** The weight of this origin relative to other origins in the pool. Based on the configured weight the total traffic is distributed among origins within the pool. */ weight?: number; } export const PoolsEditRequestOriginsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ address: S.optional(S.String), disabledAt: S.optional(S.String.pipe(T.Body("disabled_at"))), enabled: S.optional(S.Boolean), flattenCname: S.optional(S.Boolean.pipe(T.Body("flatten_cname"))), header: S.optional(PoolsEditRequestOriginsItemHeader), name: S.optional(S.String), port: S.optional(S.Number), virtualNetworkId: S.optional(S.String.pipe(T.Body("virtual_network_id"))), weight: S.optional(S.Number), }), ).annotate({ identifier: "PoolsEditRequestOriginsItem", }) as any as S.Schema; export type PoolsEditRequestOriginsList = Array; export const PoolsEditRequestOriginsList = /*@__PURE__*/ S.Array( PoolsEditRequestOriginsItem, ) as any as S.Schema; export interface PatchPoolRequest { /** Identifier. */ accountId: string; poolId: string; /** A list of regions from which to run health checks. Null means every Cloudflare data center. */ checkRegions?: PoolsEditRequestCheckRegionsList; /** A human-readable description of the pool. */ description?: string; /** Whether to enable (the default) or disable this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any). */ enabled?: boolean; /** The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set. */ latitude?: number; /** Configures load shedding policies and percentages for the pool. */ loadShedding?: PoolsEditRequestLoadShedding; /** The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set. */ longitude?: number; /** The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and will failover to the next available pool. */ minimumOrigins?: number; /** The ID of the Monitor to use for checking the health of origins within this pool. */ monitor?: string; /** The ID of the Monitor Group to use for checking the health of origins within this pool. */ monitorGroup?: string; /** A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed. */ name?: string; /** This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address to send health status notifications to. This can be an individual mailbox or a mailing list. Multiple emails can be supplied as a comma delimited list. */ notificationEmail?: string; /** Filter pool and origin health notifications by resource type or health status. Use null to reset. */ notificationFilter?: PoolsCreateRequestNotificationFilter; /** Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity. */ originSteering?: PoolsEditRequestOriginSteering; /** The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. */ origins?: PoolsEditRequestOriginsList; } export const PatchPoolRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), poolId: S.String.pipe(T.Label("pool_id")), checkRegions: S.optional( PoolsEditRequestCheckRegionsList.pipe(T.Body("check_regions")), ), description: S.optional(S.String), enabled: S.optional(S.Boolean), latitude: S.optional(S.Number), loadShedding: S.optional( PoolsEditRequestLoadShedding.pipe(T.Body("load_shedding")), ), longitude: S.optional(S.Number), minimumOrigins: S.optional(S.Number.pipe(T.Body("minimum_origins"))), monitor: S.optional(S.String), monitorGroup: S.optional(S.String.pipe(T.Body("monitor_group"))), name: S.optional(S.String), notificationEmail: S.optional(S.String.pipe(T.Body("notification_email"))), notificationFilter: S.optional( PoolsCreateRequestNotificationFilter.pipe(T.Body("notification_filter")), ), originSteering: S.optional( PoolsEditRequestOriginSteering.pipe(T.Body("origin_steering")), ), origins: S.optional(PoolsEditRequestOriginsList), }) .pipe( T.Http({ method: "PATCH", uri: "/accounts/{account_id}/load_balancers/pools/{pool_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchPoolRequest", }) as any as S.Schema; export type PoolsEditResponseCheckRegionsItem = | "WNAM" | "ENAM" | "WEU" | "EEU" | "NSAM" | "SSAM" | "OC" | "ME" | "NAF" | "SAF" | "SAS" | "SEAS" | "NEAS" | "ALL_REGIONS"; export const PoolsEditResponseCheckRegionsItem = /*@__PURE__*/ S.String; export type PoolsEditResponseCheckRegionsList = Array; export const PoolsEditResponseCheckRegionsList = /*@__PURE__*/ S.Array( PoolsEditResponseCheckRegionsItem, ) as any as S.Schema; export type PoolsEditResponseLoadSheddingDefaultPolicy = "random" | "hash"; export const PoolsEditResponseLoadSheddingDefaultPolicy = /*@__PURE__*/ S.String; export type PoolsEditResponseLoadSheddingSessionPolicy = "hash"; export const PoolsEditResponseLoadSheddingSessionPolicy = /*@__PURE__*/ S.String; export interface PoolsEditResponseLoadShedding { /** The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity. */ defaultPercent?: number | null; /** The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs. */ defaultPolicy?: PoolsEditResponseLoadSheddingDefaultPolicy | null; /** The percent of existing sessions to shed from the pool, according to the session policy. */ sessionPercent?: number | null; /** Only the hash policy is supported for existing sessions (to avoid exponential decay). */ sessionPolicy?: PoolsEditResponseLoadSheddingSessionPolicy | null; } export const PoolsEditResponseLoadShedding = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultPercent: S.optional( S.NullOr(S.Number).pipe(T.Body("default_percent")), ), defaultPolicy: S.optional( S.NullOr(PoolsEditResponseLoadSheddingDefaultPolicy).pipe( T.Body("default_policy"), ), ), sessionPercent: S.optional( S.NullOr(S.Number).pipe(T.Body("session_percent")), ), sessionPolicy: S.optional( S.NullOr(PoolsEditResponseLoadSheddingSessionPolicy).pipe( T.Body("session_policy"), ), ), }), ).annotate({ identifier: "PoolsEditResponseLoadShedding", }) as any as S.Schema; export type PoolsEditResponseNetworksList = Array; export const PoolsEditResponseNetworksList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type PoolsEditResponseNotificationFilterOrigin = PoolsBulkEditResultItemNotificationFilterOrigin; export const PoolsEditResponseNotificationFilterOrigin = PoolsBulkEditResultItemNotificationFilterOrigin; export type PoolsEditResponseNotificationFilter = PoolsBulkEditResultItemNotificationFilter; export const PoolsEditResponseNotificationFilter = PoolsBulkEditResultItemNotificationFilter; export type PoolsEditResponseOriginSteeringPolicy = | "random" | "hash" | "least_outstanding_requests" | "least_connections"; export const PoolsEditResponseOriginSteeringPolicy = /*@__PURE__*/ S.String; export interface PoolsEditResponseOriginSteering { /** The type of origin steering policy to use. */ policy?: PoolsEditResponseOriginSteeringPolicy | null; } export const PoolsEditResponseOriginSteering = /*@__PURE__*/ S.suspend(() => S.Struct({ policy: S.optional(S.NullOr(PoolsEditResponseOriginSteeringPolicy)), }), ).annotate({ identifier: "PoolsEditResponseOriginSteering", }) as any as S.Schema; export type PoolsEditResponseOriginsItemHeaderHostList = Array; export const PoolsEditResponseOriginsItemHeaderHostList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface PoolsEditResponseOriginsItemHeader { /** The 'Host' header allows to override the hostname set in the HTTP request. Current support is 1 'Host' header override per origin. */ host?: PoolsEditResponseOriginsItemHeaderHostList | null; } export const PoolsEditResponseOriginsItemHeader = /*@__PURE__*/ S.suspend(() => S.Struct({ host: S.optional( S.NullOr(PoolsEditResponseOriginsItemHeaderHostList).pipe(T.Body("Host")), ), }), ).annotate({ identifier: "PoolsEditResponseOriginsItemHeader", }) as any as S.Schema; export interface PoolsEditResponseOriginsItem { /** The IP address (IPv4 or IPv6) of the origin, or its publicly addressable hostname. Hostnames entered here should resolve directly to the origin, and not be a hostname proxied by Cloudflare. To set an internal/reserved address, virtual_network_id must also be set. */ address?: string | null; /** This field shows up only if the origin is disabled. This field is set with the time the origin was disabled. */ disabledAt?: string | null; /** Whether to enable (the default) this origin within the pool. Disabled origins will not receive traffic and are excluded from health checks. The origin will only be disabled for the current pool. */ enabled?: boolean | null; /** Whether to flatten CNAME records for this origin, resolving them to A/AAAA records before returning to the client. When true (the default), the director resolves CNAME addresses to their underlying A/AAAA records. When false, the origin address is returned as a raw CNAME record without resolution. This setting mirrors the DNS API record flatten_cname setting. */ flattenCname?: boolean | null; /** The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'. */ header?: PoolsEditResponseOriginsItemHeader | null; /** A human-identifiable name for the origin. */ name?: string | null; /** The port for upstream connections. A value of 0 means the default port for the protocol will be used. */ port?: number | null; /** The virtual network subnet ID the origin belongs in. Virtual network must also belong to the account. */ virtualNetworkId?: string | null; /** The weight of this origin relative to other origins in the pool. Based on the configured weight the total traffic is distributed among origins within the pool. */ weight?: number | null; } export const PoolsEditResponseOriginsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ address: S.optional(S.NullOr(S.String)), disabledAt: S.optional(S.NullOr(S.String).pipe(T.Body("disabled_at"))), enabled: S.optional(S.NullOr(S.Boolean)), flattenCname: S.optional(S.NullOr(S.Boolean).pipe(T.Body("flatten_cname"))), header: S.optional(S.NullOr(PoolsEditResponseOriginsItemHeader)), name: S.optional(S.NullOr(S.String)), port: S.optional(S.NullOr(S.Number)), virtualNetworkId: S.optional( S.NullOr(S.String).pipe(T.Body("virtual_network_id")), ), weight: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "PoolsEditResponseOriginsItem", }) as any as S.Schema; export type PoolsEditResponseOriginsList = Array; export const PoolsEditResponseOriginsList = /*@__PURE__*/ S.Array( PoolsEditResponseOriginsItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PatchPoolResponse { id?: string | null; /** A list of regions from which to run health checks. Null means every Cloudflare data center. */ checkRegions?: PoolsEditResponseCheckRegionsList | null; createdOn?: string | null; /** A human-readable description of the pool. */ description?: string | null; /** This field shows up only if the pool is disabled. This field is set with the time the pool was disabled at. */ disabledAt?: string | null; /** Whether to enable (the default) or disable this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any). */ enabled?: boolean | null; /** The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set. */ latitude?: number | null; /** Configures load shedding policies and percentages for the pool. */ loadShedding?: PoolsEditResponseLoadShedding | null; /** The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set. */ longitude?: number | null; /** The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and will failover to the next available pool. */ minimumOrigins?: number | null; modifiedOn?: string | null; /** The ID of the Monitor to use for checking the health of origins within this pool. */ monitor?: string | null; /** The ID of the Monitor Group to use for checking the health of origins within this pool. */ monitorGroup?: string | null; /** A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed. */ name?: string | null; /** List of networks where Load Balancer or Pool is enabled. */ networks?: PoolsEditResponseNetworksList | null; /** This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address to send health status notifications to. This can be an individual mailbox or a mailing list. Multiple emails can be supplied as a comma delimited list. */ notificationEmail?: string | null; /** Filter pool and origin health notifications by resource type or health status. Use null to reset. */ notificationFilter?: PoolsBulkEditResultItemNotificationFilter | null; /** Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity. */ originSteering?: PoolsEditResponseOriginSteering | null; /** The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. */ origins?: PoolsEditResponseOriginsList | null; } export const PatchPoolResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), checkRegions: S.optional( S.NullOr(PoolsEditResponseCheckRegionsList).pipe(T.Body("check_regions")), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), description: S.optional(S.NullOr(S.String)), disabledAt: S.optional(S.NullOr(S.String).pipe(T.Body("disabled_at"))), enabled: S.optional(S.NullOr(S.Boolean)), latitude: S.optional(S.NullOr(S.Number)), loadShedding: S.optional( S.NullOr(PoolsEditResponseLoadShedding).pipe(T.Body("load_shedding")), ), longitude: S.optional(S.NullOr(S.Number)), minimumOrigins: S.optional( S.NullOr(S.Number).pipe(T.Body("minimum_origins")), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), monitor: S.optional(S.NullOr(S.String)), monitorGroup: S.optional(S.NullOr(S.String).pipe(T.Body("monitor_group"))), name: S.optional(S.NullOr(S.String)), networks: S.optional(S.NullOr(PoolsEditResponseNetworksList)), notificationEmail: S.optional( S.NullOr(S.String).pipe(T.Body("notification_email")), ), notificationFilter: S.optional( S.NullOr(PoolsBulkEditResultItemNotificationFilter).pipe( T.Body("notification_filter"), ), ), originSteering: S.optional( S.NullOr(PoolsEditResponseOriginSteering).pipe(T.Body("origin_steering")), ), origins: S.optional(S.NullOr(PoolsEditResponseOriginsList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchPoolResponse", }) as any as S.Schema; export type UpdateRequestDefaultPoolsList = Array; export const UpdateRequestDefaultPoolsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type UpdateRequestAdaptiveRouting = CreateRequestAdaptiveRouting; export const UpdateRequestAdaptiveRouting = CreateRequestAdaptiveRouting; export type UpdateRequestCountryPoolsMap = { [key: string]: unknown | undefined; }; export const UpdateRequestCountryPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type UpdateRequestLocationStrategyMode = "pop" | "resolver_ip"; export const UpdateRequestLocationStrategyMode = /*@__PURE__*/ S.String; export type UpdateRequestLocationStrategyPreferEcs = | "always" | "never" | "proximity" | "geo"; export const UpdateRequestLocationStrategyPreferEcs = /*@__PURE__*/ S.String; export interface UpdateRequestLocationStrategy { /** Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful. */ mode?: UpdateRequestLocationStrategyMode | (string & {}); /** Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location. */ preferEcs?: UpdateRequestLocationStrategyPreferEcs | (string & {}); } export const UpdateRequestLocationStrategy = /*@__PURE__*/ S.suspend(() => S.Struct({ mode: S.optional(UpdateRequestLocationStrategyMode), preferEcs: S.optional( UpdateRequestLocationStrategyPreferEcs.pipe(T.Body("prefer_ecs")), ), }), ).annotate({ identifier: "UpdateRequestLocationStrategy", }) as any as S.Schema; export type UpdateRequestNetworksList = Array; export const UpdateRequestNetworksList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type UpdateRequestPopPoolsMap = { [key: string]: unknown | undefined }; export const UpdateRequestPopPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type UpdateRequestRandomSteeringPoolWeightsMap = { [key: string]: number | undefined; }; export const UpdateRequestRandomSteeringPoolWeightsMap = /*@__PURE__*/ S.Record( S.String, S.Number, ) as any as S.Schema; export interface UpdateRequestRandomSteering { /** The default weight for pools in the load balancer that are not specified in the pool_weights map. */ defaultWeight?: number; /** A mapping of pool IDs to custom weights. The weight is relative to other pools in the load balancer. */ poolWeights?: UpdateRequestRandomSteeringPoolWeightsMap; } export const UpdateRequestRandomSteering = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultWeight: S.optional(S.Number.pipe(T.Body("default_weight"))), poolWeights: S.optional( UpdateRequestRandomSteeringPoolWeightsMap.pipe(T.Body("pool_weights")), ), }), ).annotate({ identifier: "UpdateRequestRandomSteering", }) as any as S.Schema; export type UpdateRequestRegionPoolsMap = { [key: string]: unknown | undefined; }; export const UpdateRequestRegionPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type UpdateRequestRulesItemFixedResponse = CreateRequestRulesItemFixedResponse; export const UpdateRequestRulesItemFixedResponse = CreateRequestRulesItemFixedResponse; export type UpdateRequestRulesItemOverridesCountryPoolsMap = { [key: string]: unknown | undefined; }; export const UpdateRequestRulesItemOverridesCountryPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type UpdateRequestRulesItemOverridesDefaultPoolsList = Array; export const UpdateRequestRulesItemOverridesDefaultPoolsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type UpdateRequestRulesItemOverridesPopPoolsMap = { [key: string]: unknown | undefined; }; export const UpdateRequestRulesItemOverridesPopPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type UpdateRequestRulesItemOverridesRegionPoolsMap = { [key: string]: unknown | undefined; }; export const UpdateRequestRulesItemOverridesRegionPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type UpdateRequestRulesItemOverridesSessionAffinity = | "none" | "cookie" | "ip_cookie" | "header"; export const UpdateRequestRulesItemOverridesSessionAffinity = /*@__PURE__*/ S.String; export type UpdateRequestRulesItemOverridesSessionAffinityAttributesHeadersList = Array; export const UpdateRequestRulesItemOverridesSessionAffinityAttributesHeadersList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type UpdateRequestRulesItemOverridesSessionAffinityAttributesSamesite = | "Auto" | "Lax" | "None" | "Strict"; export const UpdateRequestRulesItemOverridesSessionAffinityAttributesSamesite = /*@__PURE__*/ S.String; export type UpdateRequestRulesItemOverridesSessionAffinityAttributesSecure = | "Auto" | "Always" | "Never"; export const UpdateRequestRulesItemOverridesSessionAffinityAttributesSecure = /*@__PURE__*/ S.String; export type UpdateRequestRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover = | "none" | "temporary" | "sticky"; export const UpdateRequestRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover = /*@__PURE__*/ S.String; export interface UpdateRequestRulesItemOverridesSessionAffinityAttributes { /** Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer. */ drainDuration?: number; /** Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:,"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans. */ headers?: UpdateRequestRulesItemOverridesSessionAffinityAttributesHeadersList; /** When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren't created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren't created. */ requireAllHeaders?: boolean; /** Configures the SameSite attribute on session affinity cookie. Value "Auto" will be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: when using value "None", the secure attribute can not be set to "Never". */ samesite?: | UpdateRequestRulesItemOverridesSessionAffinityAttributesSamesite | (string & {}); /** Configures the Secure attribute on session affinity cookie. Value "Always" indicates the Secure attribute will be set in the Set-Cookie header, "Never" indicates the Secure attribute will not be set, and "Auto" will set the Secure attribute depending if Always Use HTTPS is enabled. */ secure?: | UpdateRequestRulesItemOverridesSessionAffinityAttributesSecure | (string & {}); /** Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are: - `"none"`: No failover takes place for sessions pinned to the origin (default). - `"temporary"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. - `"sticky"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header. */ zeroDowntimeFailover?: | UpdateRequestRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover | (string & {}); } export const UpdateRequestRulesItemOverridesSessionAffinityAttributes = /*@__PURE__*/ S.suspend(() => S.Struct({ drainDuration: S.optional(S.Number.pipe(T.Body("drain_duration"))), headers: S.optional( UpdateRequestRulesItemOverridesSessionAffinityAttributesHeadersList, ), requireAllHeaders: S.optional( S.Boolean.pipe(T.Body("require_all_headers")), ), samesite: S.optional( UpdateRequestRulesItemOverridesSessionAffinityAttributesSamesite, ), secure: S.optional( UpdateRequestRulesItemOverridesSessionAffinityAttributesSecure, ), zeroDowntimeFailover: S.optional( UpdateRequestRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover.pipe( T.Body("zero_downtime_failover"), ), ), }), ).annotate({ identifier: "UpdateRequestRulesItemOverridesSessionAffinityAttributes", }) as any as S.Schema; export type UpdateRequestRulesItemOverridesSteeringPolicy = | "off" | "geo" | "random" | "dynamic_latency" | "proximity" | "least_outstanding_requests" | "least_connections" | ""; export const UpdateRequestRulesItemOverridesSteeringPolicy = /*@__PURE__*/ S.String; export interface UpdateRequestRulesItemOverrides { /** Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin. */ adaptiveRouting?: CreateRequestAdaptiveRouting; /** A mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools. */ countryPools?: UpdateRequestRulesItemOverridesCountryPoolsMap; /** A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region. */ defaultPools?: UpdateRequestRulesItemOverridesDefaultPoolsList; /** The pool ID to use when all other pools are detected as unhealthy. */ fallbackPool?: string; /** Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected. */ locationStrategy?: UpdateRequestLocationStrategy; /** Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. */ popPools?: UpdateRequestRulesItemOverridesPopPoolsMap; /** Configures pool weights. */ randomSteering?: UpdateRequestRandomSteering; /** A mapping of region codes to a list of pool IDs (ordered by their failover priority) for the given region. Any regions not explicitly defined will fall back to using default_pools. */ regionPools?: UpdateRequestRulesItemOverridesRegionPoolsMap; /** Specifies the type of session affinity the load balancer should use unless specified as `"none"`. 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. */ sessionAffinity?: | UpdateRequestRulesItemOverridesSessionAffinity | (string & {}); /** Configures attributes for session affinity. */ sessionAffinityAttributes?: UpdateRequestRulesItemOverridesSessionAffinityAttributes; /** Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven't been used for the number of seconds specified. */ sessionAffinityTtl?: number; /** Steering Policy for this load balancer. */ steeringPolicy?: | UpdateRequestRulesItemOverridesSteeringPolicy | (string & {}); /** Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers. */ ttl?: number; } export const UpdateRequestRulesItemOverrides = /*@__PURE__*/ S.suspend(() => S.Struct({ adaptiveRouting: S.optional( CreateRequestAdaptiveRouting.pipe(T.Body("adaptive_routing")), ), countryPools: S.optional( UpdateRequestRulesItemOverridesCountryPoolsMap.pipe( T.Body("country_pools"), ), ), defaultPools: S.optional( UpdateRequestRulesItemOverridesDefaultPoolsList.pipe( T.Body("default_pools"), ), ), fallbackPool: S.optional(S.String.pipe(T.Body("fallback_pool"))), locationStrategy: S.optional( UpdateRequestLocationStrategy.pipe(T.Body("location_strategy")), ), popPools: S.optional( UpdateRequestRulesItemOverridesPopPoolsMap.pipe(T.Body("pop_pools")), ), randomSteering: S.optional( UpdateRequestRandomSteering.pipe(T.Body("random_steering")), ), regionPools: S.optional( UpdateRequestRulesItemOverridesRegionPoolsMap.pipe( T.Body("region_pools"), ), ), sessionAffinity: S.optional( UpdateRequestRulesItemOverridesSessionAffinity.pipe( T.Body("session_affinity"), ), ), sessionAffinityAttributes: S.optional( UpdateRequestRulesItemOverridesSessionAffinityAttributes.pipe( T.Body("session_affinity_attributes"), ), ), sessionAffinityTtl: S.optional( S.Number.pipe(T.Body("session_affinity_ttl")), ), steeringPolicy: S.optional( UpdateRequestRulesItemOverridesSteeringPolicy.pipe( T.Body("steering_policy"), ), ), ttl: S.optional(S.Number), }), ).annotate({ identifier: "UpdateRequestRulesItemOverrides", }) as any as S.Schema; export interface UpdateRequestRulesItem { /** The condition expressions to evaluate. If the condition evaluates to true, the overrides or fixed_response in this rule will be applied. An empty condition is always true. For more details on condition expressions, please see https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions. */ condition?: string; /** Disable this specific rule. It will no longer be evaluated by this load balancer. */ disabled?: boolean; /** A collection of fields used to directly respond to the eyeball instead of routing to a pool. If a fixed_response is supplied the rule will be marked as terminates. */ fixedResponse?: CreateRequestRulesItemFixedResponse; /** Name of this rule. Only used for human readability. */ name?: string; /** A collection of overrides to apply to the load balancer when this rule's condition is true. All fields are optional. */ overrides?: UpdateRequestRulesItemOverrides; /** The order in which rules should be executed in relation to each other. Lower values are executed first. Values do not need to be sequential. If no value is provided for any rule the array order of the rules field will be used to assign a priority. */ priority?: number; /** If this rule's condition is true, this causes rule evaluation to stop after processing this rule. */ terminates?: boolean; } export const UpdateRequestRulesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ condition: S.optional(S.String), disabled: S.optional(S.Boolean), fixedResponse: S.optional( CreateRequestRulesItemFixedResponse.pipe(T.Body("fixed_response")), ), name: S.optional(S.String), overrides: S.optional(UpdateRequestRulesItemOverrides), priority: S.optional(S.Number), terminates: S.optional(S.Boolean), }), ).annotate({ identifier: "UpdateRequestRulesItem", }) as any as S.Schema; export type UpdateRequestRulesList = Array; export const UpdateRequestRulesList = /*@__PURE__*/ S.Array( UpdateRequestRulesItem, ) as any as S.Schema; export interface UpdateLoadBalancerRequest { zoneId: string; loadBalancerId: string; /** A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region. */ defaultPools: UpdateRequestDefaultPoolsList; /** The pool ID to use when all other pools are detected as unhealthy. */ fallbackPool: string; /** The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used. */ name: string; /** Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin. */ adaptiveRouting?: CreateRequestAdaptiveRouting; /** A mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools. */ countryPools?: UpdateRequestCountryPoolsMap; /** Object description. */ description?: string; /** Whether to enable (the default) this load balancer. */ enabled?: boolean; /** Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected. */ locationStrategy?: UpdateRequestLocationStrategy; /** List of networks where Load Balancer or Pool is enabled. */ networks?: UpdateRequestNetworksList; /** Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. */ popPools?: UpdateRequestPopPoolsMap; /** Whether the hostname should be gray clouded (false) or orange clouded (true). */ proxied?: boolean; /** Configures pool weights. */ randomSteering?: UpdateRequestRandomSteering; /** A mapping of region codes to a list of pool IDs (ordered by their failover priority) for the given region. Any regions not explicitly defined will fall back to using default_pools. */ regionPools?: UpdateRequestRegionPoolsMap; /** BETA Field Not General Access: A list of rules for this load balancer to execute. */ rules?: UpdateRequestRulesList; /** Specifies the type of session affinity the load balancer should use unless specified as `"none"`. 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. */ sessionAffinity?: | UpdateRequestRulesItemOverridesSessionAffinity | (string & {}); /** Configures attributes for session affinity. */ sessionAffinityAttributes?: UpdateRequestRulesItemOverridesSessionAffinityAttributes; /** Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven't been used for the number of seconds specified. */ sessionAffinityTtl?: number; /** Steering Policy for this load balancer. */ steeringPolicy?: | UpdateRequestRulesItemOverridesSteeringPolicy | (string & {}); /** Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers. */ ttl?: number; } export const UpdateLoadBalancerRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), loadBalancerId: S.String.pipe(T.Label("load_balancer_id")), defaultPools: UpdateRequestDefaultPoolsList.pipe(T.Body("default_pools")), fallbackPool: S.String.pipe(T.Body("fallback_pool")), name: S.String, adaptiveRouting: S.optional( CreateRequestAdaptiveRouting.pipe(T.Body("adaptive_routing")), ), countryPools: S.optional( UpdateRequestCountryPoolsMap.pipe(T.Body("country_pools")), ), description: S.optional(S.String), enabled: S.optional(S.Boolean), locationStrategy: S.optional( UpdateRequestLocationStrategy.pipe(T.Body("location_strategy")), ), networks: S.optional(UpdateRequestNetworksList), popPools: S.optional(UpdateRequestPopPoolsMap.pipe(T.Body("pop_pools"))), proxied: S.optional(S.Boolean), randomSteering: S.optional( UpdateRequestRandomSteering.pipe(T.Body("random_steering")), ), regionPools: S.optional( UpdateRequestRegionPoolsMap.pipe(T.Body("region_pools")), ), rules: S.optional(UpdateRequestRulesList), sessionAffinity: S.optional( UpdateRequestRulesItemOverridesSessionAffinity.pipe( T.Body("session_affinity"), ), ), sessionAffinityAttributes: S.optional( UpdateRequestRulesItemOverridesSessionAffinityAttributes.pipe( T.Body("session_affinity_attributes"), ), ), sessionAffinityTtl: S.optional( S.Number.pipe(T.Body("session_affinity_ttl")), ), steeringPolicy: S.optional( UpdateRequestRulesItemOverridesSteeringPolicy.pipe( T.Body("steering_policy"), ), ), ttl: S.optional(S.Number), }) .pipe( T.Http({ method: "PUT", uri: "/zones/{zone_id}/load_balancers/{load_balancer_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateLoadBalancerRequest", }) as any as S.Schema; export type UpdateResponseAdaptiveRouting = CreateResponseAdaptiveRouting; export const UpdateResponseAdaptiveRouting = CreateResponseAdaptiveRouting; export type UpdateResponseCountryPoolsMap = { [key: string]: unknown | undefined; }; export const UpdateResponseCountryPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type UpdateResponseDefaultPoolsList = Array; export const UpdateResponseDefaultPoolsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type UpdateResponseLocationStrategyMode = "pop" | "resolver_ip"; export const UpdateResponseLocationStrategyMode = /*@__PURE__*/ S.String; export type UpdateResponseLocationStrategyPreferEcs = | "always" | "never" | "proximity" | "geo"; export const UpdateResponseLocationStrategyPreferEcs = /*@__PURE__*/ S.String; export interface UpdateResponseLocationStrategy { /** Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful. */ mode?: UpdateResponseLocationStrategyMode | null; /** Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location. */ preferEcs?: UpdateResponseLocationStrategyPreferEcs | null; } export const UpdateResponseLocationStrategy = /*@__PURE__*/ S.suspend(() => S.Struct({ mode: S.optional(S.NullOr(UpdateResponseLocationStrategyMode)), preferEcs: S.optional( S.NullOr(UpdateResponseLocationStrategyPreferEcs).pipe( T.Body("prefer_ecs"), ), ), }), ).annotate({ identifier: "UpdateResponseLocationStrategy", }) as any as S.Schema; export type UpdateResponseNetworksList = Array; export const UpdateResponseNetworksList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type UpdateResponsePopPoolsMap = { [key: string]: unknown | undefined }; export const UpdateResponsePopPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type UpdateResponseRandomSteeringPoolWeightsMap = { [key: string]: number | undefined; }; export const UpdateResponseRandomSteeringPoolWeightsMap = /*@__PURE__*/ S.Record( S.String, S.Number, ) as any as S.Schema; export interface UpdateResponseRandomSteering { /** The default weight for pools in the load balancer that are not specified in the pool_weights map. */ defaultWeight?: number | null; /** A mapping of pool IDs to custom weights. The weight is relative to other pools in the load balancer. */ poolWeights?: UpdateResponseRandomSteeringPoolWeightsMap | null; } export const UpdateResponseRandomSteering = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultWeight: S.optional( S.NullOr(S.Number).pipe(T.Body("default_weight")), ), poolWeights: S.optional( S.NullOr(UpdateResponseRandomSteeringPoolWeightsMap).pipe( T.Body("pool_weights"), ), ), }), ).annotate({ identifier: "UpdateResponseRandomSteering", }) as any as S.Schema; export type UpdateResponseRegionPoolsMap = { [key: string]: unknown | undefined; }; export const UpdateResponseRegionPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type UpdateResponseRulesItemFixedResponse = CreateResponseRulesItemFixedResponse; export const UpdateResponseRulesItemFixedResponse = CreateResponseRulesItemFixedResponse; export type UpdateResponseRulesItemOverridesCountryPoolsMap = { [key: string]: unknown | undefined; }; export const UpdateResponseRulesItemOverridesCountryPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type UpdateResponseRulesItemOverridesDefaultPoolsList = Array; export const UpdateResponseRulesItemOverridesDefaultPoolsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type UpdateResponseRulesItemOverridesPopPoolsMap = { [key: string]: unknown | undefined; }; export const UpdateResponseRulesItemOverridesPopPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type UpdateResponseRulesItemOverridesRegionPoolsMap = { [key: string]: unknown | undefined; }; export const UpdateResponseRulesItemOverridesRegionPoolsMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type UpdateResponseRulesItemOverridesSessionAffinity = | "none" | "cookie" | "ip_cookie" | "header"; export const UpdateResponseRulesItemOverridesSessionAffinity = /*@__PURE__*/ S.String; export type UpdateResponseRulesItemOverridesSessionAffinityAttributesHeadersList = Array; export const UpdateResponseRulesItemOverridesSessionAffinityAttributesHeadersList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type UpdateResponseRulesItemOverridesSessionAffinityAttributesSamesite = | "Auto" | "Lax" | "None" | "Strict"; export const UpdateResponseRulesItemOverridesSessionAffinityAttributesSamesite = /*@__PURE__*/ S.String; export type UpdateResponseRulesItemOverridesSessionAffinityAttributesSecure = | "Auto" | "Always" | "Never"; export const UpdateResponseRulesItemOverridesSessionAffinityAttributesSecure = /*@__PURE__*/ S.String; export type UpdateResponseRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover = | "none" | "temporary" | "sticky"; export const UpdateResponseRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover = /*@__PURE__*/ S.String; export interface UpdateResponseRulesItemOverridesSessionAffinityAttributes { /** Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer. */ drainDuration?: number | null; /** Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:,"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans. */ headers?: UpdateResponseRulesItemOverridesSessionAffinityAttributesHeadersList | null; /** When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren't created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren't created. */ requireAllHeaders?: boolean | null; /** Configures the SameSite attribute on session affinity cookie. Value "Auto" will be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: when using value "None", the secure attribute can not be set to "Never". */ samesite?: UpdateResponseRulesItemOverridesSessionAffinityAttributesSamesite | null; /** Configures the Secure attribute on session affinity cookie. Value "Always" indicates the Secure attribute will be set in the Set-Cookie header, "Never" indicates the Secure attribute will not be set, and "Auto" will set the Secure attribute depending if Always Use HTTPS is enabled. */ secure?: UpdateResponseRulesItemOverridesSessionAffinityAttributesSecure | null; /** Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are: - `"none"`: No failover takes place for sessions pinned to the origin (default). - `"temporary"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. - `"sticky"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header. */ zeroDowntimeFailover?: UpdateResponseRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover | null; } export const UpdateResponseRulesItemOverridesSessionAffinityAttributes = /*@__PURE__*/ S.suspend(() => S.Struct({ drainDuration: S.optional( S.NullOr(S.Number).pipe(T.Body("drain_duration")), ), headers: S.optional( S.NullOr( UpdateResponseRulesItemOverridesSessionAffinityAttributesHeadersList, ), ), requireAllHeaders: S.optional( S.NullOr(S.Boolean).pipe(T.Body("require_all_headers")), ), samesite: S.optional( S.NullOr( UpdateResponseRulesItemOverridesSessionAffinityAttributesSamesite, ), ), secure: S.optional( S.NullOr( UpdateResponseRulesItemOverridesSessionAffinityAttributesSecure, ), ), zeroDowntimeFailover: S.optional( S.NullOr( UpdateResponseRulesItemOverridesSessionAffinityAttributesZeroDowntimeFailover, ).pipe(T.Body("zero_downtime_failover")), ), }), ).annotate({ identifier: "UpdateResponseRulesItemOverridesSessionAffinityAttributes", }) as any as S.Schema; export type UpdateResponseRulesItemOverridesSteeringPolicy = | "off" | "geo" | "random" | "dynamic_latency" | "proximity" | "least_outstanding_requests" | "least_connections" | ""; export const UpdateResponseRulesItemOverridesSteeringPolicy = /*@__PURE__*/ S.String; export interface UpdateResponseRulesItemOverrides { /** Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin. */ adaptiveRouting?: CreateResponseAdaptiveRouting | null; /** A mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools. */ countryPools?: UpdateResponseRulesItemOverridesCountryPoolsMap | null; /** A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region. */ defaultPools?: UpdateResponseRulesItemOverridesDefaultPoolsList | null; /** The pool ID to use when all other pools are detected as unhealthy. */ fallbackPool?: string | null; /** Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected. */ locationStrategy?: UpdateResponseLocationStrategy | null; /** Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. */ popPools?: UpdateResponseRulesItemOverridesPopPoolsMap | null; /** Configures pool weights. */ randomSteering?: UpdateResponseRandomSteering | null; /** A mapping of region codes to a list of pool IDs (ordered by their failover priority) for the given region. Any regions not explicitly defined will fall back to using default_pools. */ regionPools?: UpdateResponseRulesItemOverridesRegionPoolsMap | null; /** Specifies the type of session affinity the load balancer should use unless specified as `"none"`. 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. */ sessionAffinity?: UpdateResponseRulesItemOverridesSessionAffinity | null; /** Configures attributes for session affinity. */ sessionAffinityAttributes?: UpdateResponseRulesItemOverridesSessionAffinityAttributes | null; /** Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven't been used for the number of seconds specified. */ sessionAffinityTtl?: number | null; /** Steering Policy for this load balancer. */ steeringPolicy?: UpdateResponseRulesItemOverridesSteeringPolicy | null; /** Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers. */ ttl?: number | null; } export const UpdateResponseRulesItemOverrides = /*@__PURE__*/ S.suspend(() => S.Struct({ adaptiveRouting: S.optional( S.NullOr(CreateResponseAdaptiveRouting).pipe(T.Body("adaptive_routing")), ), countryPools: S.optional( S.NullOr(UpdateResponseRulesItemOverridesCountryPoolsMap).pipe( T.Body("country_pools"), ), ), defaultPools: S.optional( S.NullOr(UpdateResponseRulesItemOverridesDefaultPoolsList).pipe( T.Body("default_pools"), ), ), fallbackPool: S.optional(S.NullOr(S.String).pipe(T.Body("fallback_pool"))), locationStrategy: S.optional( S.NullOr(UpdateResponseLocationStrategy).pipe( T.Body("location_strategy"), ), ), popPools: S.optional( S.NullOr(UpdateResponseRulesItemOverridesPopPoolsMap).pipe( T.Body("pop_pools"), ), ), randomSteering: S.optional( S.NullOr(UpdateResponseRandomSteering).pipe(T.Body("random_steering")), ), regionPools: S.optional( S.NullOr(UpdateResponseRulesItemOverridesRegionPoolsMap).pipe( T.Body("region_pools"), ), ), sessionAffinity: S.optional( S.NullOr(UpdateResponseRulesItemOverridesSessionAffinity).pipe( T.Body("session_affinity"), ), ), sessionAffinityAttributes: S.optional( S.NullOr(UpdateResponseRulesItemOverridesSessionAffinityAttributes).pipe( T.Body("session_affinity_attributes"), ), ), sessionAffinityTtl: S.optional( S.NullOr(S.Number).pipe(T.Body("session_affinity_ttl")), ), steeringPolicy: S.optional( S.NullOr(UpdateResponseRulesItemOverridesSteeringPolicy).pipe( T.Body("steering_policy"), ), ), ttl: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "UpdateResponseRulesItemOverrides", }) as any as S.Schema; export interface UpdateResponseRulesItem { /** The condition expressions to evaluate. If the condition evaluates to true, the overrides or fixed_response in this rule will be applied. An empty condition is always true. For more details on condition expressions, please see https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions. */ condition?: string | null; /** Disable this specific rule. It will no longer be evaluated by this load balancer. */ disabled?: boolean | null; /** A collection of fields used to directly respond to the eyeball instead of routing to a pool. If a fixed_response is supplied the rule will be marked as terminates. */ fixedResponse?: CreateResponseRulesItemFixedResponse | null; /** Name of this rule. Only used for human readability. */ name?: string | null; /** A collection of overrides to apply to the load balancer when this rule's condition is true. All fields are optional. */ overrides?: UpdateResponseRulesItemOverrides | null; /** The order in which rules should be executed in relation to each other. Lower values are executed first. Values do not need to be sequential. If no value is provided for any rule the array order of the rules field will be used to assign a priority. */ priority?: number | null; /** If this rule's condition is true, this causes rule evaluation to stop after processing this rule. */ terminates?: boolean | null; } export const UpdateResponseRulesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ condition: S.optional(S.NullOr(S.String)), disabled: S.optional(S.NullOr(S.Boolean)), fixedResponse: S.optional( S.NullOr(CreateResponseRulesItemFixedResponse).pipe( T.Body("fixed_response"), ), ), name: S.optional(S.NullOr(S.String)), overrides: S.optional(S.NullOr(UpdateResponseRulesItemOverrides)), priority: S.optional(S.NullOr(S.Number)), terminates: S.optional(S.NullOr(S.Boolean)), }), ).annotate({ identifier: "UpdateResponseRulesItem", }) as any as S.Schema; export type UpdateResponseRulesList = Array; export const UpdateResponseRulesList = /*@__PURE__*/ S.Array( UpdateResponseRulesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdateLoadBalancerResponse { id?: string | null; /** Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin. */ adaptiveRouting?: CreateResponseAdaptiveRouting | null; /** A mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools. */ countryPools?: UpdateResponseCountryPoolsMap | null; createdOn?: string | null; /** A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region. */ defaultPools?: UpdateResponseDefaultPoolsList | null; /** Object description. */ description?: string | null; /** Whether to enable (the default) this load balancer. */ enabled?: boolean | null; /** The pool ID to use when all other pools are detected as unhealthy. */ fallbackPool?: string | null; /** Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected. */ locationStrategy?: UpdateResponseLocationStrategy | null; modifiedOn?: string | null; /** The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used. */ name?: string | null; /** List of networks where Load Balancer or Pool is enabled. */ networks?: UpdateResponseNetworksList | null; /** Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. */ popPools?: UpdateResponsePopPoolsMap | null; /** Whether the hostname should be gray clouded (false) or orange clouded (true). */ proxied?: boolean | null; /** Configures pool weights. */ randomSteering?: UpdateResponseRandomSteering | null; /** A mapping of region codes to a list of pool IDs (ordered by their failover priority) for the given region. Any regions not explicitly defined will fall back to using default_pools. */ regionPools?: UpdateResponseRegionPoolsMap | null; /** BETA Field Not General Access: A list of rules for this load balancer to execute. */ rules?: UpdateResponseRulesList | null; /** Specifies the type of session affinity the load balancer should use unless specified as `"none"`. 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. */ sessionAffinity?: UpdateResponseRulesItemOverridesSessionAffinity | null; /** Configures attributes for session affinity. */ sessionAffinityAttributes?: UpdateResponseRulesItemOverridesSessionAffinityAttributes | null; /** Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven't been used for the number of seconds specified. */ sessionAffinityTtl?: number | null; /** Steering Policy for this load balancer. */ steeringPolicy?: UpdateResponseRulesItemOverridesSteeringPolicy | null; /** Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers. */ ttl?: number | null; zoneName?: string | null; } export const UpdateLoadBalancerResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), adaptiveRouting: S.optional( S.NullOr(CreateResponseAdaptiveRouting).pipe(T.Body("adaptive_routing")), ), countryPools: S.optional( S.NullOr(UpdateResponseCountryPoolsMap).pipe(T.Body("country_pools")), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), defaultPools: S.optional( S.NullOr(UpdateResponseDefaultPoolsList).pipe(T.Body("default_pools")), ), description: S.optional(S.NullOr(S.String)), enabled: S.optional(S.NullOr(S.Boolean)), fallbackPool: S.optional(S.NullOr(S.String).pipe(T.Body("fallback_pool"))), locationStrategy: S.optional( S.NullOr(UpdateResponseLocationStrategy).pipe( T.Body("location_strategy"), ), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), networks: S.optional(S.NullOr(UpdateResponseNetworksList)), popPools: S.optional( S.NullOr(UpdateResponsePopPoolsMap).pipe(T.Body("pop_pools")), ), proxied: S.optional(S.NullOr(S.Boolean)), randomSteering: S.optional( S.NullOr(UpdateResponseRandomSteering).pipe(T.Body("random_steering")), ), regionPools: S.optional( S.NullOr(UpdateResponseRegionPoolsMap).pipe(T.Body("region_pools")), ), rules: S.optional(S.NullOr(UpdateResponseRulesList)), sessionAffinity: S.optional( S.NullOr(UpdateResponseRulesItemOverridesSessionAffinity).pipe( T.Body("session_affinity"), ), ), sessionAffinityAttributes: S.optional( S.NullOr(UpdateResponseRulesItemOverridesSessionAffinityAttributes).pipe( T.Body("session_affinity_attributes"), ), ), sessionAffinityTtl: S.optional( S.NullOr(S.Number).pipe(T.Body("session_affinity_ttl")), ), steeringPolicy: S.optional( S.NullOr(UpdateResponseRulesItemOverridesSteeringPolicy).pipe( T.Body("steering_policy"), ), ), ttl: S.optional(S.NullOr(S.Number)), zoneName: S.optional(S.NullOr(S.String).pipe(T.Body("zone_name"))), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateLoadBalancerResponse", }) as any as S.Schema; export type MonitorsUpdateRequestHeaderMap = { [key: string]: unknown | undefined; }; export const MonitorsUpdateRequestHeaderMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type MonitorsUpdateRequestType = | "http" | "https" | "tcp" | "udp_icmp" | "icmp_ping" | "smtp"; export const MonitorsUpdateRequestType = /*@__PURE__*/ S.String; export interface UpdateMonitorRequest { /** Identifier. */ accountId: string; monitorId: string; /** Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. */ allowInsecure?: boolean; /** To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times. */ consecutiveDown?: number; /** To be marked healthy the monitored origin must pass this healthcheck N consecutive times. */ consecutiveUp?: number; /** Object description. */ description?: string; /** A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors. */ expectedBody?: string; /** The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors. */ expectedCodes?: string; /** Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors. */ followRedirects?: boolean; /** The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors. */ header?: MonitorsUpdateRequestHeaderMap; /** The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations. */ interval?: number; /** The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks. */ method?: string; /** The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors. */ path?: string; /** The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443). */ port?: number; /** Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors. */ probeZone?: string; /** The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. */ retries?: number; /** The timeout (in seconds) before marking the health check as failed. */ timeout?: number; /** The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. */ type?: MonitorsUpdateRequestType | (string & {}); } export const UpdateMonitorRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), monitorId: S.String.pipe(T.Label("monitor_id")), allowInsecure: S.optional(S.Boolean.pipe(T.Body("allow_insecure"))), consecutiveDown: S.optional(S.Number.pipe(T.Body("consecutive_down"))), consecutiveUp: S.optional(S.Number.pipe(T.Body("consecutive_up"))), description: S.optional(S.String), expectedBody: S.optional(S.String.pipe(T.Body("expected_body"))), expectedCodes: S.optional(S.String.pipe(T.Body("expected_codes"))), followRedirects: S.optional(S.Boolean.pipe(T.Body("follow_redirects"))), header: S.optional(MonitorsUpdateRequestHeaderMap), interval: S.optional(S.Number), method: S.optional(S.String), path: S.optional(S.String), port: S.optional(S.Number), probeZone: S.optional(S.String.pipe(T.Body("probe_zone"))), retries: S.optional(S.Number), timeout: S.optional(S.Number), type: S.optional(MonitorsUpdateRequestType), }) .pipe( T.Http({ method: "PUT", uri: "/accounts/{account_id}/load_balancers/monitors/{monitor_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateMonitorRequest", }) as any as S.Schema; export type MonitorsUpdateResponseHeaderMap = { [key: string]: unknown | undefined; }; export const MonitorsUpdateResponseHeaderMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type MonitorsUpdateResponseType = | "http" | "https" | "tcp" | "udp_icmp" | "icmp_ping" | "smtp"; export const MonitorsUpdateResponseType = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdateMonitorResponse { id?: string | null; /** Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. */ allowInsecure?: boolean | null; /** To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times. */ consecutiveDown?: number | null; /** To be marked healthy the monitored origin must pass this healthcheck N consecutive times. */ consecutiveUp?: number | null; createdOn?: string | null; /** Object description. */ description?: string | null; /** A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors. */ expectedBody?: string | null; /** The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors. */ expectedCodes?: string | null; /** Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors. */ followRedirects?: boolean | null; /** The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors. */ header?: MonitorsUpdateResponseHeaderMap | null; /** The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations. */ interval?: number | null; /** The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks. */ method?: string | null; modifiedOn?: string | null; /** The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors. */ path?: string | null; /** The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443). */ port?: number | null; /** Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors. */ probeZone?: string | null; /** The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. */ retries?: number | null; /** The timeout (in seconds) before marking the health check as failed. */ timeout?: number | null; /** The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. */ type?: MonitorsUpdateResponseType | null; } export const UpdateMonitorResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), allowInsecure: S.optional( S.NullOr(S.Boolean).pipe(T.Body("allow_insecure")), ), consecutiveDown: S.optional( S.NullOr(S.Number).pipe(T.Body("consecutive_down")), ), consecutiveUp: S.optional( S.NullOr(S.Number).pipe(T.Body("consecutive_up")), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), description: S.optional(S.NullOr(S.String)), expectedBody: S.optional(S.NullOr(S.String).pipe(T.Body("expected_body"))), expectedCodes: S.optional( S.NullOr(S.String).pipe(T.Body("expected_codes")), ), followRedirects: S.optional( S.NullOr(S.Boolean).pipe(T.Body("follow_redirects")), ), header: S.optional(S.NullOr(MonitorsUpdateResponseHeaderMap)), interval: S.optional(S.NullOr(S.Number)), method: S.optional(S.NullOr(S.String)), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), path: S.optional(S.NullOr(S.String)), port: S.optional(S.NullOr(S.Number)), probeZone: S.optional(S.NullOr(S.String).pipe(T.Body("probe_zone"))), retries: S.optional(S.NullOr(S.Number)), timeout: S.optional(S.NullOr(S.Number)), type: S.optional(S.NullOr(MonitorsUpdateResponseType)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateMonitorResponse", }) as any as S.Schema; export type MonitorGroupsUpdateRequestMembersItem = MonitorGroupsCreateRequestMembersItem; export const MonitorGroupsUpdateRequestMembersItem = MonitorGroupsCreateRequestMembersItem; export type MonitorGroupsUpdateRequestMembersList = Array; export const MonitorGroupsUpdateRequestMembersList = /*@__PURE__*/ S.Array( MonitorGroupsCreateRequestMembersItem, ) as any as S.Schema; export interface UpdateMonitorGroupRequest { /** Identifier. */ accountId: string; monitorGroupId: string; /** A short description of the monitor group */ description: string; /** List of monitors in this group */ members: MonitorGroupsUpdateRequestMembersList; } export const UpdateMonitorGroupRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), monitorGroupId: S.String.pipe(T.Label("monitor_group_id")), description: S.String, members: MonitorGroupsUpdateRequestMembersList, }) .pipe( T.Http({ method: "PUT", uri: "/accounts/{account_id}/load_balancers/monitor_groups/{monitor_group_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateMonitorGroupRequest", }) as any as S.Schema; export type MonitorGroupsUpdateResponseMembersItem = MonitorGroupsCreateResponseMembersItem; export const MonitorGroupsUpdateResponseMembersItem = MonitorGroupsCreateResponseMembersItem; export type MonitorGroupsUpdateResponseMembersList = Array; export const MonitorGroupsUpdateResponseMembersList = /*@__PURE__*/ S.Array( MonitorGroupsCreateResponseMembersItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdateMonitorGroupResponse { /** The ID of the Monitor Group to use for checking the health of origins within this pool. */ id: string; /** A short description of the monitor group */ description: string; /** List of monitors in this group */ members: MonitorGroupsUpdateResponseMembersList; /** The timestamp of when the monitor group was created */ createdOn?: string | null; /** The timestamp of when the monitor group was last updated */ modifiedOn?: string | null; } export const UpdateMonitorGroupResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, description: S.String, members: MonitorGroupsUpdateResponseMembersList, createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateMonitorGroupResponse", }) as any as S.Schema; export type PoolsUpdateRequestOriginsItemHeaderHostList = Array; export const PoolsUpdateRequestOriginsItemHeaderHostList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface PoolsUpdateRequestOriginsItemHeader { /** The 'Host' header allows to override the hostname set in the HTTP request. Current support is 1 'Host' header override per origin. */ host?: PoolsUpdateRequestOriginsItemHeaderHostList; } export const PoolsUpdateRequestOriginsItemHeader = /*@__PURE__*/ S.suspend(() => S.Struct({ host: S.optional( PoolsUpdateRequestOriginsItemHeaderHostList.pipe(T.Body("Host")), ), }), ).annotate({ identifier: "PoolsUpdateRequestOriginsItemHeader", }) as any as S.Schema; export interface PoolsUpdateRequestOriginsItem { /** The IP address (IPv4 or IPv6) of the origin, or its publicly addressable hostname. Hostnames entered here should resolve directly to the origin, and not be a hostname proxied by Cloudflare. To set an internal/reserved address, virtual_network_id must also be set. */ address?: string; /** This field shows up only if the origin is disabled. This field is set with the time the origin was disabled. */ disabledAt?: string; /** Whether to enable (the default) this origin within the pool. Disabled origins will not receive traffic and are excluded from health checks. The origin will only be disabled for the current pool. */ enabled?: boolean; /** Whether to flatten CNAME records for this origin, resolving them to A/AAAA records before returning to the client. When true (the default), the director resolves CNAME addresses to their underlying A/AAAA records. When false, the origin address is returned as a raw CNAME record without resolution. This setting mirrors the DNS API record flatten_cname setting. */ flattenCname?: boolean; /** The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'. */ header?: PoolsUpdateRequestOriginsItemHeader; /** A human-identifiable name for the origin. */ name?: string; /** The port for upstream connections. A value of 0 means the default port for the protocol will be used. */ port?: number; /** The virtual network subnet ID the origin belongs in. Virtual network must also belong to the account. */ virtualNetworkId?: string; /** The weight of this origin relative to other origins in the pool. Based on the configured weight the total traffic is distributed among origins within the pool. */ weight?: number; } export const PoolsUpdateRequestOriginsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ address: S.optional(S.String), disabledAt: S.optional(S.String.pipe(T.Body("disabled_at"))), enabled: S.optional(S.Boolean), flattenCname: S.optional(S.Boolean.pipe(T.Body("flatten_cname"))), header: S.optional(PoolsUpdateRequestOriginsItemHeader), name: S.optional(S.String), port: S.optional(S.Number), virtualNetworkId: S.optional(S.String.pipe(T.Body("virtual_network_id"))), weight: S.optional(S.Number), }), ).annotate({ identifier: "PoolsUpdateRequestOriginsItem", }) as any as S.Schema; export type PoolsUpdateRequestOriginsList = Array; export const PoolsUpdateRequestOriginsList = /*@__PURE__*/ S.Array( PoolsUpdateRequestOriginsItem, ) as any as S.Schema; export type PoolsUpdateRequestCheckRegionsItem = | "WNAM" | "ENAM" | "WEU" | "EEU" | "NSAM" | "SSAM" | "OC" | "ME" | "NAF" | "SAF" | "SAS" | "SEAS" | "NEAS" | "ALL_REGIONS"; export const PoolsUpdateRequestCheckRegionsItem = /*@__PURE__*/ S.String; export type PoolsUpdateRequestCheckRegionsList = Array< PoolsUpdateRequestCheckRegionsItem | (string & {}) >; export const PoolsUpdateRequestCheckRegionsList = /*@__PURE__*/ S.Array( PoolsUpdateRequestCheckRegionsItem, ) as any as S.Schema; export type PoolsUpdateRequestLoadSheddingDefaultPolicy = "random" | "hash"; export const PoolsUpdateRequestLoadSheddingDefaultPolicy = /*@__PURE__*/ S.String; export type PoolsUpdateRequestLoadSheddingSessionPolicy = "hash"; export const PoolsUpdateRequestLoadSheddingSessionPolicy = /*@__PURE__*/ S.String; export interface PoolsUpdateRequestLoadShedding { /** The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity. */ defaultPercent?: number; /** The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs. */ defaultPolicy?: PoolsUpdateRequestLoadSheddingDefaultPolicy | (string & {}); /** The percent of existing sessions to shed from the pool, according to the session policy. */ sessionPercent?: number; /** Only the hash policy is supported for existing sessions (to avoid exponential decay). */ sessionPolicy?: PoolsUpdateRequestLoadSheddingSessionPolicy | (string & {}); } export const PoolsUpdateRequestLoadShedding = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultPercent: S.optional(S.Number.pipe(T.Body("default_percent"))), defaultPolicy: S.optional( PoolsUpdateRequestLoadSheddingDefaultPolicy.pipe( T.Body("default_policy"), ), ), sessionPercent: S.optional(S.Number.pipe(T.Body("session_percent"))), sessionPolicy: S.optional( PoolsUpdateRequestLoadSheddingSessionPolicy.pipe( T.Body("session_policy"), ), ), }), ).annotate({ identifier: "PoolsUpdateRequestLoadShedding", }) as any as S.Schema; export type PoolsUpdateRequestNotificationFilterOrigin = PoolsCreateRequestNotificationFilterOrigin; export const PoolsUpdateRequestNotificationFilterOrigin = PoolsCreateRequestNotificationFilterOrigin; export type PoolsUpdateRequestNotificationFilter = PoolsCreateRequestNotificationFilter; export const PoolsUpdateRequestNotificationFilter = PoolsCreateRequestNotificationFilter; export type PoolsUpdateRequestOriginSteeringPolicy = | "random" | "hash" | "least_outstanding_requests" | "least_connections"; export const PoolsUpdateRequestOriginSteeringPolicy = /*@__PURE__*/ S.String; export interface PoolsUpdateRequestOriginSteering { /** The type of origin steering policy to use. */ policy?: PoolsUpdateRequestOriginSteeringPolicy | (string & {}); } export const PoolsUpdateRequestOriginSteering = /*@__PURE__*/ S.suspend(() => S.Struct({ policy: S.optional(PoolsUpdateRequestOriginSteeringPolicy), }), ).annotate({ identifier: "PoolsUpdateRequestOriginSteering", }) as any as S.Schema; export interface UpdatePoolRequest { /** Identifier. */ accountId: string; poolId: string; /** A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed. */ name: string; /** The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. */ origins: PoolsUpdateRequestOriginsList; /** A list of regions from which to run health checks. Null means every Cloudflare data center. */ checkRegions?: PoolsUpdateRequestCheckRegionsList; /** A human-readable description of the pool. */ description?: string; /** Whether to enable (the default) or disable this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any). */ enabled?: boolean; /** The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set. */ latitude?: number; /** Configures load shedding policies and percentages for the pool. */ loadShedding?: PoolsUpdateRequestLoadShedding; /** The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set. */ longitude?: number; /** The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and will failover to the next available pool. */ minimumOrigins?: number; /** The ID of the Monitor to use for checking the health of origins within this pool. */ monitor?: string; /** The ID of the Monitor Group to use for checking the health of origins within this pool. */ monitorGroup?: string; /** This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address to send health status notifications to. This can be an individual mailbox or a mailing list. Multiple emails can be supplied as a comma delimited list. */ notificationEmail?: string; /** Filter pool and origin health notifications by resource type or health status. Use null to reset. */ notificationFilter?: PoolsCreateRequestNotificationFilter; /** Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity. */ originSteering?: PoolsUpdateRequestOriginSteering; } export const UpdatePoolRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), poolId: S.String.pipe(T.Label("pool_id")), name: S.String, origins: PoolsUpdateRequestOriginsList, checkRegions: S.optional( PoolsUpdateRequestCheckRegionsList.pipe(T.Body("check_regions")), ), description: S.optional(S.String), enabled: S.optional(S.Boolean), latitude: S.optional(S.Number), loadShedding: S.optional( PoolsUpdateRequestLoadShedding.pipe(T.Body("load_shedding")), ), longitude: S.optional(S.Number), minimumOrigins: S.optional(S.Number.pipe(T.Body("minimum_origins"))), monitor: S.optional(S.String), monitorGroup: S.optional(S.String.pipe(T.Body("monitor_group"))), notificationEmail: S.optional(S.String.pipe(T.Body("notification_email"))), notificationFilter: S.optional( PoolsCreateRequestNotificationFilter.pipe(T.Body("notification_filter")), ), originSteering: S.optional( PoolsUpdateRequestOriginSteering.pipe(T.Body("origin_steering")), ), }) .pipe( T.Http({ method: "PUT", uri: "/accounts/{account_id}/load_balancers/pools/{pool_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdatePoolRequest", }) as any as S.Schema; export type PoolsUpdateResponseCheckRegionsItem = | "WNAM" | "ENAM" | "WEU" | "EEU" | "NSAM" | "SSAM" | "OC" | "ME" | "NAF" | "SAF" | "SAS" | "SEAS" | "NEAS" | "ALL_REGIONS"; export const PoolsUpdateResponseCheckRegionsItem = /*@__PURE__*/ S.String; export type PoolsUpdateResponseCheckRegionsList = Array; export const PoolsUpdateResponseCheckRegionsList = /*@__PURE__*/ S.Array( PoolsUpdateResponseCheckRegionsItem, ) as any as S.Schema; export type PoolsUpdateResponseLoadSheddingDefaultPolicy = "random" | "hash"; export const PoolsUpdateResponseLoadSheddingDefaultPolicy = /*@__PURE__*/ S.String; export type PoolsUpdateResponseLoadSheddingSessionPolicy = "hash"; export const PoolsUpdateResponseLoadSheddingSessionPolicy = /*@__PURE__*/ S.String; export interface PoolsUpdateResponseLoadShedding { /** The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity. */ defaultPercent?: number | null; /** The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs. */ defaultPolicy?: PoolsUpdateResponseLoadSheddingDefaultPolicy | null; /** The percent of existing sessions to shed from the pool, according to the session policy. */ sessionPercent?: number | null; /** Only the hash policy is supported for existing sessions (to avoid exponential decay). */ sessionPolicy?: PoolsUpdateResponseLoadSheddingSessionPolicy | null; } export const PoolsUpdateResponseLoadShedding = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultPercent: S.optional( S.NullOr(S.Number).pipe(T.Body("default_percent")), ), defaultPolicy: S.optional( S.NullOr(PoolsUpdateResponseLoadSheddingDefaultPolicy).pipe( T.Body("default_policy"), ), ), sessionPercent: S.optional( S.NullOr(S.Number).pipe(T.Body("session_percent")), ), sessionPolicy: S.optional( S.NullOr(PoolsUpdateResponseLoadSheddingSessionPolicy).pipe( T.Body("session_policy"), ), ), }), ).annotate({ identifier: "PoolsUpdateResponseLoadShedding", }) as any as S.Schema; export type PoolsUpdateResponseNetworksList = Array; export const PoolsUpdateResponseNetworksList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type PoolsUpdateResponseNotificationFilterOrigin = PoolsBulkEditResultItemNotificationFilterOrigin; export const PoolsUpdateResponseNotificationFilterOrigin = PoolsBulkEditResultItemNotificationFilterOrigin; export type PoolsUpdateResponseNotificationFilter = PoolsBulkEditResultItemNotificationFilter; export const PoolsUpdateResponseNotificationFilter = PoolsBulkEditResultItemNotificationFilter; export type PoolsUpdateResponseOriginSteeringPolicy = | "random" | "hash" | "least_outstanding_requests" | "least_connections"; export const PoolsUpdateResponseOriginSteeringPolicy = /*@__PURE__*/ S.String; export interface PoolsUpdateResponseOriginSteering { /** The type of origin steering policy to use. */ policy?: PoolsUpdateResponseOriginSteeringPolicy | null; } export const PoolsUpdateResponseOriginSteering = /*@__PURE__*/ S.suspend(() => S.Struct({ policy: S.optional(S.NullOr(PoolsUpdateResponseOriginSteeringPolicy)), }), ).annotate({ identifier: "PoolsUpdateResponseOriginSteering", }) as any as S.Schema; export type PoolsUpdateResponseOriginsItemHeaderHostList = Array; export const PoolsUpdateResponseOriginsItemHeaderHostList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface PoolsUpdateResponseOriginsItemHeader { /** The 'Host' header allows to override the hostname set in the HTTP request. Current support is 1 'Host' header override per origin. */ host?: PoolsUpdateResponseOriginsItemHeaderHostList | null; } export const PoolsUpdateResponseOriginsItemHeader = /*@__PURE__*/ S.suspend( () => S.Struct({ host: S.optional( S.NullOr(PoolsUpdateResponseOriginsItemHeaderHostList).pipe( T.Body("Host"), ), ), }), ).annotate({ identifier: "PoolsUpdateResponseOriginsItemHeader", }) as any as S.Schema; export interface PoolsUpdateResponseOriginsItem { /** The IP address (IPv4 or IPv6) of the origin, or its publicly addressable hostname. Hostnames entered here should resolve directly to the origin, and not be a hostname proxied by Cloudflare. To set an internal/reserved address, virtual_network_id must also be set. */ address?: string | null; /** This field shows up only if the origin is disabled. This field is set with the time the origin was disabled. */ disabledAt?: string | null; /** Whether to enable (the default) this origin within the pool. Disabled origins will not receive traffic and are excluded from health checks. The origin will only be disabled for the current pool. */ enabled?: boolean | null; /** Whether to flatten CNAME records for this origin, resolving them to A/AAAA records before returning to the client. When true (the default), the director resolves CNAME addresses to their underlying A/AAAA records. When false, the origin address is returned as a raw CNAME record without resolution. This setting mirrors the DNS API record flatten_cname setting. */ flattenCname?: boolean | null; /** The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'. */ header?: PoolsUpdateResponseOriginsItemHeader | null; /** A human-identifiable name for the origin. */ name?: string | null; /** The port for upstream connections. A value of 0 means the default port for the protocol will be used. */ port?: number | null; /** The virtual network subnet ID the origin belongs in. Virtual network must also belong to the account. */ virtualNetworkId?: string | null; /** The weight of this origin relative to other origins in the pool. Based on the configured weight the total traffic is distributed among origins within the pool. */ weight?: number | null; } export const PoolsUpdateResponseOriginsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ address: S.optional(S.NullOr(S.String)), disabledAt: S.optional(S.NullOr(S.String).pipe(T.Body("disabled_at"))), enabled: S.optional(S.NullOr(S.Boolean)), flattenCname: S.optional(S.NullOr(S.Boolean).pipe(T.Body("flatten_cname"))), header: S.optional(S.NullOr(PoolsUpdateResponseOriginsItemHeader)), name: S.optional(S.NullOr(S.String)), port: S.optional(S.NullOr(S.Number)), virtualNetworkId: S.optional( S.NullOr(S.String).pipe(T.Body("virtual_network_id")), ), weight: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "PoolsUpdateResponseOriginsItem", }) as any as S.Schema; export type PoolsUpdateResponseOriginsList = Array; export const PoolsUpdateResponseOriginsList = /*@__PURE__*/ S.Array( PoolsUpdateResponseOriginsItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdatePoolResponse { id?: string | null; /** A list of regions from which to run health checks. Null means every Cloudflare data center. */ checkRegions?: PoolsUpdateResponseCheckRegionsList | null; createdOn?: string | null; /** A human-readable description of the pool. */ description?: string | null; /** This field shows up only if the pool is disabled. This field is set with the time the pool was disabled at. */ disabledAt?: string | null; /** Whether to enable (the default) or disable this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any). */ enabled?: boolean | null; /** The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set. */ latitude?: number | null; /** Configures load shedding policies and percentages for the pool. */ loadShedding?: PoolsUpdateResponseLoadShedding | null; /** The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set. */ longitude?: number | null; /** The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and will failover to the next available pool. */ minimumOrigins?: number | null; modifiedOn?: string | null; /** The ID of the Monitor to use for checking the health of origins within this pool. */ monitor?: string | null; /** The ID of the Monitor Group to use for checking the health of origins within this pool. */ monitorGroup?: string | null; /** A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed. */ name?: string | null; /** List of networks where Load Balancer or Pool is enabled. */ networks?: PoolsUpdateResponseNetworksList | null; /** This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address to send health status notifications to. This can be an individual mailbox or a mailing list. Multiple emails can be supplied as a comma delimited list. */ notificationEmail?: string | null; /** Filter pool and origin health notifications by resource type or health status. Use null to reset. */ notificationFilter?: PoolsBulkEditResultItemNotificationFilter | null; /** Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity. */ originSteering?: PoolsUpdateResponseOriginSteering | null; /** The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. */ origins?: PoolsUpdateResponseOriginsList | null; } export const UpdatePoolResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), checkRegions: S.optional( S.NullOr(PoolsUpdateResponseCheckRegionsList).pipe( T.Body("check_regions"), ), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), description: S.optional(S.NullOr(S.String)), disabledAt: S.optional(S.NullOr(S.String).pipe(T.Body("disabled_at"))), enabled: S.optional(S.NullOr(S.Boolean)), latitude: S.optional(S.NullOr(S.Number)), loadShedding: S.optional( S.NullOr(PoolsUpdateResponseLoadShedding).pipe(T.Body("load_shedding")), ), longitude: S.optional(S.NullOr(S.Number)), minimumOrigins: S.optional( S.NullOr(S.Number).pipe(T.Body("minimum_origins")), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), monitor: S.optional(S.NullOr(S.String)), monitorGroup: S.optional(S.NullOr(S.String).pipe(T.Body("monitor_group"))), name: S.optional(S.NullOr(S.String)), networks: S.optional(S.NullOr(PoolsUpdateResponseNetworksList)), notificationEmail: S.optional( S.NullOr(S.String).pipe(T.Body("notification_email")), ), notificationFilter: S.optional( S.NullOr(PoolsBulkEditResultItemNotificationFilter).pipe( T.Body("notification_filter"), ), ), originSteering: S.optional( S.NullOr(PoolsUpdateResponseOriginSteering).pipe( T.Body("origin_steering"), ), ), origins: S.optional(S.NullOr(PoolsUpdateResponseOriginsList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdatePoolResponse", }) as any as S.Schema; export type BulkPatchPoolsError = CloudflareOpError; /** Apply changes to a number of existing pools, overwriting the supplied properties. Pools are ordered by ascending `name`. Returns the list of affected pools. Supports the standard pagination query parameters, either `limit`/`offset` or `per_page`/`page`. */ export const bulkPatchPools: API.PaginatedOperationMethod< BulkPatchPoolsRequest, BulkPatchPoolsResponse, BulkPatchPoolsError, CloudflareOpContext, PoolsBulkEditResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: BulkPatchPoolsRequest, output: BulkPatchPoolsResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type CreateLoadBalancerError = | LoadBalancingNotEnabledForZone | Forbidden | CloudflareOpError; /** Create a new load balancer. */ export const createLoadBalancer: API.OperationMethod< CreateLoadBalancerRequest, CreateLoadBalancerResponse, CreateLoadBalancerError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateLoadBalancerRequest, output: CreateLoadBalancerResponse, errors: [ LoadBalancingNotEnabledForZone, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateMonitorError = | MonitorIntervalOutOfRange | Forbidden | CloudflareOpError; /** Create a configured monitor. */ export const createMonitor: API.OperationMethod< CreateMonitorRequest, CreateMonitorResponse, CreateMonitorError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateMonitorRequest, output: CreateMonitorResponse, errors: [ MonitorIntervalOutOfRange, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateMonitorGroupError = | MonitorGroupsNotEnabled | Forbidden | CloudflareOpError; /** Create a new monitor group. */ export const createMonitorGroup: API.OperationMethod< CreateMonitorGroupRequest, CreateMonitorGroupResponse, CreateMonitorGroupError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateMonitorGroupRequest, output: CreateMonitorGroupResponse, errors: [ MonitorGroupsNotEnabled, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateMonitorPreviewError = CloudflareOpError; /** Preview pools using the specified monitor with provided monitor details. The returned preview_id can be used in the preview endpoint to retrieve the results. */ export const createMonitorPreview: API.OperationMethod< CreateMonitorPreviewRequest, CreateMonitorPreviewResponse, CreateMonitorPreviewError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateMonitorPreviewRequest, output: CreateMonitorPreviewResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreatePoolError = PoolAccessFailed | Forbidden | CloudflareOpError; /** Create a new pool. */ export const createPool: API.OperationMethod< CreatePoolRequest, CreatePoolResponse, CreatePoolError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreatePoolRequest, output: CreatePoolResponse, errors: [PoolAccessFailed, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreatePoolHealthError = CloudflareOpError; /** Preview pool health using provided monitor details. The returned preview_id can be used in the preview endpoint to retrieve the results. */ export const createPoolHealth: API.OperationMethod< CreatePoolHealthRequest, CreatePoolHealthResponse, CreatePoolHealthError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreatePoolHealthRequest, output: CreatePoolHealthResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteLoadBalancerError = | LoadBalancerNotFound | Forbidden | CloudflareOpError; /** Delete a configured load balancer. */ export const deleteLoadBalancer: API.OperationMethod< DeleteLoadBalancerRequest, DeleteLoadBalancerResponse, DeleteLoadBalancerError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteLoadBalancerRequest, output: DeleteLoadBalancerResponse, errors: [ LoadBalancerNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteMonitorError = | MonitorNotFound | MonitorInUse | Forbidden | CloudflareOpError; /** Delete a configured monitor. */ export const deleteMonitor: API.OperationMethod< DeleteMonitorRequest, DeleteMonitorResponse, DeleteMonitorError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteMonitorRequest, output: DeleteMonitorResponse, errors: [ MonitorNotFound, MonitorInUse, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteMonitorGroupError = | MonitorGroupNotFound | MonitorGroupInUse | Forbidden | CloudflareOpError; /** Delete a configured monitor group. */ export const deleteMonitorGroup: API.OperationMethod< DeleteMonitorGroupRequest, DeleteMonitorGroupResponse, DeleteMonitorGroupError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteMonitorGroupRequest, output: DeleteMonitorGroupResponse, errors: [ MonitorGroupNotFound, MonitorGroupInUse, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeletePoolError = | PoolNotFound | PoolInUse | Forbidden | CloudflareOpError; /** Delete a configured pool. */ export const deletePool: API.OperationMethod< DeletePoolRequest, DeletePoolResponse, DeletePoolError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeletePoolRequest, output: DeletePoolResponse, errors: [ PoolNotFound, PoolInUse, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetLoadBalancerError = | LoadBalancerNotFound | Forbidden | CloudflareOpError; /** Fetch a single configured load balancer. */ export const getLoadBalancer: API.OperationMethod< GetLoadBalancerRequest, GetLoadBalancerResponse, GetLoadBalancerError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetLoadBalancerRequest, output: GetLoadBalancerResponse, errors: [ LoadBalancerNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetMonitorError = MonitorNotFound | Forbidden | CloudflareOpError; /** List a single configured monitor for an account. */ export const getMonitor: API.OperationMethod< GetMonitorRequest, GetMonitorResponse, GetMonitorError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetMonitorRequest, output: GetMonitorResponse, errors: [MonitorNotFound, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetMonitorGroupError = | MonitorGroupNotFound | Forbidden | CloudflareOpError; /** Fetch a single configured monitor group. */ export const getMonitorGroup: API.OperationMethod< GetMonitorGroupRequest, GetMonitorGroupResponse, GetMonitorGroupError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetMonitorGroupRequest, output: GetMonitorGroupResponse, errors: [ MonitorGroupNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetMonitorGroupReferenceError = CloudflareOpError; /** Get the list of resources that reference the provided monitor group. */ export const getMonitorGroupReference: API.PaginatedOperationMethod< GetMonitorGroupReferenceRequest, GetMonitorGroupReferenceResponse, GetMonitorGroupReferenceError, CloudflareOpContext, MonitorGroupsReferencesGetResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: GetMonitorGroupReferenceRequest, output: GetMonitorGroupReferenceResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type GetMonitorReferenceError = CloudflareOpError; /** Get the list of resources that reference the provided monitor. */ export const getMonitorReference: API.PaginatedOperationMethod< GetMonitorReferenceRequest, GetMonitorReferenceResponse, GetMonitorReferenceError, CloudflareOpContext, MonitorsReferencesGetResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: GetMonitorReferenceRequest, output: GetMonitorReferenceResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type GetPoolError = PoolNotFound | Forbidden | CloudflareOpError; /** Fetch a single configured pool. */ export const getPool: API.OperationMethod< GetPoolRequest, GetPoolResponse, GetPoolError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetPoolRequest, output: GetPoolResponse, errors: [PoolNotFound, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetPoolHealthError = CloudflareOpError; /** Fetch the latest pool health status for a single pool. */ export const getPoolHealth: API.OperationMethod< GetPoolHealthRequest, GetPoolHealthResponse, GetPoolHealthError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetPoolHealthRequest, output: GetPoolHealthResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetPoolReferenceError = CloudflareOpError; /** Get the list of resources that reference the provided pool. */ export const getPoolReference: API.PaginatedOperationMethod< GetPoolReferenceRequest, GetPoolReferenceResponse, GetPoolReferenceError, CloudflareOpContext, PoolsReferencesGetResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: GetPoolReferenceRequest, output: GetPoolReferenceResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type GetPreviewError = CloudflareOpError; /** Get the result of a previous preview operation using the provided preview_id. */ export const getPreview: API.OperationMethod< GetPreviewRequest, GetPreviewResponse, GetPreviewError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetPreviewRequest, output: GetPreviewResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetRegionError = CloudflareOpError; /** Get a single region mapping. */ export const getRegion: API.OperationMethod< GetRegionRequest, GetRegionResponse, GetRegionError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetRegionRequest, output: GetRegionResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListLoadBalancersError = CloudflareOpError; /** List configured load balancers. */ export const listLoadBalancers: API.PaginatedOperationMethod< ListLoadBalancersRequest, ListLoadBalancersResponse, ListLoadBalancersError, CloudflareOpContext, ListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListLoadBalancersRequest, output: ListLoadBalancersResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type ListMonitorGroupsError = CloudflareOpError; /** List configured monitor groups. */ export const listMonitorGroups: API.PaginatedOperationMethod< ListMonitorGroupsRequest, ListMonitorGroupsResponse, ListMonitorGroupsError, CloudflareOpContext, MonitorGroupsListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListMonitorGroupsRequest, output: ListMonitorGroupsResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type ListMonitorsError = CloudflareOpError; /** List configured monitors for an account. */ export const listMonitors: API.PaginatedOperationMethod< ListMonitorsRequest, ListMonitorsResponse, ListMonitorsError, CloudflareOpContext, MonitorsListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListMonitorsRequest, output: ListMonitorsResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type ListPoolsError = CloudflareOpError; /** List configured pools. */ export const listPools: API.PaginatedOperationMethod< ListPoolsRequest, ListPoolsResponse, ListPoolsError, CloudflareOpContext, PoolsListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListPoolsRequest, output: ListPoolsResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type ListRegionsError = CloudflareOpError; /** List all region mappings. */ export const listRegions: API.OperationMethod< ListRegionsRequest, ListRegionsResponse, ListRegionsError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListRegionsRequest, output: ListRegionsResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListSearchesError = CloudflareOpError; /** Search for Load Balancing resources. */ export const listSearches: API.OperationMethod< ListSearchesRequest, ListSearchesResponse, ListSearchesError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListSearchesRequest, output: ListSearchesResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PatchLoadBalancerError = CloudflareOpError; /** Apply changes to an existing load balancer, overwriting the supplied properties. */ export const patchLoadBalancer: API.OperationMethod< PatchLoadBalancerRequest, PatchLoadBalancerResponse, PatchLoadBalancerError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PatchLoadBalancerRequest, output: PatchLoadBalancerResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PatchMonitorError = CloudflareOpError; /** Apply changes to an existing monitor, overwriting the supplied properties. */ export const patchMonitor: API.OperationMethod< PatchMonitorRequest, PatchMonitorResponse, PatchMonitorError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PatchMonitorRequest, output: PatchMonitorResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PatchMonitorGroupError = CloudflareOpError; /** Apply changes to an existing monitor group, overwriting the supplied properties. */ export const patchMonitorGroup: API.OperationMethod< PatchMonitorGroupRequest, PatchMonitorGroupResponse, PatchMonitorGroupError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PatchMonitorGroupRequest, output: PatchMonitorGroupResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PatchPoolError = CloudflareOpError; /** Apply changes to an existing pool, overwriting the supplied properties. */ export const patchPool: API.OperationMethod< PatchPoolRequest, PatchPoolResponse, PatchPoolError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PatchPoolRequest, output: PatchPoolResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdateLoadBalancerError = | LoadBalancerNotFound | LoadBalancingNotEnabledForZone | Forbidden | CloudflareOpError; /** Update a configured load balancer. */ export const updateLoadBalancer: API.OperationMethod< UpdateLoadBalancerRequest, UpdateLoadBalancerResponse, UpdateLoadBalancerError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateLoadBalancerRequest, output: UpdateLoadBalancerResponse, errors: [ LoadBalancerNotFound, LoadBalancingNotEnabledForZone, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdateMonitorError = | MonitorNotFound | MonitorIntervalOutOfRange | Forbidden | CloudflareOpError; /** Modify a configured monitor. */ export const updateMonitor: API.OperationMethod< UpdateMonitorRequest, UpdateMonitorResponse, UpdateMonitorError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateMonitorRequest, output: UpdateMonitorResponse, errors: [ MonitorNotFound, MonitorIntervalOutOfRange, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdateMonitorGroupError = | MonitorGroupNotFound | MonitorGroupsNotEnabled | Forbidden | CloudflareOpError; /** Modify a configured monitor group. */ export const updateMonitorGroup: API.OperationMethod< UpdateMonitorGroupRequest, UpdateMonitorGroupResponse, UpdateMonitorGroupError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateMonitorGroupRequest, output: UpdateMonitorGroupResponse, errors: [ MonitorGroupNotFound, MonitorGroupsNotEnabled, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdatePoolError = | PoolNotFound | PoolAccessFailed | Forbidden | CloudflareOpError; /** Modify a configured pool. */ export const updatePool: API.OperationMethod< UpdatePoolRequest, UpdatePoolResponse, UpdatePoolError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdatePoolRequest, output: UpdatePoolResponse, errors: [ PoolNotFound, PoolAccessFailed, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, }));