// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflaredev/resource';
import * as CertificatePacksAPI from 'cloudflaredev/resources/ssl/certificate-packs/certificate-packs';
import * as OrderAPI from 'cloudflaredev/resources/ssl/certificate-packs/order';
import * as QuotaAPI from 'cloudflaredev/resources/ssl/certificate-packs/quota';
import { SinglePage } from 'cloudflaredev/pagination';
export class CertificatePacks extends APIResource {
    constructor() {
        super(...arguments);
        this.order = new OrderAPI.Order(this._client);
        this.quota = new QuotaAPI.Quota(this._client);
    }
    /**
     * For a given zone, list all active certificate packs.
     */
    list(params, options) {
        const { zone_id, ...query } = params;
        return this._client.getAPIList(`/zones/${zone_id}/ssl/certificate_packs`, CertificatePackListResponsesSinglePage, { query, ...options });
    }
    /**
     * For a given zone, delete an advanced certificate pack.
     */
    delete(certificatePackId, params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}/ssl/certificate_packs/${certificatePackId}`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * For a given zone, restart validation for an advanced certificate pack. This is
     * only a validation operation for a Certificate Pack in a validation_timed_out
     * status.
     */
    edit(certificatePackId, params, options) {
        const { zone_id, body } = params;
        return this._client.patch(`/zones/${zone_id}/ssl/certificate_packs/${certificatePackId}`, {
            body: body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    /**
     * For a given zone, get a certificate pack.
     */
    get(certificatePackId, params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}/ssl/certificate_packs/${certificatePackId}`, options)._thenUnwrap((obj) => obj.result);
    }
}
export class CertificatePackListResponsesSinglePage extends SinglePage {
}
(function (CertificatePacks) {
    CertificatePacks.CertificatePackListResponsesSinglePage = CertificatePacksAPI.CertificatePackListResponsesSinglePage;
    CertificatePacks.Order = OrderAPI.Order;
    CertificatePacks.Quota = QuotaAPI.Quota;
})(CertificatePacks || (CertificatePacks = {}));
//# sourceMappingURL=certificate-packs.mjs.map