UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

53 lines 2.58 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from 'cloudflare/resource'; import * as OriginTLSClientAuthAPI from 'cloudflare/resources/origin-tls-client-auth/origin-tls-client-auth'; import * as SettingsAPI from 'cloudflare/resources/origin-tls-client-auth/settings'; import * as HostnamesAPI from 'cloudflare/resources/origin-tls-client-auth/hostnames/hostnames'; import { SinglePage } from 'cloudflare/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`, OriginTLSClientAuthListResponsesSinglePage, 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 OriginTLSClientAuthListResponsesSinglePage extends SinglePage { } (function (OriginTLSClientAuth) { OriginTLSClientAuth.OriginTLSClientAuthListResponsesSinglePage = OriginTLSClientAuthAPI.OriginTLSClientAuthListResponsesSinglePage; OriginTLSClientAuth.Hostnames = HostnamesAPI.Hostnames; OriginTLSClientAuth.Settings = SettingsAPI.Settings; })(OriginTLSClientAuth || (OriginTLSClientAuth = {})); //# sourceMappingURL=origin-tls-client-auth.mjs.map