/**
 * Cloudflare MTLS-CERTIFICATES API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service mtls-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 GetAssociationRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    mtlsCertificateId: Schema.String.pipe(T.HttpPath("mtlsCertificateId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/mtls_certificates/{mtlsCertificateId}/associations",
}));
export const GetAssociationResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        service: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        status: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    })),
});
export const getAssociation = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: GetAssociationRequest,
    output: GetAssociationResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const GetMtlsCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    mtlsCertificateId: Schema.String.pipe(T.HttpPath("mtlsCertificateId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/mtls_certificates/{mtlsCertificateId}",
}));
export const GetMtlsCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    ca: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    certificates: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    expiresOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    issuer: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    name: 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])),
    uploadedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    ca: "ca",
    certificates: "certificates",
    expiresOn: "expires_on",
    issuer: "issuer",
    name: "name",
    serialNumber: "serial_number",
    signature: "signature",
    uploadedOn: "uploaded_on",
}))
    .pipe(T.ResponsePath("result"));
export const getMtlsCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetMtlsCertificateRequest,
    output: GetMtlsCertificateResponse,
    errors: [],
}));
export const ListMtlsCertificatesRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/mtls_certificates" }));
export const ListMtlsCertificatesResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        ca: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        certificates: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        expiresOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        issuer: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        name: 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])),
        uploadedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        ca: "ca",
        certificates: "certificates",
        expiresOn: "expires_on",
        issuer: "issuer",
        name: "name",
        serialNumber: "serial_number",
        signature: "signature",
        uploadedOn: "uploaded_on",
    }))),
});
export const listMtlsCertificates = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListMtlsCertificatesRequest,
    output: ListMtlsCertificatesResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const CreateMtlsCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ca: Schema.Boolean,
    certificates: Schema.String,
    name: Schema.optional(Schema.String),
    privateKey: Schema.optional(Schema.String),
}).pipe(Schema.encodeKeys({
    ca: "ca",
    certificates: "certificates",
    name: "name",
    privateKey: "private_key",
}), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/mtls_certificates",
}));
export const CreateMtlsCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    ca: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    certificates: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    expiresOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    issuer: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    name: 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])),
    updatedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    uploadedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    ca: "ca",
    certificates: "certificates",
    expiresOn: "expires_on",
    issuer: "issuer",
    name: "name",
    serialNumber: "serial_number",
    signature: "signature",
    updatedAt: "updated_at",
    uploadedOn: "uploaded_on",
}))
    .pipe(T.ResponsePath("result"));
export const createMtlsCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateMtlsCertificateRequest,
    output: CreateMtlsCertificateResponse,
    errors: [],
}));
export const DeleteMtlsCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    mtlsCertificateId: Schema.String.pipe(T.HttpPath("mtlsCertificateId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/mtls_certificates/{mtlsCertificateId}",
}));
export const DeleteMtlsCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    ca: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    certificates: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    expiresOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    issuer: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    name: 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])),
    uploadedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    ca: "ca",
    certificates: "certificates",
    expiresOn: "expires_on",
    issuer: "issuer",
    name: "name",
    serialNumber: "serial_number",
    signature: "signature",
    uploadedOn: "uploaded_on",
}))
    .pipe(T.ResponsePath("result"));
export const deleteMtlsCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteMtlsCertificateRequest,
    output: DeleteMtlsCertificateResponse,
    errors: [],
}));
//# sourceMappingURL=mtls-certificates.js.map