/**
 * Cloudflare HEALTHCHECKS API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service healthchecks
 */
import * as Schema from "effect/Schema";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import {} from "../errors.js";
export const GetHealthcheckRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    healthcheckId: Schema.String.pipe(T.HttpPath("healthcheckId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/healthchecks/{healthcheckId}",
}));
export const GetHealthcheckResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    address: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    checkRegions: Schema.optional(Schema.Union([
        Schema.Array(Schema.Literals([
            "WNAM",
            "ENAM",
            "WEU",
            "EEU",
            "NSAM",
            "SSAM",
            "OC",
            "ME",
            "NAF",
            "SAF",
            "IN",
            "SEAS",
            "NEAS",
            "ALL_REGIONS",
        ])),
        Schema.Null,
    ])),
    consecutiveFails: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    consecutiveSuccesses: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    failureReason: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    httpConfig: Schema.optional(Schema.Union([
        Schema.Struct({
            allowInsecure: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            expectedBody: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            expectedCodes: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            followRedirects: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            header: Schema.optional(Schema.Union([
                Schema.Record(Schema.String, Schema.Unknown),
                Schema.Null,
            ])),
            method: Schema.optional(Schema.Union([Schema.Literals(["GET", "HEAD"]), Schema.Null])),
            path: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            allowInsecure: "allow_insecure",
            expectedBody: "expected_body",
            expectedCodes: "expected_codes",
            followRedirects: "follow_redirects",
            header: "header",
            method: "method",
            path: "path",
            port: "port",
        })),
        Schema.Null,
    ])),
    interval: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    retries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    status: Schema.optional(Schema.Union([
        Schema.Literals(["unknown", "healthy", "unhealthy", "suspended"]),
        Schema.Null,
    ])),
    suspended: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    tcpConfig: Schema.optional(Schema.Union([
        Schema.Struct({
            method: Schema.optional(Schema.Union([
                Schema.Literal("connection_established"),
                Schema.Null,
            ])),
            port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }),
        Schema.Null,
    ])),
    timeout: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    type: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    address: "address",
    checkRegions: "check_regions",
    consecutiveFails: "consecutive_fails",
    consecutiveSuccesses: "consecutive_successes",
    createdOn: "created_on",
    description: "description",
    failureReason: "failure_reason",
    httpConfig: "http_config",
    interval: "interval",
    modifiedOn: "modified_on",
    name: "name",
    retries: "retries",
    status: "status",
    suspended: "suspended",
    tcpConfig: "tcp_config",
    timeout: "timeout",
    type: "type",
}))
    .pipe(T.ResponsePath("result"));
