cloudflare
Version:
The official TypeScript library for the Cloudflare API
114 lines • 4.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TSIGs = exports.BaseTSIGs = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../../core/resource.js");
const pagination_1 = require("../../../core/pagination.js");
const path_1 = require("../../../internal/utils/path.js");
var BaseTSIGs = /* @__PURE__ */ (() => {
class BaseTSIGs extends resource_1.APIResource {
/**
* Create TSIG.
*
* @example
* ```ts
* const tsig = await client.dns.zoneTransfers.tsigs.create({
* account_id: '01a7362d577a6c3019a474fd6f485823',
* algo: 'hmac-sha512.',
* name: 'tsig.customer.cf.',
* secret:
* 'caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c',
* });
* ```
*/
create(params, options) {
const { account_id, ...body } = params;
return this._client.post((0, path_1.path) `/accounts/${account_id}/secondary_dns/tsigs`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Modify TSIG.
*
* @example
* ```ts
* const tsig = await client.dns.zoneTransfers.tsigs.update(
* '69cd1e104af3e6ed3cb344f263fd0d5a',
* {
* account_id: '01a7362d577a6c3019a474fd6f485823',
* algo: 'hmac-sha512.',
* name: 'tsig.customer.cf.',
* secret:
* 'caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c',
* },
* );
* ```
*/
update(tsigID, params, options) {
const { account_id, ...body } = params;
return this._client.put((0, path_1.path) `/accounts/${account_id}/secondary_dns/tsigs/${tsigID}`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* List TSIGs.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const tsig of client.dns.zoneTransfers.tsigs.list(
* { account_id: '01a7362d577a6c3019a474fd6f485823' },
* )) {
* // ...
* }
* ```
*/
list(params, options) {
const { account_id } = params;
return this._client.getAPIList((0, path_1.path) `/accounts/${account_id}/secondary_dns/tsigs`, (pagination_1.SinglePage), options);
}
/**
* Delete TSIG.
*
* @example
* ```ts
* const tsig = await client.dns.zoneTransfers.tsigs.delete(
* '69cd1e104af3e6ed3cb344f263fd0d5a',
* { account_id: '01a7362d577a6c3019a474fd6f485823' },
* );
* ```
*/
delete(tsigID, params, options) {
const { account_id } = params;
return this._client.delete((0, path_1.path) `/accounts/${account_id}/secondary_dns/tsigs/${tsigID}`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Get TSIG.
*
* @example
* ```ts
* const tsig = await client.dns.zoneTransfers.tsigs.get(
* '69cd1e104af3e6ed3cb344f263fd0d5a',
* { account_id: '01a7362d577a6c3019a474fd6f485823' },
* );
* ```
*/
get(tsigID, params, options) {
const { account_id } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/secondary_dns/tsigs/${tsigID}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseTSIGs._key = Object.freeze([
'dns',
'zoneTransfers',
'tsigs',
]);
return BaseTSIGs;
})();
exports.BaseTSIGs = BaseTSIGs;
class TSIGs extends BaseTSIGs {
}
exports.TSIGs = TSIGs;
//# sourceMappingURL=tsigs.js.map