// 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, type CloudflareOpError, type CloudflareOpContext, } from "../protocol.ts"; import { CloudflareError, CloudflareRateLimited } from "../errors.ts"; import * as Retry from "../retry.ts"; export type { CloudflareOpError, CloudflareOpContext }; export interface CacheReserveClearStatusRequest { /** Identifier. */ zoneId: string; } export const CacheReserveClearStatusRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }).pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/smart_shield/cache_reserve_clear", code: 200, }), ), ).annotate({ identifier: "CacheReserveClearStatusRequest", }) as any as S.Schema; export type CacheReserveClearStatusResponseId = "cache_reserve_clear"; export const CacheReserveClearStatusResponseId = /*@__PURE__*/ S.String; export type CacheReserveClearStatusResponseState = "In-progress" | "Completed"; export const CacheReserveClearStatusResponseState = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CacheReserveClearStatusResponse { /** ID of the zone setting. */ id: CacheReserveClearStatusResponseId; /** The time that the latest Cache Reserve Clear operation started. */ startTs: string; /** The current state of the Cache Reserve Clear operation. */ state: CacheReserveClearStatusResponseState; /** The time that the latest Cache Reserve Clear operation completed. */ endTs?: string | null; /** Last time this setting was modified. */ modifiedOn?: string | null; } export const CacheReserveClearStatusResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: CacheReserveClearStatusResponseId, startTs: S.String.pipe(T.Body("start_ts")), state: CacheReserveClearStatusResponseState, endTs: S.optional(S.NullOr(S.String).pipe(T.Body("end_ts"))), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), }), ).annotate({ identifier: "CacheReserveClearStatusResponse", }) as any as S.Schema; export interface ClearCacheReserveClearRequest { /** Identifier. */ zoneId: string; } export const ClearCacheReserveClearRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }).pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/smart_shield/cache_reserve_clear", code: 200, }), ), ).annotate({ identifier: "ClearCacheReserveClearRequest", }) as any as S.Schema; export type ClearCacheReserveClearResponseId = "cache_reserve_clear"; export const ClearCacheReserveClearResponseId = /*@__PURE__*/ S.String; export type ClearCacheReserveClearResponseState = "In-progress" | "Completed"; export const ClearCacheReserveClearResponseState = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface ClearCacheReserveClearResponse { /** ID of the zone setting. */ id: ClearCacheReserveClearResponseId; /** The time that the latest Cache Reserve Clear operation started. */ startTs: string; /** The current state of the Cache Reserve Clear operation. */ state: ClearCacheReserveClearResponseState; /** The time that the latest Cache Reserve Clear operation completed. */ endTs?: string | null; /** Last time this setting was modified. */ modifiedOn?: string | null; } export const ClearCacheReserveClearResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: ClearCacheReserveClearResponseId, startTs: S.String.pipe(T.Body("start_ts")), state: ClearCacheReserveClearResponseState, endTs: S.optional(S.NullOr(S.String).pipe(T.Body("end_ts"))), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), }), ).annotate({ identifier: "ClearCacheReserveClearResponse", }) as any as S.Schema; export type CreateHealthCheckRequestCheckRegionsItem = | "WNAM" | "ENAM" | "WEU" | "EEU" | "NSAM" | "SSAM" | "OC" | "ME" | "NAF" | "SAF" | "IN" | "SEAS" | "NEAS" | "ALL_REGIONS"; export const CreateHealthCheckRequestCheckRegionsItem = /*@__PURE__*/ S.String; export type CreateHealthCheckRequestCheckRegionsList = Array< CreateHealthCheckRequestCheckRegionsItem | (string & {}) >; export const CreateHealthCheckRequestCheckRegionsList = /*@__PURE__*/ S.Array( CreateHealthCheckRequestCheckRegionsItem, ) as any as S.Schema; export type CreateHealthCheckRequestHttpConfigExpectedCodesList = Array; export const CreateHealthCheckRequestHttpConfigExpectedCodesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type CreateHealthCheckRequestHttpConfigHeaderValueList = Array; export const CreateHealthCheckRequestHttpConfigHeaderValueList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type CreateHealthCheckRequestHttpConfigHeaderMap = { [key: string]: CreateHealthCheckRequestHttpConfigHeaderValueList | undefined; }; export const CreateHealthCheckRequestHttpConfigHeaderMap = /*@__PURE__*/ S.Record( S.String, CreateHealthCheckRequestHttpConfigHeaderValueList, ) as any as S.Schema; export type CreateHealthCheckRequestHttpConfigMethod = "GET" | "HEAD"; export const CreateHealthCheckRequestHttpConfigMethod = /*@__PURE__*/ S.String; export interface CreateHealthCheckRequestHttpConfig { /** Do not validate the certificate when the health check uses HTTPS. */ allowInsecure?: boolean; /** 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. */ expectedBody?: string; /** The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check. */ expectedCodes?: CreateHealthCheckRequestHttpConfigExpectedCodesList; /** Follow redirects if the origin returns a 3xx status code. */ 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. */ header?: CreateHealthCheckRequestHttpConfigHeaderMap; /** The HTTP method to use for the health check. */ method?: CreateHealthCheckRequestHttpConfigMethod | (string & {}); /** The endpoint path to health check against. */ path?: string; /** Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS. */ port?: number; } export const CreateHealthCheckRequestHttpConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ allowInsecure: S.optional(S.Boolean.pipe(T.Body("allow_insecure"))), expectedBody: S.optional(S.String.pipe(T.Body("expected_body"))), expectedCodes: S.optional( CreateHealthCheckRequestHttpConfigExpectedCodesList.pipe( T.Body("expected_codes"), ), ), followRedirects: S.optional(S.Boolean.pipe(T.Body("follow_redirects"))), header: S.optional(CreateHealthCheckRequestHttpConfigHeaderMap), method: S.optional(CreateHealthCheckRequestHttpConfigMethod), path: S.optional(S.String), port: S.optional(S.Number), }), ).annotate({ identifier: "CreateHealthCheckRequestHttpConfig", }) as any as S.Schema; export type CreateHealthCheckRequestTcpConfigMethod = "connection_established"; export const CreateHealthCheckRequestTcpConfigMethod = /*@__PURE__*/ S.String; export interface CreateHealthCheckRequestTcpConfig { /** The TCP connection method to use for the health check. */ method?: CreateHealthCheckRequestTcpConfigMethod | (string & {}); /** Port number to connect to for the health check. Defaults to 80. */ port?: number; } export const CreateHealthCheckRequestTcpConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ method: S.optional(CreateHealthCheckRequestTcpConfigMethod), port: S.optional(S.Number), }), ).annotate({ identifier: "CreateHealthCheckRequestTcpConfig", }) as any as S.Schema; export interface CreateHealthCheckRequest { /** Identifier. */ zoneId: string; /** The hostname or IP address of the origin server to run health checks on. */ address: string; /** A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed. */ name: string; /** A list of regions from which to run health checks. Null means Cloudflare will pick a default region. */ checkRegions?: CreateHealthCheckRequestCheckRegionsList; /** The number of consecutive fails required from a health check before changing the health to unhealthy. */ consecutiveFails?: number; /** The number of consecutive successes required from a health check before changing the health to healthy. */ consecutiveSuccesses?: number; /** A human-readable description of the health check. */ description?: string; /** Parameters specific to an HTTP or HTTPS health check. */ httpConfig?: CreateHealthCheckRequestHttpConfig; /** The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations. */ interval?: number; /** The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. */ retries?: number; /** If suspended, no health checks are sent to the origin. */ suspended?: boolean; /** Parameters specific to TCP health check. */ tcpConfig?: CreateHealthCheckRequestTcpConfig; /** 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' and 'TCP'. */ type?: string; } export const CreateHealthCheckRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), address: S.String, name: S.String, checkRegions: S.optional( CreateHealthCheckRequestCheckRegionsList.pipe(T.Body("check_regions")), ), consecutiveFails: S.optional(S.Number.pipe(T.Body("consecutive_fails"))), consecutiveSuccesses: S.optional( S.Number.pipe(T.Body("consecutive_successes")), ), description: S.optional(S.String), httpConfig: S.optional( CreateHealthCheckRequestHttpConfig.pipe(T.Body("http_config")), ), interval: S.optional(S.Number), retries: S.optional(S.Number), suspended: S.optional(S.Boolean), tcpConfig: S.optional( CreateHealthCheckRequestTcpConfig.pipe(T.Body("tcp_config")), ), timeout: S.optional(S.Number), type: S.optional(S.String), }).pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/smart_shield/healthchecks", code: 200, }), ), ).annotate({ identifier: "CreateHealthCheckRequest", }) as any as S.Schema; export type CreateHealthCheckResponseCheckRegionsItem = | "WNAM" | "ENAM" | "WEU" | "EEU" | "NSAM" | "SSAM" | "OC" | "ME" | "NAF" | "SAF" | "IN" | "SEAS" | "NEAS" | "ALL_REGIONS"; export const CreateHealthCheckResponseCheckRegionsItem = /*@__PURE__*/ S.String; export type CreateHealthCheckResponseCheckRegionsList = Array; export const CreateHealthCheckResponseCheckRegionsList = /*@__PURE__*/ S.Array( CreateHealthCheckResponseCheckRegionsItem, ) as any as S.Schema; export type CreateHealthCheckResponseHttpConfigExpectedCodesList = Array; export const CreateHealthCheckResponseHttpConfigExpectedCodesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type CreateHealthCheckResponseHttpConfigHeaderValueList = Array; export const CreateHealthCheckResponseHttpConfigHeaderValueList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type CreateHealthCheckResponseHttpConfigHeaderMap = { [key: string]: CreateHealthCheckResponseHttpConfigHeaderValueList | undefined; }; export const CreateHealthCheckResponseHttpConfigHeaderMap = /*@__PURE__*/ S.Record( S.String, CreateHealthCheckResponseHttpConfigHeaderValueList, ) as any as S.Schema; export type CreateHealthCheckResponseHttpConfigMethod = "GET" | "HEAD"; export const CreateHealthCheckResponseHttpConfigMethod = /*@__PURE__*/ S.String; export interface CreateHealthCheckResponseHttpConfig { /** Do not validate the certificate when the health check uses HTTPS. */ allowInsecure?: boolean | 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. */ expectedBody?: string | null; /** The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check. */ expectedCodes?: CreateHealthCheckResponseHttpConfigExpectedCodesList | null; /** Follow redirects if the origin returns a 3xx status code. */ 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. */ header?: CreateHealthCheckResponseHttpConfigHeaderMap | null; /** The HTTP method to use for the health check. */ method?: CreateHealthCheckResponseHttpConfigMethod | null; /** The endpoint path to health check against. */ path?: string | null; /** Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS. */ port?: number | null; } export const CreateHealthCheckResponseHttpConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ allowInsecure: S.optional( S.NullOr(S.Boolean).pipe(T.Body("allow_insecure")), ), expectedBody: S.optional(S.NullOr(S.String).pipe(T.Body("expected_body"))), expectedCodes: S.optional( S.NullOr(CreateHealthCheckResponseHttpConfigExpectedCodesList).pipe( T.Body("expected_codes"), ), ), followRedirects: S.optional( S.NullOr(S.Boolean).pipe(T.Body("follow_redirects")), ), header: S.optional(S.NullOr(CreateHealthCheckResponseHttpConfigHeaderMap)), method: S.optional(S.NullOr(CreateHealthCheckResponseHttpConfigMethod)), path: S.optional(S.NullOr(S.String)), port: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "CreateHealthCheckResponseHttpConfig", }) as any as S.Schema; export type CreateHealthCheckResponseStatus = | "unknown" | "healthy" | "unhealthy" | "suspended"; export const CreateHealthCheckResponseStatus = /*@__PURE__*/ S.String; export type CreateHealthCheckResponseTcpConfigMethod = "connection_established"; export const CreateHealthCheckResponseTcpConfigMethod = /*@__PURE__*/ S.String; export interface CreateHealthCheckResponseTcpConfig { /** The TCP connection method to use for the health check. */ method?: CreateHealthCheckResponseTcpConfigMethod | null; /** Port number to connect to for the health check. Defaults to 80. */ port?: number | null; } export const CreateHealthCheckResponseTcpConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ method: S.optional(S.NullOr(CreateHealthCheckResponseTcpConfigMethod)), port: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "CreateHealthCheckResponseTcpConfig", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateHealthCheckResponse { /** Identifier. */ id?: string | null; /** The hostname or IP address of the origin server to run health checks on. */ address?: string | null; /** A list of regions from which to run health checks. Null means Cloudflare will pick a default region. */ checkRegions?: CreateHealthCheckResponseCheckRegionsList | null; /** The number of consecutive fails required from a health check before changing the health to unhealthy. */ consecutiveFails?: number | null; /** The number of consecutive successes required from a health check before changing the health to healthy. */ consecutiveSuccesses?: number | null; createdOn?: string | null; /** A human-readable description of the health check. */ description?: string | null; /** The current failure reason if status is unhealthy. */ failureReason?: string | null; /** Parameters specific to an HTTP or HTTPS health check. */ httpConfig?: CreateHealthCheckResponseHttpConfig | null; /** The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations. */ interval?: number | null; modifiedOn?: string | null; /** A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed. */ name?: 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 current status of the origin server according to the health check. */ status?: CreateHealthCheckResponseStatus | null; /** If suspended, no health checks are sent to the origin. */ suspended?: boolean | null; /** Parameters specific to TCP health check. */ tcpConfig?: CreateHealthCheckResponseTcpConfig | 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' and 'TCP'. */ type?: string | null; } export const CreateHealthCheckResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), address: S.optional(S.NullOr(S.String)), checkRegions: S.optional( S.NullOr(CreateHealthCheckResponseCheckRegionsList).pipe( T.Body("check_regions"), ), ), consecutiveFails: S.optional( S.NullOr(S.Number).pipe(T.Body("consecutive_fails")), ), consecutiveSuccesses: S.optional( S.NullOr(S.Number).pipe(T.Body("consecutive_successes")), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), description: S.optional(S.NullOr(S.String)), failureReason: S.optional( S.NullOr(S.String).pipe(T.Body("failure_reason")), ), httpConfig: S.optional( S.NullOr(CreateHealthCheckResponseHttpConfig).pipe(T.Body("http_config")), ), interval: S.optional(S.NullOr(S.Number)), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), retries: S.optional(S.NullOr(S.Number)), status: S.optional(S.NullOr(CreateHealthCheckResponseStatus)), suspended: S.optional(S.NullOr(S.Boolean)), tcpConfig: S.optional( S.NullOr(CreateHealthCheckResponseTcpConfig).pipe(T.Body("tcp_config")), ), timeout: S.optional(S.NullOr(S.Number)), type: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "CreateHealthCheckResponse", }) as any as S.Schema; export interface DeleteHealthCheckRequest { /** Identifier. */ zoneId: string; /** Identifier. */ healthcheckId: string; } export const DeleteHealthCheckRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), healthcheckId: S.String.pipe(T.Label("healthcheck_id")), }).pipe( T.Http({ method: "DELETE", uri: "/zones/{zone_id}/smart_shield/healthchecks/{healthcheck_id}", code: 200, }), ), ).annotate({ identifier: "DeleteHealthCheckRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteHealthCheckResponse { /** Identifier. */ id?: string | null; } export const DeleteHealthCheckResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "DeleteHealthCheckResponse", }) as any as S.Schema; export type EditHealthCheckRequestCheckRegionsItem = | "WNAM" | "ENAM" | "WEU" | "EEU" | "NSAM" | "SSAM" | "OC" | "ME" | "NAF" | "SAF" | "IN" | "SEAS" | "NEAS" | "ALL_REGIONS"; export const EditHealthCheckRequestCheckRegionsItem = /*@__PURE__*/ S.String; export type EditHealthCheckRequestCheckRegionsList = Array< EditHealthCheckRequestCheckRegionsItem | (string & {}) >; export const EditHealthCheckRequestCheckRegionsList = /*@__PURE__*/ S.Array( EditHealthCheckRequestCheckRegionsItem, ) as any as S.Schema; export type EditHealthCheckRequestHttpConfigExpectedCodesList = Array; export const EditHealthCheckRequestHttpConfigExpectedCodesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type EditHealthCheckRequestHttpConfigHeaderValueList = Array; export const EditHealthCheckRequestHttpConfigHeaderValueList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type EditHealthCheckRequestHttpConfigHeaderMap = { [key: string]: EditHealthCheckRequestHttpConfigHeaderValueList | undefined; }; export const EditHealthCheckRequestHttpConfigHeaderMap = /*@__PURE__*/ S.Record( S.String, EditHealthCheckRequestHttpConfigHeaderValueList, ) as any as S.Schema; export type EditHealthCheckRequestHttpConfigMethod = "GET" | "HEAD"; export const EditHealthCheckRequestHttpConfigMethod = /*@__PURE__*/ S.String; export interface EditHealthCheckRequestHttpConfig { /** Do not validate the certificate when the health check uses HTTPS. */ allowInsecure?: boolean; /** 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. */ expectedBody?: string; /** The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check. */ expectedCodes?: EditHealthCheckRequestHttpConfigExpectedCodesList; /** Follow redirects if the origin returns a 3xx status code. */ 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. */ header?: EditHealthCheckRequestHttpConfigHeaderMap; /** The HTTP method to use for the health check. */ method?: EditHealthCheckRequestHttpConfigMethod | (string & {}); /** The endpoint path to health check against. */ path?: string; /** Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS. */ port?: number; } export const EditHealthCheckRequestHttpConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ allowInsecure: S.optional(S.Boolean.pipe(T.Body("allow_insecure"))), expectedBody: S.optional(S.String.pipe(T.Body("expected_body"))), expectedCodes: S.optional( EditHealthCheckRequestHttpConfigExpectedCodesList.pipe( T.Body("expected_codes"), ), ), followRedirects: S.optional(S.Boolean.pipe(T.Body("follow_redirects"))), header: S.optional(EditHealthCheckRequestHttpConfigHeaderMap), method: S.optional(EditHealthCheckRequestHttpConfigMethod), path: S.optional(S.String), port: S.optional(S.Number), }), ).annotate({ identifier: "EditHealthCheckRequestHttpConfig", }) as any as S.Schema; export type EditHealthCheckRequestTcpConfigMethod = "connection_established"; export const EditHealthCheckRequestTcpConfigMethod = /*@__PURE__*/ S.String; export interface EditHealthCheckRequestTcpConfig { /** The TCP connection method to use for the health check. */ method?: EditHealthCheckRequestTcpConfigMethod | (string & {}); /** Port number to connect to for the health check. Defaults to 80. */ port?: number; } export const EditHealthCheckRequestTcpConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ method: S.optional(EditHealthCheckRequestTcpConfigMethod), port: S.optional(S.Number), }), ).annotate({ identifier: "EditHealthCheckRequestTcpConfig", }) as any as S.Schema; export interface EditHealthCheckRequest { /** Identifier. */ zoneId: string; /** Identifier. */ healthcheckId: string; /** The hostname or IP address of the origin server to run health checks on. */ address: string; /** A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed. */ name: string; /** A list of regions from which to run health checks. Null means Cloudflare will pick a default region. */ checkRegions?: EditHealthCheckRequestCheckRegionsList; /** The number of consecutive fails required from a health check before changing the health to unhealthy. */ consecutiveFails?: number; /** The number of consecutive successes required from a health check before changing the health to healthy. */ consecutiveSuccesses?: number; /** A human-readable description of the health check. */ description?: string; /** Parameters specific to an HTTP or HTTPS health check. */ httpConfig?: EditHealthCheckRequestHttpConfig; /** The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations. */ interval?: number; /** The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. */ retries?: number; /** If suspended, no health checks are sent to the origin. */ suspended?: boolean; /** Parameters specific to TCP health check. */ tcpConfig?: EditHealthCheckRequestTcpConfig; /** 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' and 'TCP'. */ type?: string; } export const EditHealthCheckRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), healthcheckId: S.String.pipe(T.Label("healthcheck_id")), address: S.String, name: S.String, checkRegions: S.optional( EditHealthCheckRequestCheckRegionsList.pipe(T.Body("check_regions")), ), consecutiveFails: S.optional(S.Number.pipe(T.Body("consecutive_fails"))), consecutiveSuccesses: S.optional( S.Number.pipe(T.Body("consecutive_successes")), ), description: S.optional(S.String), httpConfig: S.optional( EditHealthCheckRequestHttpConfig.pipe(T.Body("http_config")), ), interval: S.optional(S.Number), retries: S.optional(S.Number), suspended: S.optional(S.Boolean), tcpConfig: S.optional( EditHealthCheckRequestTcpConfig.pipe(T.Body("tcp_config")), ), timeout: S.optional(S.Number), type: S.optional(S.String), }).pipe( T.Http({ method: "PATCH", uri: "/zones/{zone_id}/smart_shield/healthchecks/{healthcheck_id}", code: 200, }), ), ).annotate({ identifier: "EditHealthCheckRequest", }) as any as S.Schema; export type EditHealthCheckResponseCheckRegionsItem = | "WNAM" | "ENAM" | "WEU" | "EEU" | "NSAM" | "SSAM" | "OC" | "ME" | "NAF" | "SAF" | "IN" | "SEAS" | "NEAS" | "ALL_REGIONS"; export const EditHealthCheckResponseCheckRegionsItem = /*@__PURE__*/ S.String; export type EditHealthCheckResponseCheckRegionsList = Array; export const EditHealthCheckResponseCheckRegionsList = /*@__PURE__*/ S.Array( EditHealthCheckResponseCheckRegionsItem, ) as any as S.Schema; export type EditHealthCheckResponseHttpConfigExpectedCodesList = Array; export const EditHealthCheckResponseHttpConfigExpectedCodesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type EditHealthCheckResponseHttpConfigHeaderValueList = Array; export const EditHealthCheckResponseHttpConfigHeaderValueList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type EditHealthCheckResponseHttpConfigHeaderMap = { [key: string]: EditHealthCheckResponseHttpConfigHeaderValueList | undefined; }; export const EditHealthCheckResponseHttpConfigHeaderMap = /*@__PURE__*/ S.Record( S.String, EditHealthCheckResponseHttpConfigHeaderValueList, ) as any as S.Schema; export type EditHealthCheckResponseHttpConfigMethod = "GET" | "HEAD"; export const EditHealthCheckResponseHttpConfigMethod = /*@__PURE__*/ S.String; export interface EditHealthCheckResponseHttpConfig { /** Do not validate the certificate when the health check uses HTTPS. */ allowInsecure?: boolean | 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. */ expectedBody?: string | null; /** The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check. */ expectedCodes?: EditHealthCheckResponseHttpConfigExpectedCodesList | null; /** Follow redirects if the origin returns a 3xx status code. */ 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. */ header?: EditHealthCheckResponseHttpConfigHeaderMap | null; /** The HTTP method to use for the health check. */ method?: EditHealthCheckResponseHttpConfigMethod | null; /** The endpoint path to health check against. */ path?: string | null; /** Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS. */ port?: number | null; } export const EditHealthCheckResponseHttpConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ allowInsecure: S.optional( S.NullOr(S.Boolean).pipe(T.Body("allow_insecure")), ), expectedBody: S.optional(S.NullOr(S.String).pipe(T.Body("expected_body"))), expectedCodes: S.optional( S.NullOr(EditHealthCheckResponseHttpConfigExpectedCodesList).pipe( T.Body("expected_codes"), ), ), followRedirects: S.optional( S.NullOr(S.Boolean).pipe(T.Body("follow_redirects")), ), header: S.optional(S.NullOr(EditHealthCheckResponseHttpConfigHeaderMap)), method: S.optional(S.NullOr(EditHealthCheckResponseHttpConfigMethod)), path: S.optional(S.NullOr(S.String)), port: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "EditHealthCheckResponseHttpConfig", }) as any as S.Schema; export type EditHealthCheckResponseStatus = | "unknown" | "healthy" | "unhealthy" | "suspended"; export const EditHealthCheckResponseStatus = /*@__PURE__*/ S.String; export type EditHealthCheckResponseTcpConfigMethod = "connection_established"; export const EditHealthCheckResponseTcpConfigMethod = /*@__PURE__*/ S.String; export interface EditHealthCheckResponseTcpConfig { /** The TCP connection method to use for the health check. */ method?: EditHealthCheckResponseTcpConfigMethod | null; /** Port number to connect to for the health check. Defaults to 80. */ port?: number | null; } export const EditHealthCheckResponseTcpConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ method: S.optional(S.NullOr(EditHealthCheckResponseTcpConfigMethod)), port: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "EditHealthCheckResponseTcpConfig", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface EditHealthCheckResponse { /** Identifier. */ id?: string | null; /** The hostname or IP address of the origin server to run health checks on. */ address?: string | null; /** A list of regions from which to run health checks. Null means Cloudflare will pick a default region. */ checkRegions?: EditHealthCheckResponseCheckRegionsList | null; /** The number of consecutive fails required from a health check before changing the health to unhealthy. */ consecutiveFails?: number | null; /** The number of consecutive successes required from a health check before changing the health to healthy. */ consecutiveSuccesses?: number | null; createdOn?: string | null; /** A human-readable description of the health check. */ description?: string | null; /** The current failure reason if status is unhealthy. */ failureReason?: string | null; /** Parameters specific to an HTTP or HTTPS health check. */ httpConfig?: EditHealthCheckResponseHttpConfig | null; /** The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations. */ interval?: number | null; modifiedOn?: string | null; /** A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed. */ name?: 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 current status of the origin server according to the health check. */ status?: EditHealthCheckResponseStatus | null; /** If suspended, no health checks are sent to the origin. */ suspended?: boolean | null; /** Parameters specific to TCP health check. */ tcpConfig?: EditHealthCheckResponseTcpConfig | 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' and 'TCP'. */ type?: string | null; } export const EditHealthCheckResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), address: S.optional(S.NullOr(S.String)), checkRegions: S.optional( S.NullOr(EditHealthCheckResponseCheckRegionsList).pipe( T.Body("check_regions"), ), ), consecutiveFails: S.optional( S.NullOr(S.Number).pipe(T.Body("consecutive_fails")), ), consecutiveSuccesses: S.optional( S.NullOr(S.Number).pipe(T.Body("consecutive_successes")), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), description: S.optional(S.NullOr(S.String)), failureReason: S.optional( S.NullOr(S.String).pipe(T.Body("failure_reason")), ), httpConfig: S.optional( S.NullOr(EditHealthCheckResponseHttpConfig).pipe(T.Body("http_config")), ), interval: S.optional(S.NullOr(S.Number)), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), retries: S.optional(S.NullOr(S.Number)), status: S.optional(S.NullOr(EditHealthCheckResponseStatus)), suspended: S.optional(S.NullOr(S.Boolean)), tcpConfig: S.optional( S.NullOr(EditHealthCheckResponseTcpConfig).pipe(T.Body("tcp_config")), ), timeout: S.optional(S.NullOr(S.Number)), type: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "EditHealthCheckResponse", }) as any as S.Schema; export interface GetRequest { /** Identifier. */ zoneId: string; } export const GetRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }).pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/smart_shield", code: 200 }), ), ).annotate({ identifier: "GetRequest" }) as any as S.Schema; export type GetResponseCacheReserveValue = "on" | "off"; export const GetResponseCacheReserveValue = /*@__PURE__*/ S.String; export interface GetResponseCacheReserve { /** The id of the Cache Reserve setting. */ id?: string | null; /** Whether the setting is editable. */ editable?: boolean | null; /** Specifies the enablement value of Cache Reserve. */ value?: GetResponseCacheReserveValue | null; } export const GetResponseCacheReserve = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), editable: S.optional(S.NullOr(S.Boolean)), value: S.optional(S.NullOr(GetResponseCacheReserveValue)), }), ).annotate({ identifier: "GetResponseCacheReserve", }) as any as S.Schema; export type GetResponseRegionalTieredCacheValue = "on" | "off"; export const GetResponseRegionalTieredCacheValue = /*@__PURE__*/ S.String; export interface GetResponseRegionalTieredCache { /** The id of the Regional Tiered Cache setting. */ id?: string | null; /** Whether the setting is editable. */ editable?: boolean | null; /** Specifies the enablement value of Cache Reserve. */ value?: GetResponseRegionalTieredCacheValue | null; } export const GetResponseRegionalTieredCache = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), editable: S.optional(S.NullOr(S.Boolean)), value: S.optional(S.NullOr(GetResponseRegionalTieredCacheValue)), }), ).annotate({ identifier: "GetResponseRegionalTieredCache", }) as any as S.Schema; export type GetResponseSmartRoutingValue = "on" | "off"; export const GetResponseSmartRoutingValue = /*@__PURE__*/ S.String; export interface GetResponseSmartRouting { /** The id of the Smart Routing setting. */ id?: string | null; /** Whether the setting is editable. */ editable?: boolean | null; /** Specifies the enablement value of Argo Smart Routing. */ value?: GetResponseSmartRoutingValue | null; } export const GetResponseSmartRouting = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), editable: S.optional(S.NullOr(S.Boolean)), value: S.optional(S.NullOr(GetResponseSmartRoutingValue)), }), ).annotate({ identifier: "GetResponseSmartRouting", }) as any as S.Schema; export type GetResponseSmartTieredCacheValue = "on" | "off"; export const GetResponseSmartTieredCacheValue = /*@__PURE__*/ S.String; export interface GetResponseSmartTieredCache { /** The id of the Smart Tiered Cache setting. */ id?: string | null; /** Whether the setting is editable. */ editable?: boolean | null; /** The last time the setting was modified. */ modifiedOn?: string | null; /** Specifies the enablement value of Tiered Cache. */ value?: GetResponseSmartTieredCacheValue | null; } export const GetResponseSmartTieredCache = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), editable: S.optional(S.NullOr(S.Boolean)), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), value: S.optional(S.NullOr(GetResponseSmartTieredCacheValue)), }), ).annotate({ identifier: "GetResponseSmartTieredCache", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetResponse { cacheReserve: GetResponseCacheReserve; /** The total number of health checks associated with the zone. */ healthchecksCount: number; regionalTieredCache: GetResponseRegionalTieredCache; smartRouting: GetResponseSmartRouting; smartTieredCache: GetResponseSmartTieredCache; } export const GetResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ cacheReserve: GetResponseCacheReserve.pipe(T.Body("cache_reserve")), healthchecksCount: S.Number.pipe(T.Body("healthchecks_count")), regionalTieredCache: GetResponseRegionalTieredCache.pipe( T.Body("regional_tiered_cache"), ), smartRouting: GetResponseSmartRouting.pipe(T.Body("smart_routing")), smartTieredCache: GetResponseSmartTieredCache.pipe( T.Body("smart_tiered_cache"), ), }), ).annotate({ identifier: "GetResponse" }) as any as S.Schema; export interface GetHealthCheckRequest { /** Identifier. */ zoneId: string; /** Identifier. */ healthcheckId: string; } export const GetHealthCheckRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), healthcheckId: S.String.pipe(T.Label("healthcheck_id")), }).pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/smart_shield/healthchecks/{healthcheck_id}", code: 200, }), ), ).annotate({ identifier: "GetHealthCheckRequest", }) as any as S.Schema; export type GetHealthCheckResponseCheckRegionsItem = | "WNAM" | "ENAM" | "WEU" | "EEU" | "NSAM" | "SSAM" | "OC" | "ME" | "NAF" | "SAF" | "IN" | "SEAS" | "NEAS" | "ALL_REGIONS"; export const GetHealthCheckResponseCheckRegionsItem = /*@__PURE__*/ S.String; export type GetHealthCheckResponseCheckRegionsList = Array; export const GetHealthCheckResponseCheckRegionsList = /*@__PURE__*/ S.Array( GetHealthCheckResponseCheckRegionsItem, ) as any as S.Schema; export type GetHealthCheckResponseHttpConfigExpectedCodesList = Array; export const GetHealthCheckResponseHttpConfigExpectedCodesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type GetHealthCheckResponseHttpConfigHeaderValueList = Array; export const GetHealthCheckResponseHttpConfigHeaderValueList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type GetHealthCheckResponseHttpConfigHeaderMap = { [key: string]: GetHealthCheckResponseHttpConfigHeaderValueList | undefined; }; export const GetHealthCheckResponseHttpConfigHeaderMap = /*@__PURE__*/ S.Record( S.String, GetHealthCheckResponseHttpConfigHeaderValueList, ) as any as S.Schema; export type GetHealthCheckResponseHttpConfigMethod = "GET" | "HEAD"; export const GetHealthCheckResponseHttpConfigMethod = /*@__PURE__*/ S.String; export interface GetHealthCheckResponseHttpConfig { /** Do not validate the certificate when the health check uses HTTPS. */ allowInsecure?: boolean | 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. */ expectedBody?: string | null; /** The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check. */ expectedCodes?: GetHealthCheckResponseHttpConfigExpectedCodesList | null; /** Follow redirects if the origin returns a 3xx status code. */ 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. */ header?: GetHealthCheckResponseHttpConfigHeaderMap | null; /** The HTTP method to use for the health check. */ method?: GetHealthCheckResponseHttpConfigMethod | null; /** The endpoint path to health check against. */ path?: string | null; /** Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS. */ port?: number | null; } export const GetHealthCheckResponseHttpConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ allowInsecure: S.optional( S.NullOr(S.Boolean).pipe(T.Body("allow_insecure")), ), expectedBody: S.optional(S.NullOr(S.String).pipe(T.Body("expected_body"))), expectedCodes: S.optional( S.NullOr(GetHealthCheckResponseHttpConfigExpectedCodesList).pipe( T.Body("expected_codes"), ), ), followRedirects: S.optional( S.NullOr(S.Boolean).pipe(T.Body("follow_redirects")), ), header: S.optional(S.NullOr(GetHealthCheckResponseHttpConfigHeaderMap)), method: S.optional(S.NullOr(GetHealthCheckResponseHttpConfigMethod)), path: S.optional(S.NullOr(S.String)), port: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "GetHealthCheckResponseHttpConfig", }) as any as S.Schema; export type GetHealthCheckResponseStatus = | "unknown" | "healthy" | "unhealthy" | "suspended"; export const GetHealthCheckResponseStatus = /*@__PURE__*/ S.String; export type GetHealthCheckResponseTcpConfigMethod = "connection_established"; export const GetHealthCheckResponseTcpConfigMethod = /*@__PURE__*/ S.String; export interface GetHealthCheckResponseTcpConfig { /** The TCP connection method to use for the health check. */ method?: GetHealthCheckResponseTcpConfigMethod | null; /** Port number to connect to for the health check. Defaults to 80. */ port?: number | null; } export const GetHealthCheckResponseTcpConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ method: S.optional(S.NullOr(GetHealthCheckResponseTcpConfigMethod)), port: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "GetHealthCheckResponseTcpConfig", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetHealthCheckResponse { /** Identifier. */ id?: string | null; /** The hostname or IP address of the origin server to run health checks on. */ address?: string | null; /** A list of regions from which to run health checks. Null means Cloudflare will pick a default region. */ checkRegions?: GetHealthCheckResponseCheckRegionsList | null; /** The number of consecutive fails required from a health check before changing the health to unhealthy. */ consecutiveFails?: number | null; /** The number of consecutive successes required from a health check before changing the health to healthy. */ consecutiveSuccesses?: number | null; createdOn?: string | null; /** A human-readable description of the health check. */ description?: string | null; /** The current failure reason if status is unhealthy. */ failureReason?: string | null; /** Parameters specific to an HTTP or HTTPS health check. */ httpConfig?: GetHealthCheckResponseHttpConfig | null; /** The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations. */ interval?: number | null; modifiedOn?: string | null; /** A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed. */ name?: 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 current status of the origin server according to the health check. */ status?: GetHealthCheckResponseStatus | null; /** If suspended, no health checks are sent to the origin. */ suspended?: boolean | null; /** Parameters specific to TCP health check. */ tcpConfig?: GetHealthCheckResponseTcpConfig | 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' and 'TCP'. */ type?: string | null; } export const GetHealthCheckResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), address: S.optional(S.NullOr(S.String)), checkRegions: S.optional( S.NullOr(GetHealthCheckResponseCheckRegionsList).pipe( T.Body("check_regions"), ), ), consecutiveFails: S.optional( S.NullOr(S.Number).pipe(T.Body("consecutive_fails")), ), consecutiveSuccesses: S.optional( S.NullOr(S.Number).pipe(T.Body("consecutive_successes")), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), description: S.optional(S.NullOr(S.String)), failureReason: S.optional( S.NullOr(S.String).pipe(T.Body("failure_reason")), ), httpConfig: S.optional( S.NullOr(GetHealthCheckResponseHttpConfig).pipe(T.Body("http_config")), ), interval: S.optional(S.NullOr(S.Number)), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), retries: S.optional(S.NullOr(S.Number)), status: S.optional(S.NullOr(GetHealthCheckResponseStatus)), suspended: S.optional(S.NullOr(S.Boolean)), tcpConfig: S.optional( S.NullOr(GetHealthCheckResponseTcpConfig).pipe(T.Body("tcp_config")), ), timeout: S.optional(S.NullOr(S.Number)), type: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "GetHealthCheckResponse", }) as any as S.Schema; export interface ListHealthChecksRequest { /** Identifier. */ zoneId: string; /** Page number of paginated results. */ page?: number; /** Maximum number of results per page. Must be a multiple of 5. */ perPage?: number; } export const ListHealthChecksRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), }).pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/smart_shield/healthchecks", code: 200, }), ), ).annotate({ identifier: "ListHealthChecksRequest", }) as any as S.Schema; export type ListHealthChecksResultItemCheckRegionsItem = | "WNAM" | "ENAM" | "WEU" | "EEU" | "NSAM" | "SSAM" | "OC" | "ME" | "NAF" | "SAF" | "IN" | "SEAS" | "NEAS" | "ALL_REGIONS"; export const ListHealthChecksResultItemCheckRegionsItem = /*@__PURE__*/ S.String; export type ListHealthChecksResultItemCheckRegionsList = Array; export const ListHealthChecksResultItemCheckRegionsList = /*@__PURE__*/ S.Array( ListHealthChecksResultItemCheckRegionsItem, ) as any as S.Schema; export type ListHealthChecksResultItemHttpConfigExpectedCodesList = Array; export const ListHealthChecksResultItemHttpConfigExpectedCodesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ListHealthChecksResultItemHttpConfigHeaderValueList = Array; export const ListHealthChecksResultItemHttpConfigHeaderValueList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ListHealthChecksResultItemHttpConfigHeaderMap = { [key: string]: | ListHealthChecksResultItemHttpConfigHeaderValueList | undefined; }; export const ListHealthChecksResultItemHttpConfigHeaderMap = /*@__PURE__*/ S.Record( S.String, ListHealthChecksResultItemHttpConfigHeaderValueList, ) as any as S.Schema; export type ListHealthChecksResultItemHttpConfigMethod = "GET" | "HEAD"; export const ListHealthChecksResultItemHttpConfigMethod = /*@__PURE__*/ S.String; export interface ListHealthChecksResultItemHttpConfig { /** Do not validate the certificate when the health check uses HTTPS. */ allowInsecure?: boolean | 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. */ expectedBody?: string | null; /** The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check. */ expectedCodes?: ListHealthChecksResultItemHttpConfigExpectedCodesList | null; /** Follow redirects if the origin returns a 3xx status code. */ 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. */ header?: ListHealthChecksResultItemHttpConfigHeaderMap | null; /** The HTTP method to use for the health check. */ method?: ListHealthChecksResultItemHttpConfigMethod | null; /** The endpoint path to health check against. */ path?: string | null; /** Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS. */ port?: number | null; } export const ListHealthChecksResultItemHttpConfig = /*@__PURE__*/ S.suspend( () => S.Struct({ allowInsecure: S.optional( S.NullOr(S.Boolean).pipe(T.Body("allow_insecure")), ), expectedBody: S.optional( S.NullOr(S.String).pipe(T.Body("expected_body")), ), expectedCodes: S.optional( S.NullOr(ListHealthChecksResultItemHttpConfigExpectedCodesList).pipe( T.Body("expected_codes"), ), ), followRedirects: S.optional( S.NullOr(S.Boolean).pipe(T.Body("follow_redirects")), ), header: S.optional( S.NullOr(ListHealthChecksResultItemHttpConfigHeaderMap), ), method: S.optional(S.NullOr(ListHealthChecksResultItemHttpConfigMethod)), path: S.optional(S.NullOr(S.String)), port: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "ListHealthChecksResultItemHttpConfig", }) as any as S.Schema; export type ListHealthChecksResultItemStatus = | "unknown" | "healthy" | "unhealthy" | "suspended"; export const ListHealthChecksResultItemStatus = /*@__PURE__*/ S.String; export type ListHealthChecksResultItemTcpConfigMethod = "connection_established"; export const ListHealthChecksResultItemTcpConfigMethod = /*@__PURE__*/ S.String; export interface ListHealthChecksResultItemTcpConfig { /** The TCP connection method to use for the health check. */ method?: ListHealthChecksResultItemTcpConfigMethod | null; /** Port number to connect to for the health check. Defaults to 80. */ port?: number | null; } export const ListHealthChecksResultItemTcpConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ method: S.optional(S.NullOr(ListHealthChecksResultItemTcpConfigMethod)), port: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "ListHealthChecksResultItemTcpConfig", }) as any as S.Schema; export interface ListHealthChecksResultItem { /** Identifier. */ id?: string | null; /** The hostname or IP address of the origin server to run health checks on. */ address?: string | null; /** A list of regions from which to run health checks. Null means Cloudflare will pick a default region. */ checkRegions?: ListHealthChecksResultItemCheckRegionsList | null; /** The number of consecutive fails required from a health check before changing the health to unhealthy. */ consecutiveFails?: number | null; /** The number of consecutive successes required from a health check before changing the health to healthy. */ consecutiveSuccesses?: number | null; createdOn?: string | null; /** A human-readable description of the health check. */ description?: string | null; /** The current failure reason if status is unhealthy. */ failureReason?: string | null; /** Parameters specific to an HTTP or HTTPS health check. */ httpConfig?: ListHealthChecksResultItemHttpConfig | null; /** The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations. */ interval?: number | null; modifiedOn?: string | null; /** A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed. */ name?: 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 current status of the origin server according to the health check. */ status?: ListHealthChecksResultItemStatus | null; /** If suspended, no health checks are sent to the origin. */ suspended?: boolean | null; /** Parameters specific to TCP health check. */ tcpConfig?: ListHealthChecksResultItemTcpConfig | 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' and 'TCP'. */ type?: string | null; } export const ListHealthChecksResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), address: S.optional(S.NullOr(S.String)), checkRegions: S.optional( S.NullOr(ListHealthChecksResultItemCheckRegionsList).pipe( T.Body("check_regions"), ), ), consecutiveFails: S.optional( S.NullOr(S.Number).pipe(T.Body("consecutive_fails")), ), consecutiveSuccesses: S.optional( S.NullOr(S.Number).pipe(T.Body("consecutive_successes")), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), description: S.optional(S.NullOr(S.String)), failureReason: S.optional( S.NullOr(S.String).pipe(T.Body("failure_reason")), ), httpConfig: S.optional( S.NullOr(ListHealthChecksResultItemHttpConfig).pipe( T.Body("http_config"), ), ), interval: S.optional(S.NullOr(S.Number)), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), retries: S.optional(S.NullOr(S.Number)), status: S.optional(S.NullOr(ListHealthChecksResultItemStatus)), suspended: S.optional(S.NullOr(S.Boolean)), tcpConfig: S.optional( S.NullOr(ListHealthChecksResultItemTcpConfig).pipe(T.Body("tcp_config")), ), timeout: S.optional(S.NullOr(S.Number)), type: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "ListHealthChecksResultItem", }) as any as S.Schema; export type ListHealthChecksResultList = Array; export const ListHealthChecksResultList = /*@__PURE__*/ S.Array( ListHealthChecksResultItem, ) as any as S.Schema; export type ListHealthChecksResponse = ListHealthChecksResultList; export const ListHealthChecksResponse = /*@__PURE__*/ S.suspend(() => ListHealthChecksResultList.pipe(T.EnvelopePayloadRoot()), ).annotate({ identifier: "ListHealthChecksResponse", }) as any as S.Schema; export type UpdateRequestCacheReserveValue = "on" | "off"; export const UpdateRequestCacheReserveValue = /*@__PURE__*/ S.String; export interface UpdateRequestCacheReserve { /** Specifies the enablement value of Cache Reserve. */ value?: UpdateRequestCacheReserveValue | (string & {}); } export const UpdateRequestCacheReserve = /*@__PURE__*/ S.suspend(() => S.Struct({ value: S.optional(UpdateRequestCacheReserveValue), }), ).annotate({ identifier: "UpdateRequestCacheReserve", }) as any as S.Schema; export type UpdateRequestRegionalTieredCacheValue = "on" | "off"; export const UpdateRequestRegionalTieredCacheValue = /*@__PURE__*/ S.String; export interface UpdateRequestRegionalTieredCache { /** Specifies the enablement value of Regional Tiered Cache. */ value?: UpdateRequestRegionalTieredCacheValue | (string & {}); } export const UpdateRequestRegionalTieredCache = /*@__PURE__*/ S.suspend(() => S.Struct({ value: S.optional(UpdateRequestRegionalTieredCacheValue), }), ).annotate({ identifier: "UpdateRequestRegionalTieredCache", }) as any as S.Schema; export type UpdateRequestSmartRoutingValue = "on" | "off"; export const UpdateRequestSmartRoutingValue = /*@__PURE__*/ S.String; export interface UpdateRequestSmartRouting { /** Specifies the enablement value of Smart Routing. */ value?: UpdateRequestSmartRoutingValue | (string & {}); } export const UpdateRequestSmartRouting = /*@__PURE__*/ S.suspend(() => S.Struct({ value: S.optional(UpdateRequestSmartRoutingValue), }), ).annotate({ identifier: "UpdateRequestSmartRouting", }) as any as S.Schema; export type UpdateRequestSmartTieredCacheValue = "on" | "off"; export const UpdateRequestSmartTieredCacheValue = /*@__PURE__*/ S.String; export interface UpdateRequestSmartTieredCache { /** Specifies the enablement value of Smart Tiered Cache. */ value?: UpdateRequestSmartTieredCacheValue | (string & {}); } export const UpdateRequestSmartTieredCache = /*@__PURE__*/ S.suspend(() => S.Struct({ value: S.optional(UpdateRequestSmartTieredCacheValue), }), ).annotate({ identifier: "UpdateRequestSmartTieredCache", }) as any as S.Schema; export interface UpdateRequest { /** Identifier. */ zoneId: string; cacheReserve?: UpdateRequestCacheReserve; regionalTieredCache?: UpdateRequestRegionalTieredCache; smartRouting?: UpdateRequestSmartRouting; smartTieredCache?: UpdateRequestSmartTieredCache; } export const UpdateRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), cacheReserve: S.optional( UpdateRequestCacheReserve.pipe(T.Body("cache_reserve")), ), regionalTieredCache: S.optional( UpdateRequestRegionalTieredCache.pipe(T.Body("regional_tiered_cache")), ), smartRouting: S.optional( UpdateRequestSmartRouting.pipe(T.Body("smart_routing")), ), smartTieredCache: S.optional( UpdateRequestSmartTieredCache.pipe(T.Body("smart_tiered_cache")), ), }).pipe( T.Http({ method: "PATCH", uri: "/zones/{zone_id}/smart_shield", code: 200, }), ), ).annotate({ identifier: "UpdateRequest" }) as any as S.Schema; export type UpdateResponseSmartTieredCacheValue = "on" | "off"; export const UpdateResponseSmartTieredCacheValue = /*@__PURE__*/ S.String; export interface UpdateResponseSmartTieredCache { /** The id of the Smart Tiered Cache setting. */ id?: string | null; /** Whether the setting is editable. */ editable?: boolean | null; /** The last time the setting was modified. */ modifiedOn?: string | null; /** Specifies the enablement value of Tiered Cache. */ value?: UpdateResponseSmartTieredCacheValue | null; } export const UpdateResponseSmartTieredCache = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), editable: S.optional(S.NullOr(S.Boolean)), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), value: S.optional(S.NullOr(UpdateResponseSmartTieredCacheValue)), }), ).annotate({ identifier: "UpdateResponseSmartTieredCache", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdateResponse { smartTieredCache: UpdateResponseSmartTieredCache; } export const UpdateResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ smartTieredCache: UpdateResponseSmartTieredCache.pipe( T.Body("smart_tiered_cache"), ), }), ).annotate({ identifier: "UpdateResponse" }) as any as S.Schema; export interface UpdateHealthCheckRequestErrorsItemSource { pointer?: string; } export const UpdateHealthCheckRequestErrorsItemSource = /*@__PURE__*/ S.suspend( () => S.Struct({ pointer: S.optional(S.String), }), ).annotate({ identifier: "UpdateHealthCheckRequestErrorsItemSource", }) as any as S.Schema; export interface UpdateHealthCheckRequestErrorsItem { code: number; message: string; documentationUrl?: string; source?: UpdateHealthCheckRequestErrorsItemSource; } export const UpdateHealthCheckRequestErrorsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ code: S.Number, message: S.String, documentationUrl: S.optional(S.String.pipe(T.Body("documentation_url"))), source: S.optional(UpdateHealthCheckRequestErrorsItemSource), }), ).annotate({ identifier: "UpdateHealthCheckRequestErrorsItem", }) as any as S.Schema; export type UpdateHealthCheckRequestErrorsList = Array; export const UpdateHealthCheckRequestErrorsList = /*@__PURE__*/ S.Array( UpdateHealthCheckRequestErrorsItem, ) as any as S.Schema; export interface UpdateHealthCheckRequestMessagesItem { code: number; message: string; documentationUrl?: string; source?: unknown; } export const UpdateHealthCheckRequestMessagesItem = /*@__PURE__*/ S.suspend( () => S.Struct({ code: S.Number, message: S.String, documentationUrl: S.optional(S.String.pipe(T.Body("documentation_url"))), source: S.optional(S.Unknown), }), ).annotate({ identifier: "UpdateHealthCheckRequestMessagesItem", }) as any as S.Schema; export type UpdateHealthCheckRequestMessagesList = Array; export const UpdateHealthCheckRequestMessagesList = /*@__PURE__*/ S.Array( UpdateHealthCheckRequestMessagesItem, ) as any as S.Schema; export type UpdateHealthCheckRequestResultCheckRegionsItem = | "WNAM" | "ENAM" | "WEU" | "EEU" | "NSAM" | "SSAM" | "OC" | "ME" | "NAF" | "SAF" | "IN" | "SEAS" | "NEAS" | "ALL_REGIONS"; export const UpdateHealthCheckRequestResultCheckRegionsItem = /*@__PURE__*/ S.String; export type UpdateHealthCheckRequestResultCheckRegionsList = Array< UpdateHealthCheckRequestResultCheckRegionsItem | (string & {}) >; export const UpdateHealthCheckRequestResultCheckRegionsList = /*@__PURE__*/ S.Array( UpdateHealthCheckRequestResultCheckRegionsItem, ) as any as S.Schema; export type UpdateHealthCheckRequestResultHttpConfigExpectedCodesList = Array; export const UpdateHealthCheckRequestResultHttpConfigExpectedCodesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type UpdateHealthCheckRequestResultHttpConfigHeaderValueList = Array; export const UpdateHealthCheckRequestResultHttpConfigHeaderValueList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type UpdateHealthCheckRequestResultHttpConfigHeaderMap = { [key: string]: | UpdateHealthCheckRequestResultHttpConfigHeaderValueList | undefined; }; export const UpdateHealthCheckRequestResultHttpConfigHeaderMap = /*@__PURE__*/ S.Record( S.String, UpdateHealthCheckRequestResultHttpConfigHeaderValueList, ) as any as S.Schema; export type UpdateHealthCheckRequestResultHttpConfigMethod = "GET" | "HEAD"; export const UpdateHealthCheckRequestResultHttpConfigMethod = /*@__PURE__*/ S.String; export interface UpdateHealthCheckRequestResultHttpConfig { /** Do not validate the certificate when the health check uses HTTPS. */ allowInsecure?: boolean; /** 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. */ expectedBody?: string; /** The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check. */ expectedCodes?: UpdateHealthCheckRequestResultHttpConfigExpectedCodesList; /** Follow redirects if the origin returns a 3xx status code. */ 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. */ header?: UpdateHealthCheckRequestResultHttpConfigHeaderMap; /** The HTTP method to use for the health check. */ method?: UpdateHealthCheckRequestResultHttpConfigMethod | (string & {}); /** The endpoint path to health check against. */ path?: string; /** Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS. */ port?: number; } export const UpdateHealthCheckRequestResultHttpConfig = /*@__PURE__*/ S.suspend( () => S.Struct({ allowInsecure: S.optional(S.Boolean.pipe(T.Body("allow_insecure"))), expectedBody: S.optional(S.String.pipe(T.Body("expected_body"))), expectedCodes: S.optional( UpdateHealthCheckRequestResultHttpConfigExpectedCodesList.pipe( T.Body("expected_codes"), ), ), followRedirects: S.optional(S.Boolean.pipe(T.Body("follow_redirects"))), header: S.optional(UpdateHealthCheckRequestResultHttpConfigHeaderMap), method: S.optional(UpdateHealthCheckRequestResultHttpConfigMethod), path: S.optional(S.String), port: S.optional(S.Number), }), ).annotate({ identifier: "UpdateHealthCheckRequestResultHttpConfig", }) as any as S.Schema; export type UpdateHealthCheckRequestResultStatus = | "unknown" | "healthy" | "unhealthy" | "suspended"; export const UpdateHealthCheckRequestResultStatus = /*@__PURE__*/ S.String; export type UpdateHealthCheckRequestResultTcpConfigMethod = "connection_established"; export const UpdateHealthCheckRequestResultTcpConfigMethod = /*@__PURE__*/ S.String; export interface UpdateHealthCheckRequestResultTcpConfig { /** The TCP connection method to use for the health check. */ method?: UpdateHealthCheckRequestResultTcpConfigMethod | (string & {}); /** Port number to connect to for the health check. Defaults to 80. */ port?: number; } export const UpdateHealthCheckRequestResultTcpConfig = /*@__PURE__*/ S.suspend( () => S.Struct({ method: S.optional(UpdateHealthCheckRequestResultTcpConfigMethod), port: S.optional(S.Number), }), ).annotate({ identifier: "UpdateHealthCheckRequestResultTcpConfig", }) as any as S.Schema; export interface UpdateHealthCheckRequestResult { /** Identifier. */ id?: string; /** The hostname or IP address of the origin server to run health checks on. */ address?: string; /** A list of regions from which to run health checks. Null means Cloudflare will pick a default region. */ checkRegions?: UpdateHealthCheckRequestResultCheckRegionsList; /** The number of consecutive fails required from a health check before changing the health to unhealthy. */ consecutiveFails?: number; /** The number of consecutive successes required from a health check before changing the health to healthy. */ consecutiveSuccesses?: number; createdOn?: string; /** A human-readable description of the health check. */ description?: string; /** The current failure reason if status is unhealthy. */ failureReason?: string; /** Parameters specific to an HTTP or HTTPS health check. */ httpConfig?: UpdateHealthCheckRequestResultHttpConfig; /** The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations. */ interval?: number; modifiedOn?: string; /** A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed. */ name?: 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 current status of the origin server according to the health check. */ status?: UpdateHealthCheckRequestResultStatus | (string & {}); /** If suspended, no health checks are sent to the origin. */ suspended?: boolean; /** Parameters specific to TCP health check. */ tcpConfig?: UpdateHealthCheckRequestResultTcpConfig; /** 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' and 'TCP'. */ type?: string; } export const UpdateHealthCheckRequestResult = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.String), address: S.optional(S.String), checkRegions: S.optional( UpdateHealthCheckRequestResultCheckRegionsList.pipe( T.Body("check_regions"), ), ), consecutiveFails: S.optional(S.Number.pipe(T.Body("consecutive_fails"))), consecutiveSuccesses: S.optional( S.Number.pipe(T.Body("consecutive_successes")), ), createdOn: S.optional(S.String.pipe(T.Body("created_on"))), description: S.optional(S.String), failureReason: S.optional(S.String.pipe(T.Body("failure_reason"))), httpConfig: S.optional( UpdateHealthCheckRequestResultHttpConfig.pipe(T.Body("http_config")), ), interval: S.optional(S.Number), modifiedOn: S.optional(S.String.pipe(T.Body("modified_on"))), name: S.optional(S.String), retries: S.optional(S.Number), status: S.optional(UpdateHealthCheckRequestResultStatus), suspended: S.optional(S.Boolean), tcpConfig: S.optional( UpdateHealthCheckRequestResultTcpConfig.pipe(T.Body("tcp_config")), ), timeout: S.optional(S.Number), type: S.optional(S.String), }), ).annotate({ identifier: "UpdateHealthCheckRequestResult", }) as any as S.Schema; export interface UpdateHealthCheckRequest { /** Identifier. */ zoneId: string; /** Identifier. */ healthcheckId: string; errors: UpdateHealthCheckRequestErrorsList; messages: UpdateHealthCheckRequestMessagesList; result: UpdateHealthCheckRequestResult; /** Whether the API call was successful. */ success: boolean; } export const UpdateHealthCheckRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), healthcheckId: S.String.pipe(T.Label("healthcheck_id")), errors: UpdateHealthCheckRequestErrorsList, messages: UpdateHealthCheckRequestMessagesList, result: UpdateHealthCheckRequestResult, success: S.Boolean, }).pipe( T.Http({ method: "PUT", uri: "/zones/{zone_id}/smart_shield/healthchecks/{healthcheck_id}", code: 200, }), ), ).annotate({ identifier: "UpdateHealthCheckRequest", }) as any as S.Schema; export type UpdateHealthCheckResponseCheckRegionsItem = | "WNAM" | "ENAM" | "WEU" | "EEU" | "NSAM" | "SSAM" | "OC" | "ME" | "NAF" | "SAF" | "IN" | "SEAS" | "NEAS" | "ALL_REGIONS"; export const UpdateHealthCheckResponseCheckRegionsItem = /*@__PURE__*/ S.String; export type UpdateHealthCheckResponseCheckRegionsList = Array; export const UpdateHealthCheckResponseCheckRegionsList = /*@__PURE__*/ S.Array( UpdateHealthCheckResponseCheckRegionsItem, ) as any as S.Schema; export type UpdateHealthCheckResponseHttpConfigExpectedCodesList = Array; export const UpdateHealthCheckResponseHttpConfigExpectedCodesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type UpdateHealthCheckResponseHttpConfigHeaderValueList = Array; export const UpdateHealthCheckResponseHttpConfigHeaderValueList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type UpdateHealthCheckResponseHttpConfigHeaderMap = { [key: string]: UpdateHealthCheckResponseHttpConfigHeaderValueList | undefined; }; export const UpdateHealthCheckResponseHttpConfigHeaderMap = /*@__PURE__*/ S.Record( S.String, UpdateHealthCheckResponseHttpConfigHeaderValueList, ) as any as S.Schema; export type UpdateHealthCheckResponseHttpConfigMethod = "GET" | "HEAD"; export const UpdateHealthCheckResponseHttpConfigMethod = /*@__PURE__*/ S.String; export interface UpdateHealthCheckResponseHttpConfig { /** Do not validate the certificate when the health check uses HTTPS. */ allowInsecure?: boolean | 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. */ expectedBody?: string | null; /** The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check. */ expectedCodes?: UpdateHealthCheckResponseHttpConfigExpectedCodesList | null; /** Follow redirects if the origin returns a 3xx status code. */ 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. */ header?: UpdateHealthCheckResponseHttpConfigHeaderMap | null; /** The HTTP method to use for the health check. */ method?: UpdateHealthCheckResponseHttpConfigMethod | null; /** The endpoint path to health check against. */ path?: string | null; /** Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS. */ port?: number | null; } export const UpdateHealthCheckResponseHttpConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ allowInsecure: S.optional( S.NullOr(S.Boolean).pipe(T.Body("allow_insecure")), ), expectedBody: S.optional(S.NullOr(S.String).pipe(T.Body("expected_body"))), expectedCodes: S.optional( S.NullOr(UpdateHealthCheckResponseHttpConfigExpectedCodesList).pipe( T.Body("expected_codes"), ), ), followRedirects: S.optional( S.NullOr(S.Boolean).pipe(T.Body("follow_redirects")), ), header: S.optional(S.NullOr(UpdateHealthCheckResponseHttpConfigHeaderMap)), method: S.optional(S.NullOr(UpdateHealthCheckResponseHttpConfigMethod)), path: S.optional(S.NullOr(S.String)), port: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "UpdateHealthCheckResponseHttpConfig", }) as any as S.Schema; export type UpdateHealthCheckResponseStatus = | "unknown" | "healthy" | "unhealthy" | "suspended"; export const UpdateHealthCheckResponseStatus = /*@__PURE__*/ S.String; export type UpdateHealthCheckResponseTcpConfigMethod = "connection_established"; export const UpdateHealthCheckResponseTcpConfigMethod = /*@__PURE__*/ S.String; export interface UpdateHealthCheckResponseTcpConfig { /** The TCP connection method to use for the health check. */ method?: UpdateHealthCheckResponseTcpConfigMethod | null; /** Port number to connect to for the health check. Defaults to 80. */ port?: number | null; } export const UpdateHealthCheckResponseTcpConfig = /*@__PURE__*/ S.suspend(() => S.Struct({ method: S.optional(S.NullOr(UpdateHealthCheckResponseTcpConfigMethod)), port: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "UpdateHealthCheckResponseTcpConfig", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdateHealthCheckResponse { /** Identifier. */ id?: string | null; /** The hostname or IP address of the origin server to run health checks on. */ address?: string | null; /** A list of regions from which to run health checks. Null means Cloudflare will pick a default region. */ checkRegions?: UpdateHealthCheckResponseCheckRegionsList | null; /** The number of consecutive fails required from a health check before changing the health to unhealthy. */ consecutiveFails?: number | null; /** The number of consecutive successes required from a health check before changing the health to healthy. */ consecutiveSuccesses?: number | null; createdOn?: string | null; /** A human-readable description of the health check. */ description?: string | null; /** The current failure reason if status is unhealthy. */ failureReason?: string | null; /** Parameters specific to an HTTP or HTTPS health check. */ httpConfig?: UpdateHealthCheckResponseHttpConfig | null; /** The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations. */ interval?: number | null; modifiedOn?: string | null; /** A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed. */ name?: 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 current status of the origin server according to the health check. */ status?: UpdateHealthCheckResponseStatus | null; /** If suspended, no health checks are sent to the origin. */ suspended?: boolean | null; /** Parameters specific to TCP health check. */ tcpConfig?: UpdateHealthCheckResponseTcpConfig | 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' and 'TCP'. */ type?: string | null; } export const UpdateHealthCheckResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), address: S.optional(S.NullOr(S.String)), checkRegions: S.optional( S.NullOr(UpdateHealthCheckResponseCheckRegionsList).pipe( T.Body("check_regions"), ), ), consecutiveFails: S.optional( S.NullOr(S.Number).pipe(T.Body("consecutive_fails")), ), consecutiveSuccesses: S.optional( S.NullOr(S.Number).pipe(T.Body("consecutive_successes")), ), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), description: S.optional(S.NullOr(S.String)), failureReason: S.optional( S.NullOr(S.String).pipe(T.Body("failure_reason")), ), httpConfig: S.optional( S.NullOr(UpdateHealthCheckResponseHttpConfig).pipe(T.Body("http_config")), ), interval: S.optional(S.NullOr(S.Number)), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), retries: S.optional(S.NullOr(S.Number)), status: S.optional(S.NullOr(UpdateHealthCheckResponseStatus)), suspended: S.optional(S.NullOr(S.Boolean)), tcpConfig: S.optional( S.NullOr(UpdateHealthCheckResponseTcpConfig).pipe(T.Body("tcp_config")), ), timeout: S.optional(S.NullOr(S.Number)), type: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "UpdateHealthCheckResponse", }) as any as S.Schema; export type CacheReserveClearStatusError = CloudflareOpError; /** You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation. */ export const cacheReserveClearStatus: API.OperationMethod< CacheReserveClearStatusRequest, CacheReserveClearStatusResponse, CacheReserveClearStatusError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CacheReserveClearStatusRequest, output: CacheReserveClearStatusResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ClearCacheReserveClearError = CloudflareOpError; /** You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation. */ export const clearCacheReserveClear: API.OperationMethod< ClearCacheReserveClearRequest, ClearCacheReserveClearResponse, ClearCacheReserveClearError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: ClearCacheReserveClearRequest, output: ClearCacheReserveClearResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateHealthCheckError = CloudflareOpError; /** Create a new health check. */ export const createHealthCheck: API.OperationMethod< CreateHealthCheckRequest, CreateHealthCheckResponse, CreateHealthCheckError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateHealthCheckRequest, output: CreateHealthCheckResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteHealthCheckError = CloudflareOpError; /** Delete a health check. */ export const deleteHealthCheck: API.OperationMethod< DeleteHealthCheckRequest, DeleteHealthCheckResponse, DeleteHealthCheckError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteHealthCheckRequest, output: DeleteHealthCheckResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type EditHealthCheckError = CloudflareOpError; /** Patch a configured health check. */ export const editHealthCheck: API.OperationMethod< EditHealthCheckRequest, EditHealthCheckResponse, EditHealthCheckError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: EditHealthCheckRequest, output: EditHealthCheckResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetError = CloudflareOpError; /** Retrieve Smart Shield Settings. */ export const get: API.OperationMethod< GetRequest, GetResponse, GetError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetRequest, output: GetResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetHealthCheckError = CloudflareOpError; /** Fetch a single configured health check. */ export const getHealthCheck: API.OperationMethod< GetHealthCheckRequest, GetHealthCheckResponse, GetHealthCheckError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetHealthCheckRequest, output: GetHealthCheckResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListHealthChecksError = CloudflareOpError; /** List configured health checks. */ export const listHealthChecks: API.OperationMethod< ListHealthChecksRequest, ListHealthChecksResponse, ListHealthChecksError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListHealthChecksRequest, output: ListHealthChecksResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdateError = CloudflareOpError; /** Set Smart Shield Settings. */ export const update: API.OperationMethod< UpdateRequest, UpdateResponse, UpdateError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateRequest, output: UpdateResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdateHealthCheckError = CloudflareOpError; /** Update a configured health check. */ export const updateHealthCheck: API.OperationMethod< UpdateHealthCheckRequest, UpdateHealthCheckResponse, UpdateHealthCheckError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateHealthCheckRequest, output: UpdateHealthCheckResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, }));