/**
 * Cloudflare CUSTOM-CERTIFICATES API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service custom-certificates
 */
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 GetCustomCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    customCertificateId: Schema.String.pipe(T.HttpPath("customCertificateId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/custom_certificates/{customCertificateId}",
}));
export const GetCustomCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    bundleMethod: Schema.Literals(["ubiquitous", "optimal", "force"]),
    expiresOn: Schema.String,
    hosts: Schema.Array(Schema.String),
    issuer: Schema.String,
    modifiedOn: Schema.String,
    priority: Schema.Number,
    signature: Schema.String,
    status: Schema.Literals([
        "active",
        "expired",
        "deleted",
        "pending",
        "initializing",
    ]),
    uploadedOn: Schema.String,
    zoneId: Schema.String,
    geoRestrictions: Schema.optional(Schema.Union([
        Schema.Struct({
            label: Schema.optional(Schema.Union([
                Schema.Literals(["us", "eu", "highest_security"]),
                Schema.Null,
            ])),
        }),
        Schema.Null,
    ])),
    keylessServer: Schema.optional(Schema.Union([
        Schema.Struct({
            id: Schema.String,
            createdOn: Schema.String,
            enabled: Schema.Boolean,
            host: Schema.String,
            modifiedOn: Schema.String,
            name: Schema.String,
            permissions: Schema.Array(Schema.String),
            port: Schema.Number,
            status: Schema.Literals(["active", "deleted"]),
            tunnel: Schema.optional(Schema.Union([
                Schema.Struct({
                    privateIp: Schema.String,
                    vnetId: Schema.String,
                }).pipe(Schema.encodeKeys({
                    privateIp: "private_ip",
                    vnetId: "vnet_id",
                })),
                Schema.Null,
            ])),
        }).pipe(Schema.encodeKeys({
            id: "id",
            createdOn: "created_on",
            enabled: "enabled",
            host: "host",
            modifiedOn: "modified_on",
            name: "name",
            permissions: "permissions",
            port: "port",
            status: "status",
            tunnel: "tunnel",
        })),
        Schema.Null,
    ])),
    policy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    bundleMethod: "bundle_method",
    expiresOn: "expires_on",
    hosts: "hosts",
    issuer: "issuer",
    modifiedOn: "modified_on",
    priority: "priority",
    signature: "signature",
    status: "status",
    uploadedOn: "uploaded_on",
    zoneId: "zone_id",
    geoRestrictions: "geo_restrictions",
    keylessServer: "keyless_server",
    policy: "policy",
}))
    .pipe(T.ResponsePath("result"));
