/**
 * Cloudflare ACM API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service acm
 */
import * as Schema from "effect/Schema";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import {} from "../errors.js";
// =============================================================================
// Errors
// =============================================================================
export class AdvancedCertificateManagerRequired extends Schema.TaggedErrorClass()("AdvancedCertificateManagerRequired", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(AdvancedCertificateManagerRequired, [{ code: 1450 }]);
export class InvalidObjectIdentifier extends Schema.TaggedErrorClass()("InvalidObjectIdentifier", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(InvalidObjectIdentifier, [{ code: 7003 }]);
export class NoStateChange extends Schema.TaggedErrorClass()("NoStateChange", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(NoStateChange, [{ code: 1467 }]);
export class PreviousJobInProgress extends Schema.TaggedErrorClass()("PreviousJobInProgress", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(PreviousJobInProgress, [{ code: 1482 }]);
export const GetTotalTlRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/acm/total_tls" }));
export const GetTotalTlResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    certificateAuthority: Schema.optional(Schema.Union([
        Schema.Literals(["google", "lets_encrypt", "ssl_com"]),
        Schema.Null,
    ])),
    enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    validityPeriod: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    certificateAuthority: "certificate_authority",
    enabled: "enabled",
    validityPeriod: "validity_period",
}))
    .pipe(T.ResponsePath("result"));
export const getTotalTl = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetTotalTlRequest,
    output: GetTotalTlResponse,
    errors: [InvalidObjectIdentifier, AdvancedCertificateManagerRequired],
}));
export const CreateTotalTlRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    enabled: Schema.Boolean,
    certificateAuthority: Schema.optional(Schema.Literals(["google", "lets_encrypt", "ssl_com"])),
}).pipe(Schema.encodeKeys({
    enabled: "enabled",
    certificateAuthority: "certificate_authority",
}), T.Http({ method: "POST", path: "/zones/{zone_id}/acm/total_tls" }));
export const CreateTotalTlResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    certificateAuthority: Schema.optional(Schema.Union([
        Schema.Literals(["google", "lets_encrypt", "ssl_com"]),
        Schema.Null,
    ])),
    enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    validityPeriod: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    certificateAuthority: "certificate_authority",
    enabled: "enabled",
    validityPeriod: "validity_period",
}))
    .pipe(T.ResponsePath("result"));
export const createTotalTl = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateTotalTlRequest,
    output: CreateTotalTlResponse,
    errors: [
        InvalidObjectIdentifier,
        AdvancedCertificateManagerRequired,
        NoStateChange,
        PreviousJobInProgress,
    ],
}));
//# sourceMappingURL=acm.js.map