/**
 * Cloudflare ORIGIN-CA-CERTIFICATES API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service origin-ca-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 GetOriginCaCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    certificateId: Schema.String.pipe(T.HttpPath("certificateId")),
}).pipe(T.Http({ method: "GET", path: "/certificates/{certificateId}" }));
export const GetOriginCaCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    csr: Schema.String,
    hostnames: Schema.Array(Schema.String),
    requestType: Schema.Union([
        Schema.Literals(["origin-rsa", "origin-ecc", "keyless-certificate"]),
        Schema.String,
    ]),
    requestedValidity: Schema.Union([
        Schema.Literals(["7", "30", "90", "365", "730", "1095", "5475"]),
        Schema.String,
    ]),
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    certificate: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    expiresOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    csr: "csr",
    hostnames: "hostnames",
    requestType: "request_type",
    requestedValidity: "requested_validity",
    id: "id",
    certificate: "certificate",
    expiresOn: "expires_on",
}))
    .pipe(T.ResponsePath("result"));
export const getOriginCaCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetOriginCaCertificateRequest,
    output: GetOriginCaCertificateResponse,
    errors: [],
}));
export const ListOriginCaCertificatesRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    zoneId: Schema.String.pipe(T.HttpQuery("zone_id")),
    limit: Schema.optional(Schema.Number).pipe(T.HttpQuery("limit")),
    offset: Schema.optional(Schema.Number).pipe(T.HttpQuery("offset")),
}).pipe(T.Http({ method: "GET", path: "/certificates" }));
export const ListOriginCaCertificatesResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        csr: Schema.String,
        hostnames: Schema.Array(Schema.String),
        requestType: Schema.Union([
            Schema.Literals(["origin-rsa", "origin-ecc", "keyless-certificate"]),
            Schema.String,
        ]),
        requestedValidity: Schema.Union([
            Schema.Literals(["7", "30", "90", "365", "730", "1095", "5475"]),
            Schema.String,
        ]),
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        certificate: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        expiresOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        csr: "csr",
        hostnames: "hostnames",
        requestType: "request_type",
        requestedValidity: "requested_validity",
        id: "id",
        certificate: "certificate",
        expiresOn: "expires_on",
    }))),
    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 listOriginCaCertificates = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListOriginCaCertificatesRequest,
    output: ListOriginCaCertificatesResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateOriginCaCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    csr: Schema.String,
    hostnames: Schema.Array(Schema.String),
    requestType: Schema.Union([
        Schema.Literals(["origin-rsa", "origin-ecc", "keyless-certificate"]),
        Schema.String,
    ]),
    requestedValidity: Schema.optional(Schema.Union([
        Schema.Literals(["7", "30", "90", "365", "730", "1095", "5475"]),
        Schema.String,
    ])),
}).pipe(Schema.encodeKeys({
    csr: "csr",
    hostnames: "hostnames",
    requestType: "request_type",
    requestedValidity: "requested_validity",
}), T.Http({ method: "POST", path: "/certificates" }));
export const CreateOriginCaCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    csr: Schema.String,
    hostnames: Schema.Array(Schema.String),
    requestType: Schema.Union([
        Schema.Literals(["origin-rsa", "origin-ecc", "keyless-certificate"]),
        Schema.String,
    ]),
    requestedValidity: Schema.Union([
        Schema.Literals(["7", "30", "90", "365", "730", "1095", "5475"]),
        Schema.String,
    ]),
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    certificate: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    expiresOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    csr: "csr",
    hostnames: "hostnames",
    requestType: "request_type",
    requestedValidity: "requested_validity",
    id: "id",
    certificate: "certificate",
    expiresOn: "expires_on",
}))
    .pipe(T.ResponsePath("result"));
export const createOriginCaCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateOriginCaCertificateRequest,
    output: CreateOriginCaCertificateResponse,
    errors: [],
}));
export const DeleteOriginCaCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    certificateId: Schema.String.pipe(T.HttpPath("certificateId")),
}).pipe(T.Http({ method: "DELETE", path: "/certificates/{certificateId}" }));
export const DeleteOriginCaCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    revokedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({ id: "id", revokedAt: "revoked_at" }))
    .pipe(T.ResponsePath("result"));
export const deleteOriginCaCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteOriginCaCertificateRequest,
    output: DeleteOriginCaCertificateResponse,
    errors: [],
}));
//# sourceMappingURL=origin-ca-certificates.js.map