@agravity/public 5.2.0

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 (78) hide show
  1. package/.openapi-generator/FILES +76 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +203 -0
  5. package/api/api.ts +43 -0
  6. package/api/publicAssetManagement.pub.agravity.ts +504 -0
  7. package/api/publicAssetOperations.pub.agravity.ts +633 -0
  8. package/api/publicAssetPublishing.pub.agravity.ts +263 -0
  9. package/api/publicAssetVersioning.pub.agravity.ts +552 -0
  10. package/api/publicAuthenticationManagement.pub.agravity.ts +135 -0
  11. package/api/publicCollectionManagement.pub.agravity.ts +562 -0
  12. package/api/publicCollectionSecureUpload.pub.agravity.ts +229 -0
  13. package/api/publicCollectionTypeManagement.pub.agravity.ts +266 -0
  14. package/api/publicConfigurationManagement.pub.agravity.ts +128 -0
  15. package/api/publicDownloadFormatManagement.pub.agravity.ts +135 -0
  16. package/api/publicGeneralManagement.pub.agravity.ts +221 -0
  17. package/api/publicHelperTools.pub.agravity.ts +288 -0
  18. package/api/publicPublishing.pub.agravity.ts +148 -0
  19. package/api/publicSavedSearch.pub.agravity.ts +148 -0
  20. package/api/publicSearchManagement.pub.agravity.ts +197 -0
  21. package/api/publicSharingManagement.pub.agravity.ts +215 -0
  22. package/api/publicSignalRConnectionManagement.pub.agravity.ts +136 -0
  23. package/api/publicStaticDefinedListManagement.pub.agravity.ts +203 -0
  24. package/api/publicTranslationManagement.pub.agravity.ts +267 -0
  25. package/api/publicWebAppData.pub.agravity.ts +193 -0
  26. package/api/publicWorkspaceManagement.pub.agravity.ts +204 -0
  27. package/api.module.ts +51 -0
  28. package/configuration.ts +132 -0
  29. package/encoder.ts +20 -0
  30. package/git_push.sh +58 -0
  31. package/index.ts +5 -0
  32. package/model/agravityErrorResponse.pub.agravity.ts +19 -0
  33. package/model/agravityVersion.pub.agravity.ts +24 -0
  34. package/model/allWebAppData.pub.agravity.ts +24 -0
  35. package/model/artificialIntelligenceGroup.pub.agravity.ts +20 -0
  36. package/model/asset.pub.agravity.ts +47 -0
  37. package/model/assetAvailability.pub.agravity.ts +19 -0
  38. package/model/assetBlob.pub.agravity.ts +82 -0
  39. package/model/assetIdContainer.pub.agravity.ts +18 -0
  40. package/model/assetPageResult.pub.agravity.ts +23 -0
  41. package/model/azSearchOptions.pub.agravity.ts +25 -0
  42. package/model/badRequestResult.pub.agravity.ts +17 -0
  43. package/model/collTypeItem.pub.agravity.ts +38 -0
  44. package/model/collection.pub.agravity.ts +35 -0
  45. package/model/collectionType.pub.agravity.ts +35 -0
  46. package/model/collectionUDL.pub.agravity.ts +21 -0
  47. package/model/createSftpUserResult.pub.agravity.ts +18 -0
  48. package/model/dataResult.pub.agravity.ts +22 -0
  49. package/model/distZipResponse.pub.agravity.ts +19 -0
  50. package/model/downloadFormat.pub.agravity.ts +34 -0
  51. package/model/dynamicImageOperation.pub.agravity.ts +18 -0
  52. package/model/entityId.pub.agravity.ts +17 -0
  53. package/model/entityIdName.pub.agravity.ts +19 -0
  54. package/model/frontendAppConfig.pub.agravity.ts +21 -0
  55. package/model/groupAllAppData.pub.agravity.ts +26 -0
  56. package/model/metadata.pub.agravity.ts +19 -0
  57. package/model/models.ts +44 -0
  58. package/model/okResult.pub.agravity.ts +17 -0
  59. package/model/publishEntity.pub.agravity.ts +28 -0
  60. package/model/publishedAsset.pub.agravity.ts +25 -0
  61. package/model/quickShareFull.pub.agravity.ts +36 -0
  62. package/model/sasToken.pub.agravity.ts +22 -0
  63. package/model/savedSearch.pub.agravity.ts +31 -0
  64. package/model/searchFacet.pub.agravity.ts +19 -0
  65. package/model/searchFacetEntity.pub.agravity.ts +19 -0
  66. package/model/searchResult.pub.agravity.ts +23 -0
  67. package/model/searchableItem.pub.agravity.ts +26 -0
  68. package/model/secureUploadEntity.pub.agravity.ts +27 -0
  69. package/model/sharedAsset.pub.agravity.ts +25 -0
  70. package/model/sharedCollectionFull.pub.agravity.ts +29 -0
  71. package/model/signalRConnectionInfo.pub.agravity.ts +18 -0
  72. package/model/staticDefinedList.pub.agravity.ts +30 -0
  73. package/model/versionEntity.pub.agravity.ts +28 -0
  74. package/model/versionedAsset.pub.agravity.ts +20 -0
  75. package/model/whereParam.pub.agravity.ts +43 -0
  76. package/model/workspace.pub.agravity.ts +34 -0
  77. package/package.json +28 -0
  78. package/variables.ts +9 -0
