cloudflare
Version:
The official TypeScript library for the Cloudflare API
60 lines • 2.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AccountMapping = exports.BaseAccountMapping = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../../../core/resource.js");
const path_1 = require("../../../../internal/utils/path.js");
var BaseAccountMapping = /* @__PURE__ */ (() => {
class BaseAccountMapping extends resource_1.APIResource {
/**
* Creates a mapping between a Cloudflare account and an email provider for DLP
* email scanning integration.
*
* @example
* ```ts
* const accountMapping =
* await client.zeroTrust.dlp.email.accountMapping.create({
* account_id: 'account_id',
* auth_requirements: {
* allowed_microsoft_organizations: ['string'],
* type: 'Org',
* },
* });
* ```
*/
create(params, options) {
const { account_id, ...body } = params;
return this._client.post((0, path_1.path) `/accounts/${account_id}/dlp/email/account_mapping`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Retrieves the email provider mapping configuration for DLP email scanning.
*
* @example
* ```ts
* const accountMapping =
* await client.zeroTrust.dlp.email.accountMapping.get({
* account_id: 'account_id',
* });
* ```
*/
get(params, options) {
const { account_id } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/dlp/email/account_mapping`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseAccountMapping._key = Object.freeze([
'zeroTrust',
'dlp',
'email',
'accountMapping',
]);
return BaseAccountMapping;
})();
exports.BaseAccountMapping = BaseAccountMapping;
class AccountMapping extends BaseAccountMapping {
}
exports.AccountMapping = AccountMapping;
//# sourceMappingURL=account-mapping.js.map