UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

61 lines • 2.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Account = exports.BaseAccount = void 0; const tslib_1 = require("../../../../internal/tslib.js"); // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. const resource_1 = require("../../../../core/resource.js"); const ViewsAPI = tslib_1.__importStar(require("./views.js")); const views_1 = require("./views.js"); const path_1 = require("../../../../internal/utils/path.js"); var BaseAccount = /* @__PURE__ */ (() => { class BaseAccount extends resource_1.APIResource { /** * Update DNS settings for an account * * @example * ```ts * const response = await client.dns.settings.account.edit({ * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * }); * ``` */ edit(params, options) { const { account_id, ...body } = params; return this._client.patch((0, path_1.path) `/accounts/${account_id}/dns_settings`, { body, ...options })._thenUnwrap((obj) => obj.result); } /** * Show DNS settings for an account * * @example * ```ts * const account = await client.dns.settings.account.get({ * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * }); * ``` */ get(params, options) { const { account_id } = params; return this._client.get((0, path_1.path) `/accounts/${account_id}/dns_settings`, options)._thenUnwrap((obj) => obj.result); } } BaseAccount._key = Object.freeze([ 'dns', 'settings', 'account', ]); return BaseAccount; })(); exports.BaseAccount = BaseAccount; var Account = /* @__PURE__ */ (() => { class Account extends BaseAccount { constructor() { super(...arguments); this.views = new ViewsAPI.Views(this._client); } } Account.Views = views_1.Views; Account.BaseViews = views_1.BaseViews; return Account; })(); exports.Account = Account; //# sourceMappingURL=account.js.map