UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

60 lines 2.85 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from 'cloudflare/resource'; import * as CustomCertificatesAPI from 'cloudflare/resources/custom-certificates/custom-certificates'; import * as PrioritizeAPI from 'cloudflare/resources/custom-certificates/prioritize'; import { V4PagePaginationArray } from 'cloudflare/pagination'; export class CustomCertificates extends APIResource { constructor() { super(...arguments); this.prioritize = new PrioritizeAPI.Prioritize(this._client); } /** * Upload a new SSL certificate for a zone. */ create(params, options) { const { zone_id, ...body } = params; return this._client.post(`/zones/${zone_id}/custom_certificates`, { body, ...options })._thenUnwrap((obj) => obj.result); } /** * List, search, and filter all of your custom SSL certificates. The higher * priority will break ties across overlapping 'legacy_custom' certificates, but * 'legacy_custom' certificates will always supercede 'sni_custom' certificates. */ list(params, options) { const { zone_id, ...query } = params; return this._client.getAPIList(`/zones/${zone_id}/custom_certificates`, CustomCertificatesV4PagePaginationArray, { query, ...options }); } /** * Remove a SSL certificate from a zone. */ delete(customCertificateId, params, options) { const { zone_id } = params; return this._client.delete(`/zones/${zone_id}/custom_certificates/${customCertificateId}`, options)._thenUnwrap((obj) => obj.result); } /** * Upload a new private key and/or PEM/CRT for the SSL certificate. Note: PATCHing * a configuration for sni_custom certificates will result in a new resource id * being returned, and the previous one being deleted. */ edit(customCertificateId, params, options) { const { zone_id, ...body } = params; return this._client.patch(`/zones/${zone_id}/custom_certificates/${customCertificateId}`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * SSL Configuration Details */ get(customCertificateId, params, options) { const { zone_id } = params; return this._client.get(`/zones/${zone_id}/custom_certificates/${customCertificateId}`, options)._thenUnwrap((obj) => obj.result); } } export class CustomCertificatesV4PagePaginationArray extends V4PagePaginationArray { } (function (CustomCertificates) { CustomCertificates.CustomCertificatesV4PagePaginationArray = CustomCertificatesAPI.CustomCertificatesV4PagePaginationArray; CustomCertificates.Prioritize = PrioritizeAPI.Prioritize; })(CustomCertificates || (CustomCertificates = {})); //# sourceMappingURL=custom-certificates.mjs.map