cloudflare
Version:
The official TypeScript library for the Cloudflare API
55 lines • 2.19 kB
JavaScript
;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.ViewListResponsesV4PagePaginationArray = exports.Views = void 0;
const resource_1 = require("../../../../resource.js");
const pagination_1 = require("../../../../pagination.js");
class Views extends resource_1.APIResource {
/**
* Create Internal DNS View for an account
*/
create(params, options) {
const { account_id, ...body } = params;
return this._client.post(`/accounts/${account_id}/dns_settings/views`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* List DNS Internal Views for an Account
*/
list(params, options) {
const { account_id, ...query } = params;
return this._client.getAPIList(`/accounts/${account_id}/dns_settings/views`, ViewListResponsesV4PagePaginationArray, { query, ...options });
}
/**
* Delete an existing Internal DNS View
*/
delete(viewId, params, options) {
const { account_id } = params;
return this._client.delete(`/accounts/${account_id}/dns_settings/views/${viewId}`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Update an existing Internal DNS View
*/
edit(viewId, params, options) {
const { account_id, ...body } = params;
return this._client.patch(`/accounts/${account_id}/dns_settings/views/${viewId}`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Get DNS Internal View
*/
get(viewId, params, options) {
const { account_id } = params;
return this._client.get(`/accounts/${account_id}/dns_settings/views/${viewId}`, options)._thenUnwrap((obj) => obj.result);
}
}
exports.Views = Views;
class ViewListResponsesV4PagePaginationArray extends pagination_1.V4PagePaginationArray {
}
exports.ViewListResponsesV4PagePaginationArray = ViewListResponsesV4PagePaginationArray;
Views.ViewListResponsesV4PagePaginationArray = ViewListResponsesV4PagePaginationArray;
//# sourceMappingURL=views.js.map