cloudflare
Version:
The official TypeScript library for the Cloudflare API
38 lines • 1.68 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflare/resource';
import { isRequestOptions } from 'cloudflare/core';
import { SinglePage } from 'cloudflare/pagination';
export class OriginCACertificates extends 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 (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, body, options) {
return this._client.delete(`/certificates/${certificateId}`, { body, ...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);
}
}
export class OriginCACertificatesSinglePage extends SinglePage {
}
//# sourceMappingURL=origin-ca-certificates.mjs.map