cloudflare
Version:
The official TypeScript library for the Cloudflare API
36 lines • 1.39 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflare/resource';
import * as DomainsAPI from 'cloudflare/resources/registrar/domains';
import { SinglePage } from 'cloudflare/pagination';
export class Domains extends APIResource {
/**
* Update individual domain.
*/
update(domainName, params, options) {
const { account_id, ...body } = params;
return this._client.put(`/accounts/${account_id}/registrar/domains/${domainName}`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* List domains handled by Registrar.
*/
list(params, options) {
const { account_id } = params;
return this._client.getAPIList(`/accounts/${account_id}/registrar/domains`, DomainListResponsesSinglePage, options);
}
/**
* Show individual domain.
*/
get(domainName, params, options) {
const { account_id } = params;
return this._client.get(`/accounts/${account_id}/registrar/domains/${domainName}`, options)._thenUnwrap((obj) => obj.result);
}
}
export class DomainListResponsesSinglePage extends SinglePage {
}
(function (Domains) {
Domains.DomainListResponsesSinglePage = DomainsAPI.DomainListResponsesSinglePage;
})(Domains || (Domains = {}));
//# sourceMappingURL=domains.mjs.map