-
Notifications
You must be signed in to change notification settings - Fork 0
/
attribute-group.ts
260 lines (258 loc) · 6.48 KB
/
attribute-group.ts
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
/**
* Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
* Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
* For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
*/
import { BaseResource, CreatedBy, LastModifiedBy, LocalizedString } from './common.js'
export interface AttributeGroup extends BaseResource {
/**
* Platform-generated unique identifier of the AttributeGroup.
*
*
*/
readonly id: string
/**
* Current version of the AttributeGroup.
*
*
*/
readonly version: number
/**
* Date and time (UTC) the AttributeGroup was initially created.
*
*
*/
readonly createdAt: string
/**
* Date and time (UTC) the AttributeGroup was last updated.
*
*
*/
readonly lastModifiedAt: string
/**
* Present on resources created after 1 February 2019 except for [events not tracked](/../api/client-logging#events-tracked).
*
*
*/
readonly lastModifiedBy?: LastModifiedBy
/**
* Present on resources created after 1 February 2019 except for [events not tracked](/../api/client-logging#events-tracked).
*
*
*/
readonly createdBy?: CreatedBy
/**
* Name of the AttributeGroup.
*
*
*/
readonly name: LocalizedString
/**
* Description of the AttributeGroup.
*
*
*/
readonly description?: LocalizedString
/**
* [Attributes](ctp:api:type:AttributeDefinition) with unique values.
*
*
*/
readonly attributes: AttributeReference[]
/**
* User-defined unique identifier of the AttributeGroup.
*
*
*/
readonly key?: string
}
export interface AttributeGroupDraft {
/**
* Name of the AttributeGroup.
*
*
*/
readonly name: LocalizedString
/**
* Description of the AttributeGroup.
*
*
*/
readonly description?: LocalizedString
/**
* [Attributes](ctp:api:type:AttributeDefinition) with unique values.
*
*
*/
readonly attributes: AttributeReference[]
/**
* User-defined unique identifier for the AttributeGroup.
*
*
*/
readonly key?: string
}
/**
* [PagedQueryResult](/../api/general-concepts#pagedqueryresult) with `results` containing an array of [AttributeGroup](ctp:api:type:AttributeGroup).
*
*/
export interface AttributeGroupPagedQueryResponse {
/**
* Number of results requested in the query request.
*
*
*/
readonly limit: number
/**
* Offset supplied by the client or the server default.
* It is the number of elements skipped, not a page number.
*
*
*/
readonly offset: number
/**
* Actual number of results returned.
*
*
*/
readonly count: number
/**
* Total number of results matching the query.
* This number is an estimation that is not [strongly consistent](/../api/general-concepts#strong-consistency).
* This field is returned by default.
* For improved performance, calculating this field can be deactivated by using the query parameter `withTotal=false`.
* When the results are filtered with a [Query Predicate](/../api/predicates/query), `total` is subject to a [limit](/../api/limits#queries).
*
*
*/
readonly total?: number
/**
* [AttributeGroups](ctp:api:type:AttributeGroup) matching the query.
*
*
*/
readonly results: AttributeGroup[]
}
/**
* [Reference](/../api/types#reference) to an [AttributeGroup](ctp:api:type:AttributeGroup).
*
*/
export interface AttributeGroupReference {
readonly typeId: 'attribute-group'
/**
* Platform-generated unique identifier of the referenced [AttributeGroup](ctp:api:type:AttributeGroup).
*
*
*/
readonly id: string
/**
* Contains the representation of the expanded AttributeGroup. Only present in responses to requests with [Reference Expansion](/../api/general-concepts#reference-expansion) for AttributeGroup.
*
*
*/
readonly obj?: AttributeGroup
}
/**
* [ResourceIdentifier](/../api/types#resourceidentifier) to an [AttributeGroup](ctp:api:type:AttributeGroup).
*
*/
export interface AttributeGroupResourceIdentifier {
readonly typeId: 'attribute-group'
/**
* Platform-generated unique identifier of the referenced [AttributeGroup](ctp:api:type:AttributeGroup). Either `id` or `key` is required.
*
*
*/
readonly id?: string
/**
* User-generated unique identifier of the referenced [AttributeGroup](ctp:api:type:AttributeGroup). Either `id` or `key` is required.
*
*
*/
readonly key?: string
}
export interface AttributeGroupUpdate {
/**
* Expected version of the AttributeGroup on which the changes should be applied. If the expected version does not match the actual version, a [409 Conflict](/../api/errors#409-conflict) will be returned.
*
*
*/
readonly version: number
/**
* Update actions to be performed on the AttributeGroup.
*
*
*/
readonly actions: AttributeGroupUpdateAction[]
}
export type AttributeGroupUpdateAction =
| AttributeGroupAddAttributeAction
| AttributeGroupChangeNameAction
| AttributeGroupRemoveAttributeAction
| AttributeGroupSetAttributesAction
| AttributeGroupSetDescriptionAction
| AttributeGroupSetKeyAction
export interface AttributeReference {
/**
* The Attribute's `name` as given in its [AttributeDefinition](ctp:api:type:AttributeDefinition).
*
*
*/
readonly key: string
}
export interface AttributeGroupAddAttributeAction {
readonly action: 'addAttribute'
/**
* Value to add.
*
*
*/
readonly attribute: AttributeReference
}
export interface AttributeGroupChangeNameAction {
readonly action: 'changeName'
/**
* New value to set.
* Must not be empty.
*
*
*/
readonly name: LocalizedString
}
export interface AttributeGroupRemoveAttributeAction {
readonly action: 'removeAttribute'
/**
* Value to remove.
*
*
*/
readonly attribute: AttributeReference
}
export interface AttributeGroupSetAttributesAction {
readonly action: 'setAttributes'
/**
* New unique values to set.
*
*
*/
readonly attributes: AttributeReference[]
}
export interface AttributeGroupSetDescriptionAction {
readonly action: 'setDescription'
/**
* Value to set.
* If empty, any existing value will be removed.
*
*
*/
readonly description?: LocalizedString
}
export interface AttributeGroupSetKeyAction {
readonly action: 'setKey'
/**
* If `key` is absent or `null`, the existing key, if any, will be removed.
*
*
*/
readonly key?: string
}