/**
 * 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.Literals([
        "origin-rsa",
        "origin-ecc",
        "keyless-certificate",
    ]),
    requestedValidity: Schema.Literals([
        "7",
        "30",
        "90",
        "365",
        "730",
        "1095",
        "5475",
    ]),
    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.Literals([
            "origin-rsa",
            "origin-ecc",
            "keyless-certificate",
        ]),
        requestedValidity: Schema.Literals([
            "7",
            "30",
            "90",
            "365",
            "730",
            "1095",
            "5475",
        ]),
        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.Literals([
        "origin-rsa",
        "origin-ecc",
        "keyless-certificate",
    ]),
    requestedValidity: Schema.optional(Schema.Literals(["7", "30", "90", "365", "730", "1095", "5475"])),
}).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.Literals([
        "origin-rsa",
        "origin-ecc",
        "keyless-certificate",
    ]),
    requestedValidity: Schema.Literals([
        "7",
        "30",
        "90",
        "365",
        "730",
        "1095",
        "5475",
    ]),
    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