export const getHealthcheck = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetHealthcheckRequest,
    output: GetHealthcheckResponse,
    errors: [],
}));
export const ListHealthchecksRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/healthchecks" }));
export const ListHealthchecksResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        address: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        checkRegions: Schema.optional(Schema.Union([
            Schema.Array(Schema.Literals([
                "WNAM",
                "ENAM",
                "WEU",
                "EEU",
                "NSAM",
                "SSAM",
                "OC",
                "ME",
                "NAF",
                "SAF",
                "IN",
                "SEAS",
                "NEAS",
                "ALL_REGIONS",
            ])),
            Schema.Null,
        ])),
        consecutiveFails: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        consecutiveSuccesses: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        failureReason: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        httpConfig: Schema.optional(Schema.Union([
            Schema.Struct({
                allowInsecure: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                expectedBody: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                expectedCodes: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                followRedirects: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                header: Schema.optional(Schema.Union([
                    Schema.Record(Schema.String, Schema.Unknown),
                    Schema.Null,
                ])),
                method: Schema.optional(Schema.Union([Schema.Literals(["GET", "HEAD"]), Schema.Null])),
                path: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            }).pipe(Schema.encodeKeys({
                allowInsecure: "allow_insecure",
                expectedBody: "expected_body",
                expectedCodes: "expected_codes",
                followRedirects: "follow_redirects",
                header: "header",
                method: "method",
                path: "path",
                port: "port",
            })),
            Schema.Null,
        ])),
        interval: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        retries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        status: Schema.optional(Schema.Union([
            Schema.Literals(["unknown", "healthy", "unhealthy", "suspended"]),
            Schema.Null,
        ])),
        suspended: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        tcpConfig: Schema.optional(Schema.Union([
            Schema.Struct({
                method: Schema.optional(Schema.Union([
                    Schema.Literal("connection_established"),
                    Schema.Null,
                ])),
                port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            }),
            Schema.Null,
        ])),
        timeout: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        type: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        address: "address",
        checkRegions: "check_regions",
        consecutiveFails: "consecutive_fails",
        consecutiveSuccesses: "consecutive_successes",
        createdOn: "created_on",
        description: "description",
        failureReason: "failure_reason",
        httpConfig: "http_config",
        interval: "interval",
        modifiedOn: "modified_on",
        name: "name",
        retries: "retries",
        status: "status",
        suspended: "suspended",
        tcpConfig: "tcp_config",
        timeout: "timeout",
        type: "type",
    }))),
    resultInfo: Schema.optional(Schema.Union([
        Schema.Struct({
            count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            count: "count",
            page: "page",
            perPage: "per_page",
            totalCount: "total_count",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({ result: "result", resultInfo: "result_info" }));
export const listHealthchecks = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListHealthchecksRequest,
    output: ListHealthchecksResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateHealthcheckRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    address: Schema.String,
    name: Schema.String,
    checkRegions: Schema.optional(Schema.Union([
        Schema.Array(Schema.Literals([
            "WNAM",
            "ENAM",
            "WEU",
            "EEU",
            "NSAM",
            "SSAM",
            "OC",
            "ME",
            "NAF",
            "SAF",
            "IN",
            "SEAS",
            "NEAS",
            "ALL_REGIONS",
        ])),
        Schema.Null,
    ])),
    consecutiveFails: Schema.optional(Schema.Number),
    consecutiveSuccesses: Schema.optional(Schema.Number),
    description: Schema.optional(Schema.String),
    httpConfig: Schema.optional(Schema.Union([
        Schema.Struct({
            allowInsecure: Schema.optional(Schema.Boolean),
            expectedBody: Schema.optional(Schema.String),
            expectedCodes: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            followRedirects: Schema.optional(Schema.Boolean),
            header: Schema.optional(Schema.Union([
                Schema.Record(Schema.String, Schema.Unknown),
                Schema.Null,
            ])),
            method: Schema.optional(Schema.Literals(["GET", "HEAD"])),
            path: Schema.optional(Schema.String),
            port: Schema.optional(Schema.Number),
        }).pipe(Schema.encodeKeys({
            allowInsecure: "allow_insecure",
            expectedBody: "expected_body",
            expectedCodes: "expected_codes",
            followRedirects: "follow_redirects",
            header: "header",
            method: "method",
            path: "path",
            port: "port",
        })),
        Schema.Null,
    ])),
    interval: Schema.optional(Schema.Number),
    retries: Schema.optional(Schema.Number),
    suspended: Schema.optional(Schema.Boolean),
    tcpConfig: Schema.optional(Schema.Union([
        Schema.Struct({
            method: Schema.optional(Schema.Literal("connection_established")),
            port: Schema.optional(Schema.Number),
        }),
        Schema.Null,
    ])),
    timeout: Schema.optional(Schema.Number),
    type: Schema.optional(Schema.String),
}).pipe(Schema.encodeKeys({
    address: "address",
    name: "name",
    checkRegions: "check_regions",
    consecutiveFails: "consecutive_fails",
    consecutiveSuccesses: "consecutive_successes",
    description: "description",
    httpConfig: "http_config",
    interval: "interval",
    retries: "retries",
    suspended: "suspended",
    tcpConfig: "tcp_config",
    timeout: "timeout",
    type: "type",
}), T.Http({ method: "POST", path: "/zones/{zone_id}/healthchecks" }));
export const CreateHealthcheckResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    address: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    checkRegions: Schema.optional(Schema.Union([
        Schema.Array(Schema.Literals([
            "WNAM",
            "ENAM",
            "WEU",
            "EEU",
            "NSAM",
            "SSAM",
            "OC",
            "ME",
            "NAF",
            "SAF",
            "IN",
            "SEAS",
            "NEAS",
            "ALL_REGIONS",
        ])),
        Schema.Null,
    ])),
    consecutiveFails: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    consecutiveSuccesses: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    failureReason: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    httpConfig: Schema.optional(Schema.Union([
        Schema.Struct({
            allowInsecure: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            expectedBody: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            expectedCodes: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            followRedirects: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            header: Schema.optional(Schema.Union([
                Schema.Record(Schema.String, Schema.Unknown),
                Schema.Null,
            ])),
            method: Schema.optional(Schema.Union([Schema.Literals(["GET", "HEAD"]), Schema.Null])),
            path: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            allowInsecure: "allow_insecure",
            expectedBody: "expected_body",
            expectedCodes: "expected_codes",
            followRedirects: "follow_redirects",
            header: "header",
            method: "method",
            path: "path",
            port: "port",
        })),
        Schema.Null,
    ])),
    interval: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    retries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    status: Schema.optional(Schema.Union([
        Schema.Literals(["unknown", "healthy", "unhealthy", "suspended"]),
        Schema.Null,
    ])),
    suspended: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    tcpConfig: Schema.optional(Schema.Union([
        Schema.Struct({
            method: Schema.optional(Schema.Union([
                Schema.Literal("connection_established"),
                Schema.Null,
            ])),
            port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }),
        Schema.Null,
    ])),
    timeout: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    type: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    address: "address",
    checkRegions: "check_regions",
    consecutiveFails: "consecutive_fails",
    consecutiveSuccesses: "consecutive_successes",
    createdOn: "created_on",
    description: "description",
    failureReason: "failure_reason",
    httpConfig: "http_config",
    interval: "interval",
    modifiedOn: "modified_on",
    name: "name",
    retries: "retries",
    status: "status",
    suspended: "suspended",
    tcpConfig: "tcp_config",
    timeout: "timeout",
    type: "type",
}))
    .pipe(T.ResponsePath("result"));
