cloudflare
Version:
The official TypeScript library for the Cloudflare API
55 lines • 1.96 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../core/resource.mjs";
import { path } from "../../../../internal/utils/path.mjs";
export var BaseAccountMapping = /* @__PURE__ */ (() => {
class BaseAccountMapping extends 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(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(path `/accounts/${account_id}/dlp/email/account_mapping`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseAccountMapping._key = Object.freeze([
'zeroTrust',
'dlp',
'email',
'accountMapping',
]);
return BaseAccountMapping;
})();
export class AccountMapping extends BaseAccountMapping {
}
//# sourceMappingURL=account-mapping.mjs.map