UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

55 lines • 1.86 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../../../core/resource.mjs"; import * as ViewsAPI from "./views.mjs"; import { BaseViews, Views, } from "./views.mjs"; import { path } from "../../../../internal/utils/path.mjs"; export var BaseAccount = /* @__PURE__ */ (() => { class BaseAccount extends 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(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(path `/accounts/${account_id}/dns_settings`, options)._thenUnwrap((obj) => obj.result); } } BaseAccount._key = Object.freeze([ 'dns', 'settings', 'account', ]); return BaseAccount; })(); export var Account = /* @__PURE__ */ (() => { class Account extends BaseAccount { constructor() { super(...arguments); this.views = new ViewsAPI.Views(this._client); } } Account.Views = Views; Account.BaseViews = BaseViews; return Account; })(); //# sourceMappingURL=account.mjs.map