export const createHealthcheck = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateHealthcheckRequest,
    output: CreateHealthcheckResponse,
    errors: [],
}));
export const UpdateHealthcheckRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    healthcheckId: Schema.String.pipe(T.HttpPath("healthcheckId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    address: Schema.String,
    name: Schema.String,
    checkRegions: Schema.optional(Schema.Union([
        Schema.Array(Schema.Literals([
            "WNAM",
            "ENAM",
            "WEU",
            "EEU",
            "NSAM",
            "SSAM",
            "OC",
            "ME",
            "NAF",
            "SAF",
            "IN",
            "SEAS",
            "NEAS",
            "ALL_REGIONS",
        ])),
        Schema.Null,
    ])),
    consecutiveFails: Schema.optional(Schema.Number),
    consecutiveSuccesses: Schema.optional(Schema.Number),
    description: Schema.optional(Schema.String),
    httpConfig: Schema.optional(Schema.Union([
        Schema.Struct({
            allowInsecure: Schema.optional(Schema.Boolean),
            expectedBody: Schema.optional(Schema.String),
            expectedCodes: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            followRedirects: Schema.optional(Schema.Boolean),
            header: Schema.optional(Schema.Union([
                Schema.Record(Schema.String, Schema.Unknown),
                Schema.Null,
            ])),
            method: Schema.optional(Schema.Literals(["GET", "HEAD"])),
            path: Schema.optional(Schema.String),
            port: Schema.optional(Schema.Number),
        }).pipe(Schema.encodeKeys({
            allowInsecure: "allow_insecure",
            expectedBody: "expected_body",
            expectedCodes: "expected_codes",
            followRedirects: "follow_redirects",
            header: "header",
            method: "method",
            path: "path",
            port: "port",
        })),
        Schema.Null,
    ])),
    interval: Schema.optional(Schema.Number),
    retries: Schema.optional(Schema.Number),
    suspended: Schema.optional(Schema.Boolean),
    tcpConfig: Schema.optional(Schema.Union([
        Schema.Struct({
            method: Schema.optional(Schema.Literal("connection_established")),
            port: Schema.optional(Schema.Number),
        }),
        Schema.Null,
    ])),
    timeout: Schema.optional(Schema.Number),
    type: Schema.optional(Schema.String),
}).pipe(Schema.encodeKeys({
    address: "address",
    name: "name",
    checkRegions: "check_regions",
    consecutiveFails: "consecutive_fails",
    consecutiveSuccesses: "consecutive_successes",
    description: "description",
    httpConfig: "http_config",
    interval: "interval",
    retries: "retries",
    suspended: "suspended",
    tcpConfig: "tcp_config",
    timeout: "timeout",
    type: "type",
}), T.Http({
    method: "PUT",
    path: "/zones/{zone_id}/healthchecks/{healthcheckId}",
}));
export const UpdateHealthcheckResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    address: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    checkRegions: Schema.optional(Schema.Union([
        Schema.Array(Schema.Literals([
            "WNAM",
            "ENAM",
            "WEU",
            "EEU",
            "NSAM",
            "SSAM",
            "OC",
            "ME",
            "NAF",
            "SAF",
            "IN",
            "SEAS",
            "NEAS",
            "ALL_REGIONS",
        ])),
        Schema.Null,
    ])),
    consecutiveFails: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    consecutiveSuccesses: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    failureReason: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    httpConfig: Schema.optional(Schema.Union([
        Schema.Struct({
            allowInsecure: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            expectedBody: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            expectedCodes: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            followRedirects: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            header: Schema.optional(Schema.Union([
                Schema.Record(Schema.String, Schema.Unknown),
                Schema.Null,
            ])),
            method: Schema.optional(Schema.Union([Schema.Literals(["GET", "HEAD"]), Schema.Null])),
            path: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            allowInsecure: "allow_insecure",
            expectedBody: "expected_body",
            expectedCodes: "expected_codes",
            followRedirects: "follow_redirects",
            header: "header",
            method: "method",
            path: "path",
            port: "port",
        })),
        Schema.Null,
    ])),
    interval: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    retries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    status: Schema.optional(Schema.Union([
        Schema.Literals(["unknown", "healthy", "unhealthy", "suspended"]),
        Schema.Null,
    ])),
    suspended: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    tcpConfig: Schema.optional(Schema.Union([
        Schema.Struct({
            method: Schema.optional(Schema.Union([
                Schema.Literal("connection_established"),
                Schema.Null,
            ])),
            port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }),
        Schema.Null,
    ])),
    timeout: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    type: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    address: "address",
    checkRegions: "check_regions",
    consecutiveFails: "consecutive_fails",
    consecutiveSuccesses: "consecutive_successes",
    createdOn: "created_on",
    description: "description",
    failureReason: "failure_reason",
    httpConfig: "http_config",
    interval: "interval",
    modifiedOn: "modified_on",
    name: "name",
    retries: "retries",
    status: "status",
    suspended: "suspended",
    tcpConfig: "tcp_config",
    timeout: "timeout",
    type: "type",
}))
    .pipe(T.ResponsePath("result"));