@@ -0,0 +1,552 @@
1
+ /**
2
+ * Agravity OpenAPI Documentation - Public Functions
3
+ * <h1>Agravity API Reference</h1>This is the public API description of Agravity GmbH.<br/><h2>Resources</h2><ul> <li>Collection type management</li> <li>Collections management</li> <li>Assets management</li> <li>Assets operations</li> <li>Assets publishing</li> <li>Collection Sharing (consume share)</li> <li>Secure Upload (validate + upload file)</li> <li>Download ZIP</li> <li>Search</li> <li>General management</li></ul><h2> Operations</h2>Agravity API performs the following operations:<ul> <li>List / get single collection types</li> <li>List / get single collections</li> <li>List / get single assets</li> <li>Operations on assets like: blobs, rotate, resize, similar, collections, customfields, download</li> <li>List / get single published asset</li> <li>Search for assets or collections</li> <li>Get version of deployment</li></ul><br/><b>API key is needed to access these endpoints.</b><br/><br/>Copyright © Agravity GmbH 2023. All Rights Reserved
4
+ *
5
+ * The version of the OpenAPI document: 5.2.0
6
+ * Contact: office@agravity.io
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /* tslint:disable:no-unused-variable member-ordering */
13
+
14
+ import { Inject, Injectable, Optional } from '@angular/core';
15
+ import { HttpClient, HttpHeaders, HttpParams,
16
+ HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http';
17
+ import { CustomHttpParameterCodec } from '../encoder';
18
+ import { Observable } from 'rxjs';
19
+
20
+ import { AgravityErrorResponse } from '../model/models';
21
+ import { AssetBlob } from '../model/models';
22
+ import { VersionEntity } from '../model/models';
23
+ import { VersionedAsset } from '../model/models';
24
+
25
+ import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
26
+ import { AgravityPublicConfiguration } from '../configuration';
27
+
28
+
29
+
30
+ @Injectable({
31
+ providedIn: 'root'
32
+ })
33
+ export class PublicAssetVersioningService {
34
+
35
+ protected basePath = 'http://localhost:7072/api';
36
+ public defaultHeaders = new HttpHeaders();
37
+ public configuration = new AgravityPublicConfiguration();
38
+ public encoder: HttpParameterCodec;
39
+
40
+ constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: AgravityPublicConfiguration) {
41
+ if (configuration) {
42
+ this.configuration = configuration;
43
+ }
44
+ if (typeof this.configuration.basePath !== 'string') {
45
+ if (typeof basePath !== 'string') {
46
+ basePath = this.basePath;
47
+ }
48
+ this.configuration.basePath = basePath;
49
+ }
50
+ this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
51
+ }
52
+
53
+ /**
54
+ * @param consumes string[] mime-types
55
+ * @return true: consumes contains 'multipart/form-data', false: otherwise
56
+ */
57
+ private canConsumeForm(consumes: string[]): boolean {
58
+ const form = 'multipart/form-data';
59
+ for (const consume of consumes) {
60
+ if (form === consume) {
61
+ return true;
62
+ }
63
+ }
64
+ return false;
65
+ }
66
+
67
+ private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
68
+ if (typeof value === "object" && value instanceof Date === false) {
69
+ httpParams = this.addToHttpParamsRecursive(httpParams, value);
70
+ } else {
71
+ httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
72
+ }
73
+ return httpParams;
74
+ }
75
+
76
+ private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
77
+ if (value == null) {
78
+ return httpParams;
79
+ }
80
+
81
+ if (typeof value === "object") {
82
+ if (Array.isArray(value)) {
83
+ (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
84
+ } else if (value instanceof Date) {
85
+ if (key != null) {
86
+ httpParams = httpParams.append(key,
87
+ (value as Date).toISOString().substr(0, 10));
88
+ } else {
89
+ throw Error("key may not be null if value is Date");
90
+ }
91
+ } else {
92
+ Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive(
93
+ httpParams, value[k], key != null ? `${key}.${k}` : k));
94
+ }
95
+ } else if (key != null) {
96
+ httpParams = httpParams.append(key, value);
97
+ } else {
98
+ throw Error("key may not be null if value is not object or array");
99
+ }
100
+ return httpParams;
101
+ }
102
+
103
+ /**
104
+ * This endpoint allows to upload one asset which replaces the asset with given id and creates a version which is returned.
105
+ * @param id The ID of the asset.
106
+ * @param name
107
+ * @param collectionId
108
+ * @param file
109
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
110
+ * @param reportProgress flag to report request and response progress.
111
+ */
112
+ public httpAssetCreateUploadVersion(id: string, name?: string, collectionId?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<VersionedAsset>;
113
+ public httpAssetCreateUploadVersion(id: string, name?: string, collectionId?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<HttpResponse<VersionedAsset>>;
114
+ public httpAssetCreateUploadVersion(id: string, name?: string, collectionId?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<HttpEvent<VersionedAsset>>;
115
+ public httpAssetCreateUploadVersion(id: string, name?: string, collectionId?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable<any> {
116
+ if (id === null || id === undefined) {
117
+ throw new Error('Required parameter id was null or undefined when calling httpAssetCreateUploadVersion.');
118
+ }
119
+
120
+ let headers = this.defaultHeaders;
121
+
122
+ let credential: string | undefined;
123
+ // authentication (function_key) required
124
+ credential = this.configuration.lookupCredential('function_key');
125
+ if (credential) {
126
+ headers = headers.set('x-functions-key', credential);
127
+ }
128
+
129
+ let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
130
+ if (httpHeaderAcceptSelected === undefined) {
131
+ // to determine the Accept header
132
+ const httpHeaderAccepts: string[] = [
133
+ 'application/json'
134
+ ];
135
+ httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
136
+ }
137
+ if (httpHeaderAcceptSelected !== undefined) {
138
+ headers = headers.set('Accept', httpHeaderAcceptSelected);
139
+ }
140
+
141
+ // to determine the Content-Type header
142
+ const consumes: string[] = [
143
+ 'multipart/form-data'
144
+ ];
145
+
146
+ const canConsumeForm = this.canConsumeForm(consumes);
147
+
148
+ let formParams: { append(param: string, value: any): any; };
149
+ let useForm = false;
150
+ let convertFormParamsToString = false;
151
+ // use FormData to transmit files using content-type "multipart/form-data"
152
+ // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data
153
+ useForm = canConsumeForm;
154
+ if (useForm) {
155
+ formParams = new FormData();
156
+ } else {
157
+ formParams = new HttpParams({encoder: this.encoder});
158
+ }
159
+
160
+ if (name !== undefined) {
161
+ formParams = formParams.append('name', <any>name) as any || formParams;
162
+ }
163
+ if (collectionId !== undefined) {
164
+ formParams = formParams.append('collectionId', <any>collectionId) as any || formParams;
165
+ }
166
+ if (file !== undefined) {
167
+ formParams = formParams.append('file', <any>file) as any || formParams;
168
+ }
169
+
170
+ let responseType_: 'text' | 'json' = 'json';
171
+ if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) {
172
+ responseType_ = 'text';
173
+ }
174
+
175
+ return this.httpClient.post<VersionedAsset>(`${this.configuration.basePath}/assets/${encodeURIComponent(String(id))}/versionsupload`,
176
+ convertFormParamsToString ? formParams.toString() : formParams,
177
+ {
178
+ responseType: <any>responseType_,
179
+ withCredentials: this.configuration.withCredentials,
180
+ headers: headers,
181
+ observe: observe,
182
+ reportProgress: reportProgress
183
+ }
184
+ );
185
+ }
186
+
187
+ /**
188
+ * This endpoint allows to create empty version or upload one asset which replaces the asset with given id and creates version.
189
+ * @param id The ID of the asset.
190
+ * @param versionedAsset This VersionedAsset to create empty version (need to upload file with metadata to blob storage)
191
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
192
+ * @param reportProgress flag to report request and response progress.
193
+ */
194
+ public httpAssetCreateVersion(id: string, versionedAsset: VersionedAsset, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<VersionedAsset>;
195
+ public httpAssetCreateVersion(id: string, versionedAsset: VersionedAsset, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<HttpResponse<VersionedAsset>>;
196
+ public httpAssetCreateVersion(id: string, versionedAsset: VersionedAsset, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<HttpEvent<VersionedAsset>>;
197
+ public httpAssetCreateVersion(id: string, versionedAsset: VersionedAsset, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable<any> {
198
+ if (id === null || id === undefined) {
199
+ throw new Error('Required parameter id was null or undefined when calling httpAssetCreateVersion.');
200
+ }
201
+ if (versionedAsset === null || versionedAsset === undefined) {
202
+ throw new Error('Required parameter versionedAsset was null or undefined when calling httpAssetCreateVersion.');
203
+ }
204
+
205
+ let headers = this.defaultHeaders;
206
+
207
+ let credential: string | undefined;
208
+ // authentication (function_key) required
209
+ credential = this.configuration.lookupCredential('function_key');
210
+ if (credential) {
211
+ headers = headers.set('x-functions-key', credential);
212
+ }
213
+
214
+ let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
215
+ if (httpHeaderAcceptSelected === undefined) {
216
+ // to determine the Accept header
217
+ const httpHeaderAccepts: string[] = [
218
+ 'application/json'
219
+ ];
220
+ httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
221
+ }
222
+ if (httpHeaderAcceptSelected !== undefined) {
223
+ headers = headers.set('Accept', httpHeaderAcceptSelected);
224
+ }
225
+
226
+
227
+ // to determine the Content-Type header
228
+ const consumes: string[] = [
229
+ 'application/json'
230
+ ];
231
+ const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
232
+ if (httpContentTypeSelected !== undefined) {
233
+ headers = headers.set('Content-Type', httpContentTypeSelected);
234
+ }
235
+
236
+ let responseType_: 'text' | 'json' = 'json';
237
+ if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) {
238
+ responseType_ = 'text';
239
+ }
240
+
241
+ return this.httpClient.post<VersionedAsset>(`${this.configuration.basePath}/assets/${encodeURIComponent(String(id))}/versions`,
242
+ versionedAsset,
243
+ {
244
+ responseType: <any>responseType_,
245
+ withCredentials: this.configuration.withCredentials,
246
+ headers: headers,
247
+ observe: observe,
248
+ reportProgress: reportProgress
249
+ }
250
+ );
251
+ }
252
+
253
+ /**
254
+ * This endpoint deletes a version of an asset.
255
+ * @param id The ID of the asset.
256
+ * @param vNr The version number of the asset.
257
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
258
+ * @param reportProgress flag to report request and response progress.
259
+ */
260
+ public httpDeleteVersionedAssetsById(id: string, vNr: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<any>;
261
+ public httpDeleteVersionedAssetsById(id: string, vNr: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<HttpResponse<any>>;
262
+ public httpDeleteVersionedAssetsById(id: string, vNr: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<HttpEvent<any>>;
263
+ public httpDeleteVersionedAssetsById(id: string, vNr: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable<any> {
264
+ if (id === null || id === undefined) {
265
+ throw new Error('Required parameter id was null or undefined when calling httpDeleteVersionedAssetsById.');
266
+ }
267
+ if (vNr === null || vNr === undefined) {
268
+ throw new Error('Required parameter vNr was null or undefined when calling httpDeleteVersionedAssetsById.');
269
+ }
270
+
271
+ let headers = this.defaultHeaders;
272
+
273
+ let credential: string | undefined;
274
+ // authentication (function_key) required
275
+ credential = this.configuration.lookupCredential('function_key');
276
+ if (credential) {
277
+ headers = headers.set('x-functions-key', credential);
278
+ }
279
+
280
+ let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
281
+ if (httpHeaderAcceptSelected === undefined) {
282
+ // to determine the Accept header
283
+ const httpHeaderAccepts: string[] = [
284
+ 'application/json'
285
+ ];
286
+ httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
287
+ }
288
+ if (httpHeaderAcceptSelected !== undefined) {
289
+ headers = headers.set('Accept', httpHeaderAcceptSelected);
290
+ }
291
+
292
+
293
+ let responseType_: 'text' | 'json' = 'json';
294
+ if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) {
295
+ responseType_ = 'text';
296
+ }
297
+
298
+ return this.httpClient.delete<any>(`${this.configuration.basePath}/assets/${encodeURIComponent(String(id))}/versions/${encodeURIComponent(String(vNr))}`,
299
+ {
300
+ responseType: <any>responseType_,
301
+ withCredentials: this.configuration.withCredentials,
302
+ headers: headers,
303
+ observe: observe,
304
+ reportProgress: reportProgress
305
+ }
306
+ );
307
+ }
308
+
309
+ /**
310
+ * This endpoint checks if assets and version exists and returns the url for the requested blob.
311
+ * @param id The ID of the asset.
312
+ * @param vNr The version number of the asset.
313
+ * @param c \&quot;t\&quot; for thumbnail (default); \&quot;o\&quot; for optimized
314
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
315
+ * @param reportProgress flag to report request and response progress.
316
+ */
317
+ public httpGetVersionedAssetBlobById(id: string, vNr: number, c?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<AssetBlob>;
318
+ public httpGetVersionedAssetBlobById(id: string, vNr: number, c?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<HttpResponse<AssetBlob>>;
319
+ public httpGetVersionedAssetBlobById(id: string, vNr: number, c?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<HttpEvent<AssetBlob>>;
320
+ public httpGetVersionedAssetBlobById(id: string, vNr: number, c?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable<any> {
321
+ if (id === null || id === undefined) {
322
+ throw new Error('Required parameter id was null or undefined when calling httpGetVersionedAssetBlobById.');
323
+ }
324
+ if (vNr === null || vNr === undefined) {
325
+ throw new Error('Required parameter vNr was null or undefined when calling httpGetVersionedAssetBlobById.');
326
+ }
327
+
328
+ let queryParameters = new HttpParams({encoder: this.encoder});
329
+ if (c !== undefined && c !== null) {
330
+ queryParameters = this.addToHttpParams(queryParameters,
331
+ <any>c, 'c');
332
+ }
333
+
334
+ let headers = this.defaultHeaders;
335
+
336
+ let credential: string | undefined;
337
+ // authentication (function_key) required
338
+ credential = this.configuration.lookupCredential('function_key');
339
+ if (credential) {
340
+ headers = headers.set('x-functions-key', credential);
341
+ }
342
+
343
+ let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
344
+ if (httpHeaderAcceptSelected === undefined) {
345
+ // to determine the Accept header
346
+ const httpHeaderAccepts: string[] = [
347
+ 'application/json'
348
+ ];
349
+ httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
350
+ }
351
+ if (httpHeaderAcceptSelected !== undefined) {
352
+ headers = headers.set('Accept', httpHeaderAcceptSelected);
353
+ }
354
+
355
+
356
+ let responseType_: 'text' | 'json' = 'json';
357
+ if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) {
358
+ responseType_ = 'text';
359
+ }
360
+
361
+ return this.httpClient.get<AssetBlob>(`${this.configuration.basePath}/assets/${encodeURIComponent(String(id))}/versions/${encodeURIComponent(String(vNr))}/blobs`,
362
+ {
363
+ params: queryParameters,
364
+ responseType: <any>responseType_,
365
+ withCredentials: this.configuration.withCredentials,
366
+ headers: headers,
367
+ observe: observe,
368
+ reportProgress: reportProgress
369
+ }
370
+ );
371
+ }
372
+
373
+ /**
374
+ * This endpoint restores a version nr to be the current version and saves the current asset as version.
375
+ * @param id The ID of the asset.
376
+ * @param vNr The version number of the asset.
377
+ * @param versionedAsset Only the version_info is used and will be added to the current version which is archived (before the old version is restored).
378
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
379
+ * @param reportProgress flag to report request and response progress.
380
+ */
381
+ public httpRestoreVersionedAssetsById(id: string, vNr: string, versionedAsset: VersionedAsset, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<VersionedAsset>;
382
+ public httpRestoreVersionedAssetsById(id: string, vNr: string, versionedAsset: VersionedAsset, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<HttpResponse<VersionedAsset>>;
383
+ public httpRestoreVersionedAssetsById(id: string, vNr: string, versionedAsset: VersionedAsset, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<HttpEvent<VersionedAsset>>;
384
+ public httpRestoreVersionedAssetsById(id: string, vNr: string, versionedAsset: VersionedAsset, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable<any> {
385
+ if (id === null || id === undefined) {
386
+ throw new Error('Required parameter id was null or undefined when calling httpRestoreVersionedAssetsById.');
387
+ }
388
+ if (vNr === null || vNr === undefined) {
389
+ throw new Error('Required parameter vNr was null or undefined when calling httpRestoreVersionedAssetsById.');
390
+ }
391
+ if (versionedAsset === null || versionedAsset === undefined) {
392
+ throw new Error('Required parameter versionedAsset was null or undefined when calling httpRestoreVersionedAssetsById.');
393
+ }
394
+
395
+ let headers = this.defaultHeaders;
396
+
397
+ let credential: string | undefined;
398
+ // authentication (function_key) required
399
+ credential = this.configuration.lookupCredential('function_key');
400
+ if (credential) {
401
+ headers = headers.set('x-functions-key', credential);
402
+ }
403
+
404
+ let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
405
+ if (httpHeaderAcceptSelected === undefined) {
406
+ // to determine the Accept header
407
+ const httpHeaderAccepts: string[] = [
408
+ 'application/json'
409
+ ];
410
+ httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
411
+ }
412
+ if (httpHeaderAcceptSelected !== undefined) {
413
+ headers = headers.set('Accept', httpHeaderAcceptSelected);
414
+ }
415
+
416
+
417
+ // to determine the Content-Type header
418
+ const consumes: string[] = [
419
+ 'application/json'
420
+ ];
421
+ const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
422
+ if (httpContentTypeSelected !== undefined) {
423
+ headers = headers.set('Content-Type', httpContentTypeSelected);
424
+ }
425
+
426
+ let responseType_: 'text' | 'json' = 'json';
427
+ if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) {
428
+ responseType_ = 'text';
429
+ }
430
+
431
+ return this.httpClient.post<VersionedAsset>(`${this.configuration.basePath}/assets/${encodeURIComponent(String(id))}/versions/${encodeURIComponent(String(vNr))}/restore`,
432
+ versionedAsset,
433
+ {
434
+ responseType: <any>responseType_,
435
+ withCredentials: this.configuration.withCredentials,
436
+ headers: headers,
437
+ observe: observe,
438
+ reportProgress: reportProgress
439
+ }
440
+ );
441
+ }
442
+
443
+ /**
444
+ * This endpoint updates a version of an asset.
445
+ * @param id The ID of the asset.
446
+ * @param vNr The version number of the asset.
447
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
448
+ * @param reportProgress flag to report request and response progress.
449
+ */
450
+ public httpUpdateVersionedAssetsById(id: string, vNr: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<any>;
451
+ public httpUpdateVersionedAssetsById(id: string, vNr: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<HttpResponse<any>>;
452
+ public httpUpdateVersionedAssetsById(id: string, vNr: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<HttpEvent<any>>;
453
+ public httpUpdateVersionedAssetsById(id: string, vNr: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable<any> {
454
+ if (id === null || id === undefined) {
455
+ throw new Error('Required parameter id was null or undefined when calling httpUpdateVersionedAssetsById.');
456
+ }
457
+ if (vNr === null || vNr === undefined) {
458
+ throw new Error('Required parameter vNr was null or undefined when calling httpUpdateVersionedAssetsById.');
459
+ }
460
+
461
+ let headers = this.defaultHeaders;
462
+
463
+ let credential: string | undefined;
464
+ // authentication (function_key) required
465
+ credential = this.configuration.lookupCredential('function_key');
466
+ if (credential) {
467
+ headers = headers.set('x-functions-key', credential);
468
+ }
469
+
470
+ let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
471
+ if (httpHeaderAcceptSelected === undefined) {
472
+ // to determine the Accept header
473
+ const httpHeaderAccepts: string[] = [
474
+ 'application/json'
475
+ ];
476
+ httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
477
+ }
478
+ if (httpHeaderAcceptSelected !== undefined) {
479
+ headers = headers.set('Accept', httpHeaderAcceptSelected);
480
+ }
481
+
482
+
483
+ let responseType_: 'text' | 'json' = 'json';
484
+ if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) {
485
+ responseType_ = 'text';
486
+ }
487
+
488
+ return this.httpClient.post<any>(`${this.configuration.basePath}/assets/${encodeURIComponent(String(id))}/versions/${encodeURIComponent(String(vNr))}`,
489
+ null,
490
+ {
491
+ responseType: <any>responseType_,
492
+ withCredentials: this.configuration.withCredentials,
493
+ headers: headers,
494
+ observe: observe,
495
+ reportProgress: reportProgress
496
+ }
497
+ );
498
+ }
499
+
500
+ /**
501
+ * This endpoint lists all the versioned assets which are stored in the database if asset is still valid.
502
+ * @param id The ID of the asset.
503
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
504
+ * @param reportProgress flag to report request and response progress.
505
+ */
506
+ public httpVersionedAssetsGet(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<VersionEntity>;
507
+ public httpVersionedAssetsGet(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<HttpResponse<VersionEntity>>;
508
+ public httpVersionedAssetsGet(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<HttpEvent<VersionEntity>>;
509
+ public httpVersionedAssetsGet(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable<any> {
510
+ if (id === null || id === undefined) {
511
+ throw new Error('Required parameter id was null or undefined when calling httpVersionedAssetsGet.');
512
+ }
513
+
514
+ let headers = this.defaultHeaders;
515
+
516
+ let credential: string | undefined;
517
+ // authentication (function_key) required
518
+ credential = this.configuration.lookupCredential('function_key');
519
+ if (credential) {
520
+ headers = headers.set('x-functions-key', credential);
521
+ }
522
+
523
+ let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
524
+ if (httpHeaderAcceptSelected === undefined) {
525
+ // to determine the Accept header
526
+ const httpHeaderAccepts: string[] = [
527
+ 'application/json'
528
+ ];
529
+ httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
530
+ }
531
+ if (httpHeaderAcceptSelected !== undefined) {
532
+ headers = headers.set('Accept', httpHeaderAcceptSelected);
533
+ }
534
+
535
+
536
+ let responseType_: 'text' | 'json' = 'json';
537
+ if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) {
538
+ responseType_ = 'text';
539
+ }
540
+
541
+ return this.httpClient.get<VersionEntity>(`${this.configuration.basePath}/assets/${encodeURIComponent(String(id))}/versions`,
542
+ {
543
+ responseType: <any>responseType_,
544
+ withCredentials: this.configuration.withCredentials,
545
+ headers: headers,
546
+ observe: observe,
547
+ reportProgress: reportProgress
548
+ }
549
+ );
550
+ }
551
+
552
+ }