// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflaredev/resource';
import * as SettingsAPI from 'cloudflaredev/resources/origin-tls-client-auth/settings';
import * as HostnamesAPI from 'cloudflaredev/resources/origin-tls-client-auth/hostnames/hostnames';
import { SinglePage } from 'cloudflaredev/pagination';
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.getAPIList(`/zones/${zone_id}/origin_tls_client_auth`, ZoneAuthenticatedOriginPullsSinglePage, options);
    }
    /**
     * 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);
    }
}
export class ZoneAuthenticatedOriginPullsSinglePage extends SinglePage {
}
(function (OriginTLSClientAuth) {
    OriginTLSClientAuth.Hostnames = HostnamesAPI.Hostnames;
    OriginTLSClientAuth.Settings = SettingsAPI.Settings;
})(OriginTLSClientAuth || (OriginTLSClientAuth = {}));
//# sourceMappingURL=origin-tls-client-auth.mjs.map