export const updateHealthcheck = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateHealthcheckRequest,
    output: UpdateHealthcheckResponse,
    errors: [],
}));
export const PatchHealthcheckRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    healthcheckId: Schema.String.pipe(T.HttpPath("healthcheckId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    address: Schema.String,
    name: Schema.String,
    checkRegions: Schema.optional(Schema.Union([
        Schema.Array(Schema.Literals([
            "WNAM",
            "ENAM",
            "WEU",
            "EEU",
            "NSAM",
            "SSAM",
            "OC",
            "ME",
            "NAF",
            "SAF",
            "IN",
            "SEAS",
            "NEAS",
            "ALL_REGIONS",
        ])),
        Schema.Null,
    ])),
    consecutiveFails: Schema.optional(Schema.Number),
    consecutiveSuccesses: Schema.optional(Schema.Number),
    description: Schema.optional(Schema.String),
    httpConfig: Schema.optional(Schema.Union([
        Schema.Struct({
            allowInsecure: Schema.optional(Schema.Boolean),
            expectedBody: Schema.optional(Schema.String),
            expectedCodes: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            followRedirects: Schema.optional(Schema.Boolean),
            header: Schema.optional(Schema.Union([
                Schema.Record(Schema.String, Schema.Unknown),
                Schema.Null,
            ])),
            method: Schema.optional(Schema.Literals(["GET", "HEAD"])),
            path: Schema.optional(Schema.String),
            port: Schema.optional(Schema.Number),
        }).pipe(Schema.encodeKeys({
            allowInsecure: "allow_insecure",
            expectedBody: "expected_body",
            expectedCodes: "expected_codes",
            followRedirects: "follow_redirects",
            header: "header",
            method: "method",
            path: "path",
            port: "port",
        })),
        Schema.Null,
    ])),
    interval: Schema.optional(Schema.Number),
    retries: Schema.optional(Schema.Number),
    suspended: Schema.optional(Schema.Boolean),
    tcpConfig: Schema.optional(Schema.Union([
        Schema.Struct({
            method: Schema.optional(Schema.Literal("connection_established")),
            port: Schema.optional(Schema.Number),
        }),
        Schema.Null,
    ])),
    timeout: Schema.optional(Schema.Number),
    type: Schema.optional(Schema.String),
}).pipe(Schema.encodeKeys({
    address: "address",
    name: "name",
    checkRegions: "check_regions",
    consecutiveFails: "consecutive_fails",
    consecutiveSuccesses: "consecutive_successes",
    description: "description",
    httpConfig: "http_config",
    interval: "interval",
    retries: "retries",
    suspended: "suspended",
    tcpConfig: "tcp_config",
    timeout: "timeout",
    type: "type",
}), T.Http({
    method: "PATCH",
    path: "/zones/{zone_id}/healthchecks/{healthcheckId}",
}));
export const PatchHealthcheckResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    address: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    checkRegions: Schema.optional(Schema.Union([
        Schema.Array(Schema.Literals([
            "WNAM",
            "ENAM",
            "WEU",
            "EEU",
            "NSAM",
            "SSAM",
            "OC",
            "ME",
            "NAF",
            "SAF",
            "IN",
            "SEAS",
            "NEAS",
            "ALL_REGIONS",
        ])),
        Schema.Null,
    ])),
    consecutiveFails: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    consecutiveSuccesses: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    failureReason: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    httpConfig: Schema.optional(Schema.Union([
        Schema.Struct({
            allowInsecure: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            expectedBody: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            expectedCodes: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            followRedirects: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            header: Schema.optional(Schema.Union([
                Schema.Record(Schema.String, Schema.Unknown),
                Schema.Null,
            ])),
            method: Schema.optional(Schema.Union([Schema.Literals(["GET", "HEAD"]), Schema.Null])),
            path: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            allowInsecure: "allow_insecure",
            expectedBody: "expected_body",
            expectedCodes: "expected_codes",
            followRedirects: "follow_redirects",
            header: "header",
            method: "method",
            path: "path",
            port: "port",
        })),
        Schema.Null,
    ])),
    interval: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    retries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    status: Schema.optional(Schema.Union([
        Schema.Literals(["unknown", "healthy", "unhealthy", "suspended"]),
        Schema.Null,
    ])),
    suspended: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    tcpConfig: Schema.optional(Schema.Union([
        Schema.Struct({
            method: Schema.optional(Schema.Union([
                Schema.Literal("connection_established"),
                Schema.Null,
            ])),
            port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }),
        Schema.Null,
    ])),
    timeout: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    type: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    address: "address",
    checkRegions: "check_regions",
    consecutiveFails: "consecutive_fails",
    consecutiveSuccesses: "consecutive_successes",
    createdOn: "created_on",
    description: "description",
    failureReason: "failure_reason",
    httpConfig: "http_config",
    interval: "interval",
    modifiedOn: "modified_on",
    name: "name",
    retries: "retries",
    status: "status",
    suspended: "suspended",
    tcpConfig: "tcp_config",
    timeout: "timeout",
    type: "type",
}))
    .pipe(T.ResponsePath("result"));