export const getCustomCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetCustomCertificateRequest,
    output: GetCustomCertificateResponse,
    errors: [],
}));
export const ListCustomCertificatesRequest = 
/*@__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")),
    match: Schema.optional(Schema.Literals(["any", "all"])).pipe(T.HttpQuery("match")),
    status: Schema.optional(Schema.Literals([
        "active",
        "expired",
        "deleted",
        "pending",
        "initializing",
    ])).pipe(T.HttpQuery("status")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/custom_certificates" }));
export const ListCustomCertificatesResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        bundleMethod: Schema.Literals(["ubiquitous", "optimal", "force"]),
        expiresOn: Schema.String,
        hosts: Schema.Array(Schema.String),
        issuer: Schema.String,
        modifiedOn: Schema.String,
        priority: Schema.Number,
        signature: Schema.String,
        status: Schema.Literals([
            "active",
            "expired",
            "deleted",
            "pending",
            "initializing",
        ]),
        uploadedOn: Schema.String,
        zoneId: Schema.String,
        geoRestrictions: Schema.optional(Schema.Union([
            Schema.Struct({
                label: Schema.optional(Schema.Union([
                    Schema.Literals(["us", "eu", "highest_security"]),
                    Schema.Null,
                ])),
            }),
            Schema.Null,
        ])),
        keylessServer: Schema.optional(Schema.Union([
            Schema.Struct({
                id: Schema.String,
                createdOn: Schema.String,
                enabled: Schema.Boolean,
                host: Schema.String,
                modifiedOn: Schema.String,
                name: Schema.String,
                permissions: Schema.Array(Schema.String),
                port: Schema.Number,
                status: Schema.Literals(["active", "deleted"]),
                tunnel: Schema.optional(Schema.Union([
                    Schema.Struct({
                        privateIp: Schema.String,
                        vnetId: Schema.String,
                    }).pipe(Schema.encodeKeys({
                        privateIp: "private_ip",
                        vnetId: "vnet_id",
                    })),
                    Schema.Null,
                ])),
            }).pipe(Schema.encodeKeys({
                id: "id",
                createdOn: "created_on",
                enabled: "enabled",
                host: "host",
                modifiedOn: "modified_on",
                name: "name",
                permissions: "permissions",
                port: "port",
                status: "status",
                tunnel: "tunnel",
            })),
            Schema.Null,
        ])),
        policy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        bundleMethod: "bundle_method",
        expiresOn: "expires_on",
        hosts: "hosts",
        issuer: "issuer",
        modifiedOn: "modified_on",
        priority: "priority",
        signature: "signature",
        status: "status",
        uploadedOn: "uploaded_on",
        zoneId: "zone_id",
        geoRestrictions: "geo_restrictions",
        keylessServer: "keyless_server",
        policy: "policy",
    }))),
    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 listCustomCertificates = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListCustomCertificatesRequest,
    output: ListCustomCertificatesResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateCustomCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    certificate: Schema.String,
    privateKey: Schema.String,
    bundleMethod: Schema.optional(Schema.Literals(["ubiquitous", "optimal", "force"])),
    geoRestrictions: Schema.optional(Schema.Struct({
        label: Schema.optional(Schema.Literals(["us", "eu", "highest_security"])),
    })),
    policy: Schema.optional(Schema.String),
    type: Schema.optional(Schema.Literals(["legacy_custom", "sni_custom"])),
}).pipe(Schema.encodeKeys({
    certificate: "certificate",
    privateKey: "private_key",
    bundleMethod: "bundle_method",
    geoRestrictions: "geo_restrictions",
    policy: "policy",
    type: "type",
}), T.Http({ method: "POST", path: "/zones/{zone_id}/custom_certificates" }));
export const CreateCustomCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    bundleMethod: Schema.Literals(["ubiquitous", "optimal", "force"]),
    expiresOn: Schema.String,
    hosts: Schema.Array(Schema.String),
    issuer: Schema.String,
    modifiedOn: Schema.String,
    priority: Schema.Number,
    signature: Schema.String,
    status: Schema.Literals([
        "active",
        "expired",
        "deleted",
        "pending",
        "initializing",
    ]),
    uploadedOn: Schema.String,
    zoneId: Schema.String,
    geoRestrictions: Schema.optional(Schema.Union([
        Schema.Struct({
            label: Schema.optional(Schema.Union([
                Schema.Literals(["us", "eu", "highest_security"]),
                Schema.Null,
            ])),
        }),
        Schema.Null,
    ])),
    keylessServer: Schema.optional(Schema.Union([
        Schema.Struct({
            id: Schema.String,
            createdOn: Schema.String,
            enabled: Schema.Boolean,
            host: Schema.String,
            modifiedOn: Schema.String,
            name: Schema.String,
            permissions: Schema.Array(Schema.String),
            port: Schema.Number,
            status: Schema.Literals(["active", "deleted"]),
            tunnel: Schema.optional(Schema.Union([
                Schema.Struct({
                    privateIp: Schema.String,
                    vnetId: Schema.String,
                }).pipe(Schema.encodeKeys({
                    privateIp: "private_ip",
                    vnetId: "vnet_id",
                })),
                Schema.Null,
            ])),
        }).pipe(Schema.encodeKeys({
            id: "id",
            createdOn: "created_on",
            enabled: "enabled",
            host: "host",
            modifiedOn: "modified_on",
            name: "name",
            permissions: "permissions",
            port: "port",
            status: "status",
            tunnel: "tunnel",
        })),
        Schema.Null,
    ])),
    policy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    bundleMethod: "bundle_method",
    expiresOn: "expires_on",
    hosts: "hosts",
    issuer: "issuer",
    modifiedOn: "modified_on",
    priority: "priority",
    signature: "signature",
    status: "status",
    uploadedOn: "uploaded_on",
    zoneId: "zone_id",
    geoRestrictions: "geo_restrictions",
    keylessServer: "keyless_server",
    policy: "policy",
}))
    .pipe(T.ResponsePath("result"));
export const createCustomCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateCustomCertificateRequest,
    output: CreateCustomCertificateResponse,
    errors: [],
}));
export const PatchCustomCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    customCertificateId: Schema.String.pipe(T.HttpPath("customCertificateId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    bundleMethod: Schema.optional(Schema.Literals(["ubiquitous", "optimal", "force"])),
    certificate: Schema.optional(Schema.String),
    geoRestrictions: Schema.optional(Schema.Struct({
        label: Schema.optional(Schema.Literals(["us", "eu", "highest_security"])),
    })),
    policy: Schema.optional(Schema.String),
    privateKey: Schema.optional(Schema.String),
}).pipe(Schema.encodeKeys({
    bundleMethod: "bundle_method",
    certificate: "certificate",
    geoRestrictions: "geo_restrictions",
    policy: "policy",
    privateKey: "private_key",
}), T.Http({
    method: "PATCH",
    path: "/zones/{zone_id}/custom_certificates/{customCertificateId}",
}));
export const PatchCustomCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    bundleMethod: Schema.Literals(["ubiquitous", "optimal", "force"]),
    expiresOn: Schema.String,
    hosts: Schema.Array(Schema.String),
    issuer: Schema.String,
    modifiedOn: Schema.String,
    priority: Schema.Number,
    signature: Schema.String,
    status: Schema.Literals([
        "active",
        "expired",
        "deleted",
        "pending",
        "initializing",
    ]),
    uploadedOn: Schema.String,
    zoneId: Schema.String,
    geoRestrictions: Schema.optional(Schema.Union([
        Schema.Struct({
            label: Schema.optional(Schema.Union([
                Schema.Literals(["us", "eu", "highest_security"]),
                Schema.Null,
            ])),
        }),
        Schema.Null,
    ])),
    keylessServer: Schema.optional(Schema.Union([
        Schema.Struct({
            id: Schema.String,
            createdOn: Schema.String,
            enabled: Schema.Boolean,
            host: Schema.String,
            modifiedOn: Schema.String,
            name: Schema.String,
            permissions: Schema.Array(Schema.String),
            port: Schema.Number,
            status: Schema.Literals(["active", "deleted"]),
            tunnel: Schema.optional(Schema.Union([
                Schema.Struct({
                    privateIp: Schema.String,
                    vnetId: Schema.String,
                }).pipe(Schema.encodeKeys({
                    privateIp: "private_ip",
                    vnetId: "vnet_id",
                })),
                Schema.Null,
            ])),
        }).pipe(Schema.encodeKeys({
            id: "id",
            createdOn: "created_on",
            enabled: "enabled",
            host: "host",
            modifiedOn: "modified_on",
            name: "name",
            permissions: "permissions",
            port: "port",
            status: "status",
            tunnel: "tunnel",
        })),
        Schema.Null,
    ])),
    policy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    bundleMethod: "bundle_method",
    expiresOn: "expires_on",
    hosts: "hosts",
    issuer: "issuer",
    modifiedOn: "modified_on",
    priority: "priority",
    signature: "signature",
    status: "status",
    uploadedOn: "uploaded_on",
    zoneId: "zone_id",
    geoRestrictions: "geo_restrictions",
    keylessServer: "keyless_server",
    policy: "policy",
}))
    .pipe(T.ResponsePath("result"));
export const patchCustomCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchCustomCertificateRequest,
    output: PatchCustomCertificateResponse,
    errors: [],
}));
export const DeleteCustomCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    customCertificateId: Schema.String.pipe(T.HttpPath("customCertificateId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/zones/{zone_id}/custom_certificates/{customCertificateId}",
}));
export const DeleteCustomCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const deleteCustomCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteCustomCertificateRequest,
    output: DeleteCustomCertificateResponse,
    errors: [],
}));
export const PutPrioritizeRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    certificates: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.String),
        priority: Schema.optional(Schema.Number),
    })),
}).pipe(T.Http({
    method: "PUT",
    path: "/zones/{zone_id}/custom_certificates/prioritize",
}));
export const PutPrioritizeResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        bundleMethod: Schema.Literals(["ubiquitous", "optimal", "force"]),
        expiresOn: Schema.String,
        hosts: Schema.Array(Schema.String),
        issuer: Schema.String,
        modifiedOn: Schema.String,
        priority: Schema.Number,
        signature: Schema.String,
        status: Schema.Literals([
            "active",
            "expired",
            "deleted",
            "pending",
            "initializing",
        ]),
        uploadedOn: Schema.String,
        zoneId: Schema.String,
        geoRestrictions: Schema.optional(Schema.Union([
            Schema.Struct({
                label: Schema.optional(Schema.Union([
                    Schema.Literals(["us", "eu", "highest_security"]),
                    Schema.Null,
                ])),
            }),
            Schema.Null,
        ])),
        keylessServer: Schema.optional(Schema.Union([
            Schema.Struct({
                id: Schema.String,
                createdOn: Schema.String,
                enabled: Schema.Boolean,
                host: Schema.String,
                modifiedOn: Schema.String,
                name: Schema.String,
                permissions: Schema.Array(Schema.String),
                port: Schema.Number,
                status: Schema.Literals(["active", "deleted"]),
                tunnel: Schema.optional(Schema.Union([
                    Schema.Struct({
                        privateIp: Schema.String,
                        vnetId: Schema.String,
                    }).pipe(Schema.encodeKeys({
                        privateIp: "private_ip",
                        vnetId: "vnet_id",
                    })),
                    Schema.Null,
                ])),
            }).pipe(Schema.encodeKeys({
                id: "id",
                createdOn: "created_on",
                enabled: "enabled",
                host: "host",
                modifiedOn: "modified_on",
                name: "name",
                permissions: "permissions",
                port: "port",
                status: "status",
                tunnel: "tunnel",
            })),
            Schema.Null,
        ])),
        policy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        bundleMethod: "bundle_method",
        expiresOn: "expires_on",
        hosts: "hosts",
        issuer: "issuer",
        modifiedOn: "modified_on",
        priority: "priority",
        signature: "signature",
        status: "status",
        uploadedOn: "uploaded_on",
        zoneId: "zone_id",
        geoRestrictions: "geo_restrictions",
        keylessServer: "keyless_server",
        policy: "policy",
    }))),
});
export const putPrioritize = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: PutPrioritizeRequest,
    output: PutPrioritizeResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
//# sourceMappingURL=custom-certificates.js.map