"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.OriginCACertificatesSinglePage = exports.OriginCACertificates = void 0;
const resource_1 = require("cloudflaredev/resource");
const core_1 = require("cloudflaredev/core");
const pagination_1 = require("cloudflaredev/pagination");
class OriginCACertificates extends resource_1.APIResource {
    /**
     * Create an Origin CA certificate. Use your Origin CA Key as your User Service Key
     * when calling this endpoint ([see above](#requests)).
     */
    create(body, options) {
        return this._client.post('/certificates', { body, ...options })._thenUnwrap((obj) => obj.result);
    }
    list(query = {}, options) {
        if ((0, core_1.isRequestOptions)(query)) {
            return this.list({}, query);
        }
        return this._client.getAPIList('/certificates', OriginCACertificatesSinglePage, { query, ...options });
    }
    /**
     * Revoke an existing Origin CA certificate by its serial number. Use your Origin
     * CA Key as your User Service Key when calling this endpoint
     * ([see above](#requests)).
     */
    delete(certificateId, options) {
        return this._client.delete(`/certificates/${certificateId}`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Get an existing Origin CA certificate by its serial number. Use your Origin CA
     * Key as your User Service Key when calling this endpoint
     * ([see above](#requests)).
     */
    get(certificateId, options) {
        return this._client.get(`/certificates/${certificateId}`, options)._thenUnwrap((obj) => obj.result);
    }
}
exports.OriginCACertificates = OriginCACertificates;
class OriginCACertificatesSinglePage extends pagination_1.SinglePage {
}
exports.OriginCACertificatesSinglePage = OriginCACertificatesSinglePage;
//# sourceMappingURL=origin-ca-certificates.js.map