export const patchHealthcheck = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchHealthcheckRequest,
    output: PatchHealthcheckResponse,
    errors: [],
}));
export const DeleteHealthcheckRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    healthcheckId: Schema.String.pipe(T.HttpPath("healthcheckId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/zones/{zone_id}/healthchecks/{healthcheckId}",
}));
export const DeleteHealthcheckResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const deleteHealthcheck = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteHealthcheckRequest,
    output: DeleteHealthcheckResponse,
    errors: [],
}));
export const GetPreviewRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    healthcheckId: Schema.String.pipe(T.HttpPath("healthcheckId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/healthchecks/preview/{healthcheckId}",
}));
export const GetPreviewResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    address: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    checkRegions: Schema.optional(Schema.Union([
        Schema.Array(Schema.Literals([
            "WNAM",
            "ENAM",
            "WEU",
            "EEU",
            "NSAM",
            "SSAM",
            "OC",
            "ME",
            "NAF",
            "SAF",
            "IN",
            "SEAS",
            "NEAS",
            "ALL_REGIONS",
        ])),
        Schema.Null,
    ])),
    consecutiveFails: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    consecutiveSuccesses: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    failureReason: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    httpConfig: Schema.optional(Schema.Union([
        Schema.Struct({
            allowInsecure: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            expectedBody: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            expectedCodes: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            followRedirects: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            header: Schema.optional(Schema.Union([
                Schema.Record(Schema.String, Schema.Unknown),
                Schema.Null,
            ])),
            method: Schema.optional(Schema.Union([Schema.Literals(["GET", "HEAD"]), Schema.Null])),
            path: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            allowInsecure: "allow_insecure",
            expectedBody: "expected_body",
            expectedCodes: "expected_codes",
            followRedirects: "follow_redirects",
            header: "header",
            method: "method",
            path: "path",
            port: "port",
        })),
        Schema.Null,
    ])),
    interval: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    retries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    status: Schema.optional(Schema.Union([
        Schema.Literals(["unknown", "healthy", "unhealthy", "suspended"]),
        Schema.Null,
    ])),
    suspended: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    tcpConfig: Schema.optional(Schema.Union([
        Schema.Struct({
            method: Schema.optional(Schema.Union([Schema.Literal("connection_established"), Schema.Null])),
            port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }),
        Schema.Null,
    ])),
    timeout: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    type: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    address: "address",
    checkRegions: "check_regions",
    consecutiveFails: "consecutive_fails",
    consecutiveSuccesses: "consecutive_successes",
    createdOn: "created_on",
    description: "description",
    failureReason: "failure_reason",
    httpConfig: "http_config",
    interval: "interval",
    modifiedOn: "modified_on",
    name: "name",
    retries: "retries",
    status: "status",
    suspended: "suspended",
    tcpConfig: "tcp_config",
    timeout: "timeout",
    type: "type",
}))
    .pipe(T.ResponsePath("result"));
