@remkoj/optimizely-cms-api 2.0.0-pre3 → 2.0.0-pre4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/client/CmsIntegrationApiClient.d.ts +2 -0
  2. package/dist/client/CmsIntegrationApiClient.js +36 -34
  3. package/dist/client/core/ApiError.js +15 -15
  4. package/dist/client/core/ApiRequestOptions.js +2 -2
  5. package/dist/client/core/ApiResult.js +2 -2
  6. package/dist/client/core/BaseHttpRequest.js +9 -9
  7. package/dist/client/core/CancelablePromise.js +116 -116
  8. package/dist/client/core/FetchHttpRequest.js +20 -20
  9. package/dist/client/core/OpenAPI.js +14 -14
  10. package/dist/client/core/request.js +294 -294
  11. package/dist/client/index.d.ts +5 -0
  12. package/dist/client/index.js +48 -46
  13. package/dist/client/models/BinaryProperty.js +2 -2
  14. package/dist/client/models/BooleanProperty.js +2 -2
  15. package/dist/client/models/Changeset.js +2 -2
  16. package/dist/client/models/ChangesetItem.js +2 -2
  17. package/dist/client/models/ChangesetItemPage.js +2 -2
  18. package/dist/client/models/ChangesetPage.js +2 -2
  19. package/dist/client/models/ComponentListItem.js +2 -2
  20. package/dist/client/models/ComponentProperty.js +2 -2
  21. package/dist/client/models/ContentBaseType.js +19 -19
  22. package/dist/client/models/ContentComponent.js +2 -2
  23. package/dist/client/models/ContentItem.js +2 -2
  24. package/dist/client/models/ContentItemListWithContentTypes.js +2 -2
  25. package/dist/client/models/ContentItemPage.js +2 -2
  26. package/dist/client/models/ContentItemWithContentTypes.js +2 -2
  27. package/dist/client/models/ContentListItem.js +2 -2
  28. package/dist/client/models/ContentLocaleInfo.js +2 -2
  29. package/dist/client/models/ContentMetadata.js +2 -2
  30. package/dist/client/models/ContentMetadataPage.js +2 -2
  31. package/dist/client/models/ContentProperty.js +2 -2
  32. package/dist/client/models/ContentReference.js +2 -2
  33. package/dist/client/models/ContentReferenceListItem.js +2 -2
  34. package/dist/client/models/ContentReferenceProperty.js +2 -2
  35. package/dist/client/models/ContentType.js +2 -2
  36. package/dist/client/models/ContentTypeFeature.js +18 -18
  37. package/dist/client/models/ContentTypePage.js +2 -2
  38. package/dist/client/models/ContentTypeProperty.js +2 -2
  39. package/dist/client/models/ContentTypeUsage.js +15 -15
  40. package/dist/client/models/CopyContentOptions.js +2 -2
  41. package/dist/client/models/DateTimeListItem.js +2 -2
  42. package/dist/client/models/DateTimeProperty.js +2 -2
  43. package/dist/client/models/DisplaySetting.d.ts +22 -0
  44. package/dist/client/models/DisplaySetting.js +2 -0
  45. package/dist/client/models/DisplaySettingChoice.d.ts +13 -0
  46. package/dist/client/models/DisplaySettingChoice.js +2 -0
  47. package/dist/client/models/DisplayTemplate.d.ts +49 -0
  48. package/dist/client/models/DisplayTemplate.js +2 -0
  49. package/dist/client/models/DisplayTemplatePage.d.ts +19 -0
  50. package/dist/client/models/DisplayTemplatePage.js +2 -0
  51. package/dist/client/models/DoubleEnumerationSettings.js +2 -2
  52. package/dist/client/models/FloatListItem.js +2 -2
  53. package/dist/client/models/FloatProperty.js +2 -2
  54. package/dist/client/models/ImageDescriptor.js +2 -2
  55. package/dist/client/models/ImportPackageMessage.js +2 -2
  56. package/dist/client/models/ImportPackageResult.js +2 -2
  57. package/dist/client/models/IndexingType.js +16 -16
  58. package/dist/client/models/Int32EnumerationSettings.js +2 -2
  59. package/dist/client/models/IntegerListItem.js +2 -2
  60. package/dist/client/models/IntegerProperty.js +2 -2
  61. package/dist/client/models/JsonStringProperty.js +2 -2
  62. package/dist/client/models/ListProperty.js +2 -2
  63. package/dist/client/models/ListPropertyItem.js +2 -2
  64. package/dist/client/models/LocaleStatus.js +15 -15
  65. package/dist/client/models/Manifest.d.ts +5 -0
  66. package/dist/client/models/Manifest.js +2 -2
  67. package/dist/client/models/OauthToken.js +2 -2
  68. package/dist/client/models/OauthTokenError.js +2 -2
  69. package/dist/client/models/OauthTokenRequest.js +2 -2
  70. package/dist/client/models/PackageJob.js +2 -2
  71. package/dist/client/models/PackageJobMessage.js +2 -2
  72. package/dist/client/models/PackageJobStatus.js +2 -2
  73. package/dist/client/models/ProblemDetails.js +2 -2
  74. package/dist/client/models/PropertyDataType.js +26 -26
  75. package/dist/client/models/PropertyFormat.js +2 -2
  76. package/dist/client/models/PropertyFormatPage.js +2 -2
  77. package/dist/client/models/PropertyGroup.js +2 -2
  78. package/dist/client/models/PropertyGroupPage.js +2 -2
  79. package/dist/client/models/StringEnumerationSettings.js +2 -2
  80. package/dist/client/models/StringListItem.js +2 -2
  81. package/dist/client/models/StringProperty.js +2 -2
  82. package/dist/client/models/UrlListItem.js +2 -2
  83. package/dist/client/models/UrlProperty.js +2 -2
  84. package/dist/client/models/VersionStatus.js +20 -20
  85. package/dist/client/services/ChangesetsService.js +239 -239
  86. package/dist/client/services/ContentService.js +409 -409
  87. package/dist/client/services/ContentTypesService.js +149 -149
  88. package/dist/client/services/DisplayTemplatesService.d.ts +60 -0
  89. package/dist/client/services/DisplayTemplatesService.js +135 -0
  90. package/dist/client/services/OauthService.js +28 -28
  91. package/dist/client/services/PackagesService.js +80 -80
  92. package/dist/client/services/PropertyFormatsService.js +53 -53
  93. package/dist/client/services/PropertyGroupsService.js +135 -135
  94. package/dist/config.d.ts +1 -0
  95. package/dist/config.js +40 -39
  96. package/dist/index.js +95 -95
  97. package/package.json +1 -1
