-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobjects.ts
More file actions
159 lines (134 loc) · 4.57 KB
/
Copy pathobjects.ts
File metadata and controls
159 lines (134 loc) · 4.57 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../core/resource';
import { APIPromise } from '../../core/api-promise';
import { RequestOptions } from '../../internal/request-options';
import { path } from '../../internal/utils/path';
export class Objects extends APIResource {
create(body: ObjectCreateParams, options?: RequestOptions): APIPromise<ObjectCreateResponse> {
return this._client.post('/data/v1/objects', { body, ...options });
}
retrieve(objectName: string, options?: RequestOptions): APIPromise<ObjectRetrieveResponse> {
return this._client.get(path`/data/v1/objects/${objectName}`, options);
}
update(
objectName: string,
body: ObjectUpdateParams,
options?: RequestOptions,
): APIPromise<ObjectUpdateResponse> {
return this._client.patch(path`/data/v1/objects/${objectName}`, { body, ...options });
}
list(options?: RequestOptions): APIPromise<ObjectListResponse> {
return this._client.get('/data/v1/objects', options);
}
delete(objectName: string, options?: RequestOptions): APIPromise<ObjectDeleteResponse> {
return this._client.delete(path`/data/v1/objects/${objectName}`, options);
}
}
export interface UObject {
/**
* This is the unique identifier for the object at the API level. It is unique
* within Unify and cannot be changed.
*/
api_name: string;
/**
* This is a description of the object. It is not required but will be shown in the
* UI to help understand the purpose of the object. Typically, this should be a
* short sentence or two explaining the object.
*/
description: string | null;
/**
* This is the user-facing object name shown within Unify. It is not required to be
* unique within Unify and can be changed at any time.
*/
display_name: string;
/**
* Represents who created and manages an object in Unify.
*
* In most ways, all objects within the Unify platform behave the same way
* regardless of whether they are defined by Unify or as custom objects by a plugin
* or user. This includes the ability to define custom attributes and access
* records via API.
*
* However, there are some subtle distinctions that require differentiating between
* these classifications of objects. This enumeration is used to represent these
* distinctions.
*/
provider: 'UNIFY' | 'CUSTOMER';
}
/**
* Response for a successful create operation.
*/
export interface ObjectCreateResponse {
data: UObject;
status: 'success';
}
/**
* Response for a successful get operation.
*/
export interface ObjectRetrieveResponse {
data: UObject;
status: 'success';
}
/**
* Response for a successful update operation.
*/
export interface ObjectUpdateResponse {
data: UObject;
status: 'success';
}
/**
* Response for a successful list operation.
*/
export interface ObjectListResponse {
data: Array<UObject>;
status: 'success';
}
/**
* Response for a successful delete operation.
*/
export interface ObjectDeleteResponse {
status: 'success';
}
export interface ObjectCreateParams {
/**
* This is the unique identifier for the object at the API level. It is unique
* within Unify and cannot be changed.
*/
api_name: string;
/**
* This is a description of the object. It is not required but will be shown in the
* UI to help understand the purpose of the object. Typically, this should be a
* short sentence or two explaining the object.
*/
description: string | null;
/**
* This is the user-facing object name shown within Unify. It is not required to be
* unique within Unify and can be changed at any time.
*/
display_name: string;
}
export interface ObjectUpdateParams {
/**
* This is a description of the object. It is not required but will be shown in the
* UI to help understand the purpose of the object. Typically, this should be a
* short sentence or two explaining the object.
*/
description: string | null;
/**
* This is the user-facing object name shown within Unify. It is not required to be
* unique within Unify and can be changed at any time.
*/
display_name: string;
}
export declare namespace Objects {
export {
type UObject as UObject,
type ObjectCreateResponse as ObjectCreateResponse,
type ObjectRetrieveResponse as ObjectRetrieveResponse,
type ObjectUpdateResponse as ObjectUpdateResponse,
type ObjectListResponse as ObjectListResponse,
type ObjectDeleteResponse as ObjectDeleteResponse,
type ObjectCreateParams as ObjectCreateParams,
type ObjectUpdateParams as ObjectUpdateParams,
};
}