/**
 * Cloudflare KEYLESS-CERTIFICATES API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service keyless-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 GetKeylessCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    keylessCertificateId: Schema.String.pipe(T.HttpPath("keylessCertificateId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/keyless_certificates/{keylessCertificateId}",
}));
export const GetKeylessCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ 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",
}))
    .pipe(T.ResponsePath("result"));
export const getKeylessCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetKeylessCertificateRequest,
    output: GetKeylessCertificateResponse,
    errors: [],
}));
export const ListKeylessCertificatesRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/keyless_certificates" }));
export const ListKeylessCertificatesResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(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",
    }))),
});
export const listKeylessCertificates = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListKeylessCertificatesRequest,
    output: ListKeylessCertificatesResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const CreateKeylessCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    certificate: Schema.String,
    host: Schema.String,
    port: Schema.Number,
    bundleMethod: Schema.optional(Schema.Literals(["ubiquitous", "optimal", "force"])),
    name: Schema.optional(Schema.String),
    tunnel: Schema.optional(Schema.Struct({
        privateIp: Schema.String,
        vnetId: Schema.String,
    }).pipe(Schema.encodeKeys({ privateIp: "private_ip", vnetId: "vnet_id" }))),
}).pipe(Schema.encodeKeys({
    certificate: "certificate",
    host: "host",
    port: "port",
    bundleMethod: "bundle_method",
    name: "name",
    tunnel: "tunnel",
}), T.Http({ method: "POST", path: "/zones/{zone_id}/keyless_certificates" }));
export const CreateKeylessCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ 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",
}))
    .pipe(T.ResponsePath("result"));
export const createKeylessCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateKeylessCertificateRequest,
    output: CreateKeylessCertificateResponse,
    errors: [],
}));
export const PatchKeylessCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    keylessCertificateId: Schema.String.pipe(T.HttpPath("keylessCertificateId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    enabled: Schema.optional(Schema.Boolean),
    host: Schema.optional(Schema.String),
    name: Schema.optional(Schema.String),
    port: Schema.optional(Schema.Number),
    tunnel: Schema.optional(Schema.Struct({
        privateIp: Schema.String,
        vnetId: Schema.String,
    }).pipe(Schema.encodeKeys({ privateIp: "private_ip", vnetId: "vnet_id" }))),
}).pipe(T.Http({
    method: "PATCH",
    path: "/zones/{zone_id}/keyless_certificates/{keylessCertificateId}",
}));
export const PatchKeylessCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ 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",
}))
    .pipe(T.ResponsePath("result"));
export const patchKeylessCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchKeylessCertificateRequest,
    output: PatchKeylessCertificateResponse,
    errors: [],
}));
export const DeleteKeylessCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    keylessCertificateId: Schema.String.pipe(T.HttpPath("keylessCertificateId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/zones/{zone_id}/keyless_certificates/{keylessCertificateId}",
}));
export const DeleteKeylessCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const deleteKeylessCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteKeylessCertificateRequest,
    output: DeleteKeylessCertificateResponse,
    errors: [],
}));
//# sourceMappingURL=keyless-certificates.js.map