@agravity/public 5.3.0 → 5.3.2

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