@@ -1,409 +1,409 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ContentService = void 0;
4
- class ContentService {
5
- constructor(httpRequest) {
6
- this.httpRequest = httpRequest;
7
- }
8
- /**
9
- * Create content
10
- * Create a new content item.
11
- * @param requestBody The content item that should be created.
12
- * @param skipValidation Indicates that the content validation should be ignored.
13
- * @returns ContentItem Created
14
- * @throws ApiError
15
- */
16
- contentCreate(requestBody, skipValidation) {
17
- return this.httpRequest.request({
18
- method: 'POST',
19
- url: '/content',
20
- query: {
21
- 'skipValidation': skipValidation,
22
- },
23
- body: requestBody,
24
- mediaType: 'application/json',
25
- errors: {
26
- 400: `Bad Request`,
27
- 403: `Forbidden`,
28
- },
29
- });
30
- }
31
- /**
32
- * Get content
33
- * Get shared metadata about the content instance with the provided key.
34
- * @param key The key of the content to retrieve metadata for.
35
- * @param allowDeleted Indicates that metadata for a deleted content may be returned.
36
- * @returns ContentMetadata Success
37
- * @throws ApiError
38
- */
39
- contentGetMetadata(key, allowDeleted) {
40
- return this.httpRequest.request({
41
- method: 'GET',
42
- url: '/content/{key}',
43
- path: {
44
- 'key': key,
45
- },
46
- query: {
47
- 'allowDeleted': allowDeleted,
48
- },
49
- errors: {
50
- 403: `Forbidden`,
51
- },
52
- });
53
- }
54
- /**
55
- * Update content
56
- * Update an existing content item. If a content item with the provided key does not exist an error is returned.
57
- * @param key The key of the content item to patch.
58
- * @param requestBody The values of the content item that should be updated.
59
- * @returns ContentMetadata Success
60
- * @throws ApiError
61
- */
62
- contentPatchMetadata(key, requestBody) {
63
- return this.httpRequest.request({
64
- method: 'PATCH',
65
- url: '/content/{key}',
66
- path: {
67
- 'key': key,
68
- },
69
- body: requestBody,
70
- mediaType: 'application/merge-patch+json',
71
- errors: {
72
- 400: `Bad Request`,
73
- 403: `Forbidden`,
74
- },
75
- });
76
- }
77
- /**
78
- * Delete content
79
- * Deletes the content item with the provided key. If a content item with the provided key does not exist an error is returned.
80
- * @param key The key of the content item to delete.
81
- * @param permanent Indicates that the content item should be permanently deleted immediately or if it should be soft deleted first.
82
- * @returns ContentMetadata Success
83
- * @throws ApiError
84
- */
85
- contentDelete(key, permanent) {
86
- return this.httpRequest.request({
87
- method: 'DELETE',
88
- url: '/content/{key}',
89
- path: {
90
- 'key': key,
91
- },
92
- query: {
93
- 'permanent': permanent,
94
- },
95
- errors: {
96
- 400: `Bad Request`,
97
- 403: `Forbidden`,
98
- },
99
- });
100
- }
101
- /**
102
- * Get content path
103
- * Get the content path with the provided key.
104
- * @param key The key of the content path to retrieve.
105
- * @param pageIndex
106
- * @param pageSize
107
- * @returns ContentMetadataPage Success
108
- * @throws ApiError
109
- */
110
- contentGetPath(key, pageIndex, pageSize) {
111
- return this.httpRequest.request({
112
- method: 'GET',
113
- url: '/content/{key}/path',
114
- path: {
115
- 'key': key,
116
- },
117
- query: {
118
- 'pageIndex': pageIndex,
119
- 'pageSize': pageSize,
120
- },
121
- errors: {
122
- 403: `Forbidden`,
123
- },
124
- });
125
- }
126
- /**
127
- * List content in container
128
- * List the content items located in a specific container.
129
- * @param key The key of the content to retrieve items for.
130
- * @param contentTypes Indicates which content types or base types to include in the list.
131
- * @param pageIndex
132
- * @param pageSize
133
- * @returns ContentMetadataPage Success
134
- * @throws ApiError
135
- */
136
- contentListItems(key, contentTypes, pageIndex, pageSize) {
137
- return this.httpRequest.request({
138
- method: 'GET',
139
- url: '/content/{key}/items',
140
- path: {
141
- 'key': key,
142
- },
143
- query: {
144
- 'contentTypes': contentTypes,
145
- 'pageIndex': pageIndex,
146
- 'pageSize': pageSize,
147
- },
148
- errors: {
149
- 403: `Forbidden`,
150
- },
151
- });
152
- }
153
- /**
154
- * List assets
155
- * List the assets that belongs to a content instance.
156
- * @param key The key of the content to retrieve assets for.
157
- * @param contentTypes Indicates which content types or base types to include in the list.
158
- * @param pageIndex
159
- * @param pageSize
160
- * @returns ContentMetadataPage Success
161
- * @throws ApiError
162
- */
163
- contentListAssets(key, contentTypes, pageIndex, pageSize) {
164
- return this.httpRequest.request({
165
- method: 'GET',
166
- url: '/content/{key}/assets',
167
- path: {
168
- 'key': key,
169
- },
170
- query: {
171
- 'contentTypes': contentTypes,
172
- 'pageIndex': pageIndex,
173
- 'pageSize': pageSize,
174
- },
175
- errors: {
176
- 403: `Forbidden`,
177
- },
178
- });
179
- }
180
- /**
181
- * Copy content
182
- * Create a copy of the content item with the provided key.
183
- * @param key The key of the content item to copy.
184
- * @param requestBody Optional instructions for how to copy content.
185
- * @returns ContentMetadata Success
186
- * @throws ApiError
187
- */
188
- contentCopy(key, requestBody) {
189
- return this.httpRequest.request({
190
- method: 'POST',
191
- url: '/content/{key}:copy',
192
- path: {
193
- 'key': key,
194
- },
195
- body: requestBody,
196
- mediaType: 'application/json',
197
- errors: {
198
- 400: `Bad Request`,
199
- 403: `Forbidden`,
200
- },
201
- });
202
- }
203
- /**
204
- * Restore content
205
- * Restore the deleted content item with the provided key. If a content item with the provided key is not deleted an error is returned.
206
- * @param key The key of the content item to undelete.
207
- * @returns ContentMetadata Success
208
- * @throws ApiError
209
- */
210
- contentUndelete(key) {
211
- return this.httpRequest.request({
212
- method: 'POST',
213
- url: '/content/{key}:undelete',
214
- path: {
215
- 'key': key,
216
- },
217
- errors: {
218
- 400: `Bad Request`,
219
- 403: `Forbidden`,
220
- },
221
- });
222
- }
223
- /**
224
- * Query versions
225
- * List content versions based on the provided query options.
226
- * @param locales Indicates which content locales that should be listed. Use 'NEUTRAL' to include locale-neutral content.
227
- * Locale must be a valid IETF BCP-47 language tag.
228
- * @param statuses Indicates which status content versions must have to be listed.
229
- * @param pageIndex
230
- * @param pageSize
231
- * @returns ContentItemPage Success
232
- * @throws ApiError
233
- */
234
- contentListAllVersions(locales, statuses, pageIndex, pageSize) {
235
- return this.httpRequest.request({
236
- method: 'GET',
237
- url: '/content/versions',
238
- query: {
239
- 'locales': locales,
240
- 'statuses': statuses,
241
- 'pageIndex': pageIndex,
242
- 'pageSize': pageSize,
243
- },
244
- errors: {
245
- 403: `Forbidden`,
246
- },
247
- });
248
- }
249
- /**
250
- * List versions
251
- * List versions of the content item with the provided key and the provided options.
252
- * @param key
253
- * @param locales Indicates which content locales that should be listed. Use 'NEUTRAL' to include locale-neutral content.
254
- * Locale must be a valid IETF BCP-47 language tag.
255
- * @param statuses Indicates which status content versions must have to be listed.
256
- * @param pageIndex
257
- * @param pageSize
258
- * @returns ContentItemPage Success
259
- * @throws ApiError
260
- */
261
- contentListVersions(key, locales, statuses, pageIndex, pageSize) {
262
- return this.httpRequest.request({
263
- method: 'GET',
264
- url: '/content/{key}/versions',
265
- path: {
266
- 'key': key,
267
- },
268
- query: {
269
- 'locales': locales,
270
- 'statuses': statuses,
271
- 'pageIndex': pageIndex,
272
- 'pageSize': pageSize,
273
- },
274
- errors: {
275
- 403: `Forbidden`,
276
- },
277
- });
278
- }
279
- /**
280
- * Create version
281
- * Create a new version of a content item.
282
- * @param key The key of the content item for which a new content version should be created.
283
- * @param requestBody The content version that should be created.
284
- * @param skipValidation Indicates that the content validation should be ignored.
285
- * @returns ContentItem Created
286
- * @throws ApiError
287
- */
288
- contentCreateVersion(key, requestBody, skipValidation) {
289
- return this.httpRequest.request({
290
- method: 'POST',
291
- url: '/content/{key}/versions',
292
- path: {
293
- 'key': key,
294
- },
295
- query: {
296
- 'skipValidation': skipValidation,
297
- },
298
- body: requestBody,
299
- mediaType: 'application/json',
300
- errors: {
301
- 400: `Bad Request`,
302
- 403: `Forbidden`,
303
- },
304
- });
305
- }
306
- /**
307
- * Delete locale
308
- * Deletes the content item with the provided key. If a content item with the provided key does not exist an error is returned.
309
- * @param key
310
- * @param locale
311
- * @returns ContentItem Success
312
- * @throws ApiError
313
- */
314
- contentDeleteLocale(key, locale) {
315
- return this.httpRequest.request({
316
- method: 'DELETE',
317
- url: '/content/{key}/versions',
318
- path: {
319
- 'key': key,
320
- },
321
- query: {
322
- 'locale': locale,
323
- },
324
- errors: {
325
- 400: `Bad Request`,
326
- 403: `Forbidden`,
327
- },
328
- });
329
- }
330
- /**
331
- * Get version
332
- * Get the content item with the provided key and version.
333
- * @param key
334
- * @param version
335
- * @param locale
336
- * @returns ContentItem Success
337
- * @throws ApiError
338
- */
339
- contentGetVersion(key, version, locale) {
340
- return this.httpRequest.request({
341
- method: 'GET',
342
- url: '/content/{key}/versions/{version}',
343
- path: {
344
- 'key': key,
345
- 'version': version,
346
- },
347
- query: {
348
- 'locale': locale,
349
- },
350
- errors: {
351
- 403: `Forbidden`,
352
- },
353
- });
354
- }
355
- /**
356
- * Update version
357
- * Update an existing content item. If a content item with the provided key does not exist an error is returned.
358
- * @param key The key of the content item that should be updated.
359
- * @param version The version of the content that should be updated.
360
- * @param requestBody The content information that should be updated.
361
- * @param locale The locale of the content that should be updated.
362
- * @param skipValidation Indicates that the content validation should be ignored.
363
- * @returns ContentItem Success
364
- * @throws ApiError
365
- */
366
- contentPatchVersion(key, version, requestBody, locale, skipValidation) {
367
- return this.httpRequest.request({
368
- method: 'PATCH',
369
- url: '/content/{key}/versions/{version}',
370
- path: {
371
- 'key': key,
372
- 'version': version,
373
- },
374
- query: {
375
- 'locale': locale,
376
- 'skipValidation': skipValidation,
377
- },
378
- body: requestBody,
379
- mediaType: 'application/merge-patch+json',
380
- errors: {
381
- 400: `Bad Request`,
382
- 403: `Forbidden`,
383
- },
384
- });
385
- }
386
- /**
387
- * Delete version
388
- * Deletes the content item with the provided key. If a content item with the provided key does not exist an error is returned.
389
- * @param key
390
- * @param version
391
- * @returns ContentItem Success
392
- * @throws ApiError
393
- */
394
- contentDeleteVersion(key, version) {
395
- return this.httpRequest.request({
396
- method: 'DELETE',
397
- url: '/content/{key}/versions/{version}',
398
- path: {
399
- 'key': key,
400
- 'version': version,
401
- },
402
- errors: {
403
- 400: `Bad Request`,
404
- 403: `Forbidden`,
405
- },
406
- });
407
- }
408
- }
409
- exports.ContentService = ContentService;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContentService = void 0;
4
+ class ContentService {
5
+ constructor(httpRequest) {
6
+ this.httpRequest = httpRequest;
7
+ }
8
+ /**
9
+ * Create content
10
+ * Create a new content item.
11
+ * @param requestBody The content item that should be created.
12
+ * @param skipValidation Indicates that the content validation should be ignored.
13
+ * @returns ContentItem Created
14
+ * @throws ApiError
15
+ */
16
+ contentCreate(requestBody, skipValidation) {
17
+ return this.httpRequest.request({
18
+ method: 'POST',
19
+ url: '/content',
20
+ query: {
21
+ 'skipValidation': skipValidation,
22
+ },
23
+ body: requestBody,
24
+ mediaType: 'application/json',
25
+ errors: {
26
+ 400: `Bad Request`,
27
+ 403: `Forbidden`,
28
+ },
29
+ });
30
+ }
31
+ /**
32
+ * Get content
33
+ * Get shared metadata about the content instance with the provided key.
34
+ * @param key The key of the content to retrieve metadata for.
35
+ * @param allowDeleted Indicates that metadata for a deleted content may be returned.
36
+ * @returns ContentMetadata Success
37
+ * @throws ApiError
38
+ */
39
+ contentGetMetadata(key, allowDeleted) {
40
+ return this.httpRequest.request({
41
+ method: 'GET',
42
+ url: '/content/{key}',
43
+ path: {
44
+ 'key': key,
45
+ },
46
+ query: {
47
+ 'allowDeleted': allowDeleted,
48
+ },
49
+ errors: {
50
+ 403: `Forbidden`,
51
+ },
52
+ });
53
+ }
54
+ /**
55
+ * Update content
56
+ * Update an existing content item. If a content item with the provided key does not exist an error is returned.
57
+ * @param key The key of the content item to patch.
58
+ * @param requestBody The values of the content item that should be updated.
59
+ * @returns ContentMetadata Success
60
+ * @throws ApiError
61
+ */
62
+ contentPatchMetadata(key, requestBody) {
63
+ return this.httpRequest.request({
64
+ method: 'PATCH',
65
+ url: '/content/{key}',
66
+ path: {
67
+ 'key': key,
68
+ },
69
+ body: requestBody,
70
+ mediaType: 'application/merge-patch+json',
71
+ errors: {
72
+ 400: `Bad Request`,
73
+ 403: `Forbidden`,
74
+ },
75
+ });
76
+ }
77
+ /**
78
+ * Delete content
79
+ * Deletes the content item with the provided key. If a content item with the provided key does not exist an error is returned.
80
+ * @param key The key of the content item to delete.
81
+ * @param permanent Indicates that the content item should be permanently deleted immediately or if it should be soft deleted first.
82
+ * @returns ContentMetadata Success
83
+ * @throws ApiError
84
+ */
85
+ contentDelete(key, permanent) {
86
+ return this.httpRequest.request({
87
+ method: 'DELETE',
88
+ url: '/content/{key}',
89
+ path: {
90
+ 'key': key,
91
+ },
92
+ query: {
93
+ 'permanent': permanent,
94
+ },
95
+ errors: {
96
+ 400: `Bad Request`,
97
+ 403: `Forbidden`,
98
+ },
99
+ });
100
+ }
101
+ /**
102
+ * Get content path
103
+ * Get the content path with the provided key.
104
+ * @param key The key of the content path to retrieve.
105
+ * @param pageIndex
106
+ * @param pageSize
107
+ * @returns ContentMetadataPage Success
108
+ * @throws ApiError
109
+ */
110
+ contentGetPath(key, pageIndex, pageSize) {
111
+ return this.httpRequest.request({
112
+ method: 'GET',
113
+ url: '/content/{key}/path',
114
+ path: {
115
+ 'key': key,
116
+ },
117
+ query: {
118
+ 'pageIndex': pageIndex,
119
+ 'pageSize': pageSize,
120
+ },
121
+ errors: {
122
+ 403: `Forbidden`,
123
+ },
124
+ });
125
+ }
126
+ /**
127
+ * List content in container
128
+ * List the content items located in a specific container.
129
+ * @param key The key of the content to retrieve items for.
130
+ * @param contentTypes Indicates which content types or base types to include in the list.
131
+ * @param pageIndex
132
+ * @param pageSize
133
+ * @returns ContentMetadataPage Success
134
+ * @throws ApiError
135
+ */
136
+ contentListItems(key, contentTypes, pageIndex, pageSize) {
137
+ return this.httpRequest.request({
138
+ method: 'GET',
139
+ url: '/content/{key}/items',
140
+ path: {
141
+ 'key': key,
142
+ },
143
+ query: {
144
+ 'contentTypes': contentTypes,
145
+ 'pageIndex': pageIndex,
146
+ 'pageSize': pageSize,
147
+ },
148
+ errors: {
149
+ 403: `Forbidden`,
150
+ },
151
+ });
152
+ }
153
+ /**
154
+ * List assets
155
+ * List the assets that belongs to a content instance.
156
+ * @param key The key of the content to retrieve assets for.
157
+ * @param contentTypes Indicates which content types or base types to include in the list.
158
+ * @param pageIndex
159
+ * @param pageSize
160
+ * @returns ContentMetadataPage Success
161
+ * @throws ApiError
162
+ */
163
+ contentListAssets(key, contentTypes, pageIndex, pageSize) {
164
+ return this.httpRequest.request({
165
+ method: 'GET',
166
+ url: '/content/{key}/assets',
167
+ path: {
168
+ 'key': key,
169
+ },
170
+ query: {
171
+ 'contentTypes': contentTypes,
172
+ 'pageIndex': pageIndex,
173
+ 'pageSize': pageSize,
174
+ },
175
+ errors: {
176
+ 403: `Forbidden`,
177
+ },
178
+ });
179
+ }
180
+ /**
181
+ * Copy content
182
+ * Create a copy of the content item with the provided key.
183
+ * @param key The key of the content item to copy.
184
+ * @param requestBody Optional instructions for how to copy content.
185
+ * @returns ContentMetadata Success
186
+ * @throws ApiError
187
+ */
188
+ contentCopy(key, requestBody) {
189
+ return this.httpRequest.request({
190
+ method: 'POST',
191
+ url: '/content/{key}:copy',
192
+ path: {
193
+ 'key': key,
194
+ },
195
+ body: requestBody,
196
+ mediaType: 'application/json',
197
+ errors: {
198
+ 400: `Bad Request`,
199
+ 403: `Forbidden`,
200
+ },
201
+ });
202
+ }
203
+ /**
204
+ * Restore content
205
+ * Restore the deleted content item with the provided key. If a content item with the provided key is not deleted an error is returned.
206
+ * @param key The key of the content item to undelete.
207
+ * @returns ContentMetadata Success
208
+ * @throws ApiError
209
+ */
210
+ contentUndelete(key) {
211
+ return this.httpRequest.request({
212
+ method: 'POST',
213
+ url: '/content/{key}:undelete',
214
+ path: {
215
+ 'key': key,
216
+ },
217
+ errors: {
218
+ 400: `Bad Request`,
219
+ 403: `Forbidden`,
220
+ },
221
+ });
222
+ }
223
+ /**
224
+ * Query versions
225
+ * List content versions based on the provided query options.
226
+ * @param locales Indicates which content locales that should be listed. Use 'NEUTRAL' to include locale-neutral content.
227
+ * Locale must be a valid IETF BCP-47 language tag.
228
+ * @param statuses Indicates which status content versions must have to be listed.
229
+ * @param pageIndex
230
+ * @param pageSize
231
+ * @returns ContentItemPage Success
232
+ * @throws ApiError
233
+ */
234
+ contentListAllVersions(locales, statuses, pageIndex, pageSize) {
235
+ return this.httpRequest.request({
236
+ method: 'GET',
237
+ url: '/content/versions',
238
+ query: {
239
+ 'locales': locales,
240
+ 'statuses': statuses,
241
+ 'pageIndex': pageIndex,
242
+ 'pageSize': pageSize,
243
+ },
244
+ errors: {
245
+ 403: `Forbidden`,
246
+ },
247
+ });
248
+ }
249
+ /**
250
+ * List versions
251
+ * List versions of the content item with the provided key and the provided options.
252
+ * @param key
253
+ * @param locales Indicates which content locales that should be listed. Use 'NEUTRAL' to include locale-neutral content.
254
+ * Locale must be a valid IETF BCP-47 language tag.
255
+ * @param statuses Indicates which status content versions must have to be listed.
256
+ * @param pageIndex
257
+ * @param pageSize
258
+ * @returns ContentItemPage Success
259
+ * @throws ApiError
260
+ */
261
+ contentListVersions(key, locales, statuses, pageIndex, pageSize) {
262
+ return this.httpRequest.request({
263
+ method: 'GET',
264
+ url: '/content/{key}/versions',
265
+ path: {
266
+ 'key': key,
267
+ },
268
+ query: {
269
+ 'locales': locales,
270
+ 'statuses': statuses,
271
+ 'pageIndex': pageIndex,
272
+ 'pageSize': pageSize,
273
+ },
274
+ errors: {
275
+ 403: `Forbidden`,
276
+ },
277
+ });
278
+ }
279
+ /**
280
+ * Create version
281
+ * Create a new version of a content item.
282
+ * @param key The key of the content item for which a new content version should be created.
283
+ * @param requestBody The content version that should be created.
284
+ * @param skipValidation Indicates that the content validation should be ignored.
285
+ * @returns ContentItem Created
286
+ * @throws ApiError
287
+ */
288
+ contentCreateVersion(key, requestBody, skipValidation) {
289
+ return this.httpRequest.request({
290
+ method: 'POST',
291
+ url: '/content/{key}/versions',
292
+ path: {
293
+ 'key': key,
294
+ },
295
+ query: {
296
+ 'skipValidation': skipValidation,
297
+ },
298
+ body: requestBody,
299
+ mediaType: 'application/json',
300
+ errors: {
301
+ 400: `Bad Request`,
302
+ 403: `Forbidden`,
303
+ },
304
+ });
305
+ }
306
+ /**
307
+ * Delete locale
308
+ * Deletes the content item with the provided key. If a content item with the provided key does not exist an error is returned.
309
+ * @param key
310
+ * @param locale
311
+ * @returns ContentItem Success
312
+ * @throws ApiError
313
+ */
314
+ contentDeleteLocale(key, locale) {
315
+ return this.httpRequest.request({
316
+ method: 'DELETE',
317
+ url: '/content/{key}/versions',
318
+ path: {
319
+ 'key': key,
320
+ },
321
+ query: {
322
+ 'locale': locale,
323
+ },
324
+ errors: {
325
+ 400: `Bad Request`,
326
+ 403: `Forbidden`,
327
+ },
328
+ });
329
+ }
330
+ /**
331
+ * Get version
332
+ * Get the content item with the provided key and version.
333
+ * @param key
334
+ * @param version
335
+ * @param locale
336
+ * @returns ContentItem Success
337
+ * @throws ApiError
338
+ */
339
+ contentGetVersion(key, version, locale) {
340
+ return this.httpRequest.request({
341
+ method: 'GET',
342
+ url: '/content/{key}/versions/{version}',
343
+ path: {
344
+ 'key': key,
345
+ 'version': version,
346
+ },
347
+ query: {
348
+ 'locale': locale,
349
+ },
350
+ errors: {
351
+ 403: `Forbidden`,
352
+ },
353
+ });
354
+ }
355
+ /**
356
+ * Update version
357
+ * Update an existing content item. If a content item with the provided key does not exist an error is returned.
358
+ * @param key The key of the content item that should be updated.
359
+ * @param version The version of the content that should be updated.
360
+ * @param requestBody The content information that should be updated.
361
+ * @param locale The locale of the content that should be updated.
362
+ * @param skipValidation Indicates that the content validation should be ignored.
363
+ * @returns ContentItem Success
364
+ * @throws ApiError
365
+ */
366
+ contentPatchVersion(key, version, requestBody, locale, skipValidation) {
367
+ return this.httpRequest.request({
368
+ method: 'PATCH',
369
+ url: '/content/{key}/versions/{version}',
370
+ path: {
371
+ 'key': key,
372
+ 'version': version,
373
+ },
374
+ query: {
375
+ 'locale': locale,
376
+ 'skipValidation': skipValidation,
377
+ },
378
+ body: requestBody,
379
+ mediaType: 'application/merge-patch+json',
380
+ errors: {
381
+ 400: `Bad Request`,
382
+ 403: `Forbidden`,
383
+ },
384
+ });
385
+ }
386
+ /**
387
+ * Delete version
388
+ * Deletes the content item with the provided key. If a content item with the provided key does not exist an error is returned.
389
+ * @param key
390
+ * @param version
391
+ * @returns ContentItem Success
392
+ * @throws ApiError
393
+ */
394
+ contentDeleteVersion(key, version) {
395
+ return this.httpRequest.request({
396
+ method: 'DELETE',
397
+ url: '/content/{key}/versions/{version}',
398
+ path: {
399
+ 'key': key,
400
+ 'version': version,
401
+ },
402
+ errors: {
403
+ 400: `Bad Request`,
404
+ 403: `Forbidden`,
405
+ },
406
+ });
407
+ }
408
+ }
409
+ exports.ContentService = ContentService;