/**
 * Cloudflare CLIENT-CERTIFICATES API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service client-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 GetClientCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    clientCertificateId: Schema.String.pipe(T.HttpPath("clientCertificateId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/client_certificates/{clientCertificateId}",
}));
export const GetClientCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    certificate: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    certificateAuthority: Schema.optional(Schema.Union([
        Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Null,
    ])),
    commonName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    country: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    csr: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    expiresOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    fingerprintSha256: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    issuedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    location: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    organization: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    organizationalUnit: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    serialNumber: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    signature: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    ski: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    state: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    status: Schema.optional(Schema.Union([
        Schema.Literals([
            "active",
            "pending_reactivation",
            "pending_revocation",
            "revoked",
        ]),
        Schema.Null,
    ])),
    validityDays: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    certificate: "certificate",
    certificateAuthority: "certificate_authority",
    commonName: "common_name",
    country: "country",
    csr: "csr",
    expiresOn: "expires_on",
    fingerprintSha256: "fingerprint_sha256",
    issuedOn: "issued_on",
    location: "location",
    organization: "organization",
    organizationalUnit: "organizational_unit",
    serialNumber: "serial_number",
    signature: "signature",
    ski: "ski",
    state: "state",
    status: "status",
    validityDays: "validity_days",
}))
    .pipe(T.ResponsePath("result"));
export const getClientCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetClientCertificateRequest,
    output: GetClientCertificateResponse,
    errors: [],
}));
export const ListClientCertificatesRequest = 
/*@__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")),
    limit: Schema.optional(Schema.Number).pipe(T.HttpQuery("limit")),
    offset: Schema.optional(Schema.Number).pipe(T.HttpQuery("offset")),
    status: Schema.optional(Schema.Literals([
        "all",
        "active",
        "pending_reactivation",
        "pending_revocation",
        "revoked",
    ])).pipe(T.HttpQuery("status")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/client_certificates" }));
export const ListClientCertificatesResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        certificate: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        certificateAuthority: Schema.optional(Schema.Union([
            Schema.Struct({
                id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Null,
        ])),
        commonName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        country: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        csr: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        expiresOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        fingerprintSha256: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        issuedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        location: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        organization: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        organizationalUnit: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        serialNumber: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        signature: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        ski: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        state: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        status: Schema.optional(Schema.Union([
            Schema.Literals([
                "active",
                "pending_reactivation",
                "pending_revocation",
                "revoked",
            ]),
            Schema.Null,
        ])),
        validityDays: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        certificate: "certificate",
        certificateAuthority: "certificate_authority",
        commonName: "common_name",
        country: "country",
        csr: "csr",
        expiresOn: "expires_on",
        fingerprintSha256: "fingerprint_sha256",
        issuedOn: "issued_on",
        location: "location",
        organization: "organization",
        organizationalUnit: "organizational_unit",
        serialNumber: "serial_number",
        signature: "signature",
        ski: "ski",
        state: "state",
        status: "status",
        validityDays: "validity_days",
    }))),
    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 listClientCertificates = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListClientCertificatesRequest,
    output: ListClientCertificatesResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateClientCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    csr: Schema.String,
    validityDays: Schema.Number,
}).pipe(Schema.encodeKeys({ csr: "csr", validityDays: "validity_days" }), T.Http({ method: "POST", path: "/zones/{zone_id}/client_certificates" }));
export const CreateClientCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    certificate: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    certificateAuthority: Schema.optional(Schema.Union([
        Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Null,
    ])),
    commonName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    country: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    csr: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    expiresOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    fingerprintSha256: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    issuedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    location: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    organization: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    organizationalUnit: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    serialNumber: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    signature: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    ski: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    state: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    status: Schema.optional(Schema.Union([
        Schema.Literals([
            "active",
            "pending_reactivation",
            "pending_revocation",
            "revoked",
        ]),
        Schema.Null,
    ])),
    validityDays: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    certificate: "certificate",
    certificateAuthority: "certificate_authority",
    commonName: "common_name",
    country: "country",
    csr: "csr",
    expiresOn: "expires_on",
    fingerprintSha256: "fingerprint_sha256",
    issuedOn: "issued_on",
    location: "location",
    organization: "organization",
    organizationalUnit: "organizational_unit",
    serialNumber: "serial_number",
    signature: "signature",
    ski: "ski",
    state: "state",
    status: "status",
    validityDays: "validity_days",
}))
    .pipe(T.ResponsePath("result"));
export const createClientCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateClientCertificateRequest,
    output: CreateClientCertificateResponse,
    errors: [],
}));
export const PatchClientCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    clientCertificateId: Schema.String.pipe(T.HttpPath("clientCertificateId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    reactivate: Schema.optional(Schema.Boolean),
}).pipe(T.Http({
    method: "PATCH",
    path: "/zones/{zone_id}/client_certificates/{clientCertificateId}",
}));
export const PatchClientCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    certificate: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    certificateAuthority: Schema.optional(Schema.Union([
        Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Null,
    ])),
    commonName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    country: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    csr: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    expiresOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    fingerprintSha256: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    issuedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    location: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    organization: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    organizationalUnit: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    serialNumber: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    signature: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    ski: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    state: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    status: Schema.optional(Schema.Union([
        Schema.Literals([
            "active",
            "pending_reactivation",
            "pending_revocation",
            "revoked",
        ]),
        Schema.Null,
    ])),
    validityDays: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    certificate: "certificate",
    certificateAuthority: "certificate_authority",
    commonName: "common_name",
    country: "country",
    csr: "csr",
    expiresOn: "expires_on",
    fingerprintSha256: "fingerprint_sha256",
    issuedOn: "issued_on",
    location: "location",
    organization: "organization",
    organizationalUnit: "organizational_unit",
    serialNumber: "serial_number",
    signature: "signature",
    ski: "ski",
    state: "state",
    status: "status",
    validityDays: "validity_days",
}))
    .pipe(T.ResponsePath("result"));
export const patchClientCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchClientCertificateRequest,
    output: PatchClientCertificateResponse,
    errors: [],
}));
export const DeleteClientCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    clientCertificateId: Schema.String.pipe(T.HttpPath("clientCertificateId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/zones/{zone_id}/client_certificates/{clientCertificateId}",
}));
export const DeleteClientCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    certificate: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    certificateAuthority: Schema.optional(Schema.Union([
        Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Null,
    ])),
    commonName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    country: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    csr: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    expiresOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    fingerprintSha256: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    issuedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    location: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    organization: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    organizationalUnit: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    serialNumber: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    signature: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    ski: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    state: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    status: Schema.optional(Schema.Union([
        Schema.Literals([
            "active",
            "pending_reactivation",
            "pending_revocation",
            "revoked",
        ]),
        Schema.Null,
    ])),
    validityDays: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    certificate: "certificate",
    certificateAuthority: "certificate_authority",
    commonName: "common_name",
    country: "country",
    csr: "csr",
    expiresOn: "expires_on",
    fingerprintSha256: "fingerprint_sha256",
    issuedOn: "issued_on",
    location: "location",
    organization: "organization",
    organizationalUnit: "organizational_unit",
    serialNumber: "serial_number",
    signature: "signature",
    ski: "ski",
    state: "state",
    status: "status",
    validityDays: "validity_days",
}))
    .pipe(T.ResponsePath("result"));
export const deleteClientCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteClientCertificateRequest,
    output: DeleteClientCertificateResponse,
    errors: [],
}));
//# sourceMappingURL=client-certificates.js.map