export const getPreview = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetPreviewRequest,
    output: GetPreviewResponse,
    errors: [],
}));
export const CreatePreviewRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    address: Schema.String,
    name: Schema.String,
    checkRegions: Schema.optional(Schema.Union([
        Schema.Array(Schema.Literals([
            "WNAM",
            "ENAM",
            "WEU",
            "EEU",
            "NSAM",
            "SSAM",
            "OC",
            "ME",
            "NAF",
            "SAF",
            "IN",
            "SEAS",
            "NEAS",
            "ALL_REGIONS",
        ])),
        Schema.Null,
    ])),
    consecutiveFails: Schema.optional(Schema.Number),
    consecutiveSuccesses: Schema.optional(Schema.Number),
    description: Schema.optional(Schema.String),
    httpConfig: Schema.optional(Schema.Union([
        Schema.Struct({
            allowInsecure: Schema.optional(Schema.Boolean),
            expectedBody: Schema.optional(Schema.String),
            expectedCodes: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            followRedirects: Schema.optional(Schema.Boolean),
            header: Schema.optional(Schema.Union([
                Schema.Record(Schema.String, Schema.Unknown),
                Schema.Null,
            ])),
            method: Schema.optional(Schema.Literals(["GET", "HEAD"])),
            path: Schema.optional(Schema.String),
            port: Schema.optional(Schema.Number),
        }).pipe(Schema.encodeKeys({
            allowInsecure: "allow_insecure",
            expectedBody: "expected_body",
            expectedCodes: "expected_codes",
            followRedirects: "follow_redirects",
            header: "header",
            method: "method",
            path: "path",
            port: "port",
        })),
        Schema.Null,
    ])),
    interval: Schema.optional(Schema.Number),
    retries: Schema.optional(Schema.Number),
    suspended: Schema.optional(Schema.Boolean),
    tcpConfig: Schema.optional(Schema.Union([
        Schema.Struct({
            method: Schema.optional(Schema.Literal("connection_established")),
            port: Schema.optional(Schema.Number),
        }),
        Schema.Null,
    ])),
    timeout: Schema.optional(Schema.Number),
    type: Schema.optional(Schema.String),
}).pipe(Schema.encodeKeys({
    address: "address",
    name: "name",
    checkRegions: "check_regions",
    consecutiveFails: "consecutive_fails",
    consecutiveSuccesses: "consecutive_successes",
    description: "description",
    httpConfig: "http_config",
    interval: "interval",
    retries: "retries",
    suspended: "suspended",
    tcpConfig: "tcp_config",
    timeout: "timeout",
    type: "type",
}), T.Http({ method: "POST", path: "/zones/{zone_id}/healthchecks/preview" }));
export const CreatePreviewResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    address: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    checkRegions: Schema.optional(Schema.Union([
        Schema.Array(Schema.Literals([
            "WNAM",
            "ENAM",
            "WEU",
            "EEU",
            "NSAM",
            "SSAM",
            "OC",
            "ME",
            "NAF",
            "SAF",
            "IN",
            "SEAS",
            "NEAS",
            "ALL_REGIONS",
        ])),
        Schema.Null,
    ])),
    consecutiveFails: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    consecutiveSuccesses: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    failureReason: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    httpConfig: Schema.optional(Schema.Union([
        Schema.Struct({
            allowInsecure: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            expectedBody: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            expectedCodes: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            followRedirects: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            header: Schema.optional(Schema.Union([
                Schema.Record(Schema.String, Schema.Unknown),
                Schema.Null,
            ])),
            method: Schema.optional(Schema.Union([Schema.Literals(["GET", "HEAD"]), Schema.Null])),
            path: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            allowInsecure: "allow_insecure",
            expectedBody: "expected_body",
            expectedCodes: "expected_codes",
            followRedirects: "follow_redirects",
            header: "header",
            method: "method",
            path: "path",
            port: "port",
        })),
        Schema.Null,
    ])),
    interval: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    retries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    status: Schema.optional(Schema.Union([
        Schema.Literals(["unknown", "healthy", "unhealthy", "suspended"]),
        Schema.Null,
    ])),
    suspended: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    tcpConfig: Schema.optional(Schema.Union([
        Schema.Struct({
            method: Schema.optional(Schema.Union([Schema.Literal("connection_established"), Schema.Null])),
            port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }),
        Schema.Null,
    ])),
    timeout: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    type: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    address: "address",
    checkRegions: "check_regions",
    consecutiveFails: "consecutive_fails",
    consecutiveSuccesses: "consecutive_successes",
    createdOn: "created_on",
    description: "description",
    failureReason: "failure_reason",
    httpConfig: "http_config",
    interval: "interval",
    modifiedOn: "modified_on",
    name: "name",
    retries: "retries",
    status: "status",
    suspended: "suspended",
    tcpConfig: "tcp_config",
    timeout: "timeout",
    type: "type",
}))
    .pipe(T.ResponsePath("result"));
export const createPreview = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreatePreviewRequest,
    output: CreatePreviewResponse,
    errors: [],
}));
export const DeletePreviewRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    healthcheckId: Schema.String.pipe(T.HttpPath("healthcheckId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/zones/{zone_id}/healthchecks/preview/{healthcheckId}",
}));
export const DeletePreviewResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const deletePreview = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeletePreviewRequest,
    output: DeletePreviewResponse,
    errors: [],
}));
//# sourceMappingURL=healthchecks.js.map