Repository navigation
Expand file tree
/
Copy pathdata-retention.ts
More file actions
92 lines (84 loc) · 2.55 KB
/
Copy pathdata-retention.ts
File metadata and controls
92 lines (84 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
import { APIResource } from '../../../core/resource';
import { APIPromise } from '../../../core/api-promise';
import { RequestOptions } from '../../../internal/request-options';
function resolveResourceRequestOptions(
options: RequestOptions | undefined,
buildOptions: (options: RequestOptions | undefined) => RequestOptions | Promise<RequestOptions>,
): Promise<RequestOptions> {
return Promise.resolve(options).then(buildOptions);
}
export class DataRetention extends APIResource {
/**
* Retrieves organization data retention controls.
*
* @example
* ```ts
* const organizationDataRetention =
* await client.admin.organization.dataRetention.retrieve();
* ```
*/
retrieve(options?: RequestOptions): APIPromise<OrganizationDataRetention> {
return this._client.get(
'/organization/data_retention',
resolveResourceRequestOptions(options, (options) => ({
...options,
__security: { adminAPIKeyAuth: true },
})),
);
}
/**
* Updates organization data retention controls.
*
* @example
* ```ts
* const organizationDataRetention =
* await client.admin.organization.dataRetention.update({
* retention_type: 'zero_data_retention',
* });
* ```
*/
update(body: DataRetentionUpdateParams, options?: RequestOptions): APIPromise<OrganizationDataRetention> {
return this._client.post(
'/organization/data_retention',
resolveResourceRequestOptions(options, (options) => ({
body,
...options,
__security: { adminAPIKeyAuth: true },
})),
);
}
}
/**
* Represents the organization's data retention control setting.
*/
export interface OrganizationDataRetention {
/**
* The object type, which is always `organization.data_retention`.
*/
object: 'organization.data_retention';
/**
* The configured organization data retention type.
*/
type:
| 'zero_data_retention'
| 'modified_abuse_monitoring'
| 'enhanced_zero_data_retention'
| 'enhanced_modified_abuse_monitoring';
}
export interface DataRetentionUpdateParams {
/**
* The desired organization data retention type.
*/
retention_type:
| 'zero_data_retention'
| 'modified_abuse_monitoring'
| 'enhanced_zero_data_retention'
| 'enhanced_modified_abuse_monitoring';
}
export declare namespace DataRetention {
export {
type OrganizationDataRetention as OrganizationDataRetention,
type DataRetentionUpdateParams as DataRetentionUpdateParams,
};
}