// File generated from our OpenAPI spec by Stainless.
import { APIResource } from 'cloudflare/resource';
import * as SettingsAPI from 'cloudflare/resources/origin-tls-client-auth/settings';
import * as HostnamesAPI from 'cloudflare/resources/origin-tls-client-auth/hostnames/hostnames';
export class OriginTLSClientAuth extends APIResource {
    constructor() {
        super(...arguments);
        this.hostnames = new HostnamesAPI.Hostnames(this._client);
        this.settings = new SettingsAPI.Settings(this._client);
    }
    /**
     * Upload your own certificate you want Cloudflare to use for edge-to-origin
     * communication to override the shared certificate. Please note that it is
     * important to keep only one certificate active. Also, make sure to enable
     * zone-level authenticated origin pulls by making a PUT call to settings endpoint
     * to see the uploaded certificate in use.
     */
    create(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/origin_tls_client_auth`, { body, ...options })._thenUnwrap((obj) => obj.result);
    }
    /**
     * List Certificates
     */
    list(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/origin_tls_client_auth`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Delete Certificate
     */
    delete(certificateId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/origin_tls_client_auth/${certificateId}`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Get Certificate Details
     */
    get(certificateId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/origin_tls_client_auth/${certificateId}`, options)._thenUnwrap((obj) => obj.result);
    }
}
(function (OriginTLSClientAuth) {
    OriginTLSClientAuth.Hostnames = HostnamesAPI.Hostnames;
    OriginTLSClientAuth.Settings = SettingsAPI.Settings;
})(OriginTLSClientAuth || (OriginTLSClientAuth = {}));
//# sourceMappingURL=origin-tls-client-auth.mjs.map