@agravity/private 9.0.2 → 9.1.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.
@@ -0,0 +1,633 @@
1
+ /**
2
+ * Agravity OpenAPI Documentation - Private Functions
3
+ *
4
+ * Contact: office@agravity.io
5
+ *
6
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
7
+ * https://openapi-generator.tech
8
+ * Do not edit the class manually.
9
+ */
10
+ /* tslint:disable:no-unused-variable member-ordering */
11
+
12
+ import { Inject, Injectable, Optional } from '@angular/core';
13
+ import { HttpClient, HttpHeaders, HttpParams, HttpResponse, HttpEvent, HttpParameterCodec, HttpContext } from '@angular/common/http';
14
+ import { CustomHttpParameterCodec } from '../encoder';
15
+ import { Observable } from 'rxjs';
16
+
17
+ // @ts-ignore
18
+ import { AgravityErrorResponse } from '../model/agravityErrorResponse.agravity';
19
+ // @ts-ignore
20
+ import { AssetRelation } from '../model/assetRelation.agravity';
21
+
22
+ // @ts-ignore
23
+ import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
24
+ import { AgravityConfiguration } from '../configuration';
25
+
26
+ export interface HttpAssetRelationCreateRequestParams {
27
+ /** This endpoint creates an asset relation in the database. */
28
+ assetRelation: AssetRelation;
29
+ /** When default language should be returned and the translation dictionary is delivered. (Ignores the \"Accept-Language\" header) */
30
+ translations?: boolean;
31
+ /** The requested language of the response. If not matching it falls back to default language. */
32
+ acceptLanguage?: string;
33
+ /** The ID of the asset relation type, where these asset relations should come from. */
34
+ assetrelationtypeid?: string;
35
+ }
36
+
37
+ export interface HttpAssetRelationDeleteByIdRequestParams {
38
+ /** The ID of the asset relation. */
39
+ id: string;
40
+ }
41
+
42
+ export interface HttpAssetRelationGetAllRequestParams {
43
+ /** The ID of the asset relation type, where these asset relations should come from. */
44
+ assetrelationtypeid?: string;
45
+ /** The requested language of the response. If not matching it falls back to default language. */
46
+ acceptLanguage?: string;
47
+ /** When default language should be returned and the translation dictionary is delivered. (Ignores the \"Accept-Language\" header) */
48
+ translations?: boolean;
49
+ }
50
+
51
+ export interface HttpAssetRelationGetByIdRequestParams {
52
+ /** The ID of the asset relation. */
53
+ id: string;
54
+ /** When default language should be returned and the translation dictionary is delivered. (Ignores the \"Accept-Language\" header) */
55
+ translations?: boolean;
56
+ }
57
+
58
+ export interface HttpAssetRelationUpdateByIdRequestParams {
59
+ /** The ID of the asset relation. */
60
+ id: string;
61
+ /** This endpoint updates an asset relation with ID in the database. */
62
+ assetRelation: AssetRelation;
63
+ /** When default language should be returned and the translation dictionary is delivered. (Ignores the \"Accept-Language\" header) */
64
+ translations?: boolean;
65
+ /** The requested language of the response. If not matching it falls back to default language. */
66
+ acceptLanguage?: string;
67
+ }
68
+
69
+ @Injectable({
70
+ providedIn: 'root'
71
+ })
72
+ export class AssetRelationManagementService {
73
+ protected basePath = 'http://localhost:7071/api';
74
+ public defaultHeaders = new HttpHeaders();
75
+ public configuration = new AgravityConfiguration();
76
+ public encoder: HttpParameterCodec;
77
+
78
+ constructor(
79
+ protected httpClient: HttpClient,
80
+ @Optional() @Inject(BASE_PATH) basePath: string | string[],
81
+ @Optional() configuration: AgravityConfiguration
82
+ ) {
83
+ if (configuration) {
84
+ this.configuration = configuration;
85
+ }
86
+ if (typeof this.configuration.basePath !== 'string') {
87
+ const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined;
88
+ if (firstBasePath != undefined) {
89
+ basePath = firstBasePath;
90
+ }
91
+
92
+ if (typeof basePath !== 'string') {
93
+ basePath = this.basePath;
94
+ }
95
+ this.configuration.basePath = basePath;
96
+ }
97
+ this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
98
+ }
99
+
100
+ // @ts-ignore
101
+ private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
102
+ if (typeof value === 'object' && value instanceof Date === false) {
103
+ httpParams = this.addToHttpParamsRecursive(httpParams, value);
104
+ } else {
105
+ httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
106
+ }
107
+ return httpParams;
108
+ }
109
+
110
+ private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
111
+ if (value == null) {
112
+ return httpParams;
113
+ }
114
+
115
+ if (typeof value === 'object') {
116
+ if (Array.isArray(value)) {
117
+ (value as any[]).forEach((elem) => (httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)));
118
+ } else if (value instanceof Date) {
119
+ if (key != null) {
120
+ httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10));
121
+ } else {
122
+ throw Error('key may not be null if value is Date');
123
+ }
124
+ } else {
125
+ Object.keys(value).forEach((k) => (httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k)));
126
+ }
127
+ } else if (key != null) {
128
+ httpParams = httpParams.append(key, value);
129
+ } else {
130
+ throw Error('key may not be null if value is not object or array');
131
+ }
132
+ return httpParams;
133
+ }
134
+
135
+ /**
136
+ * This endpoint creates one asset relation entry in the database.
137
+ * @param requestParameters
138
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
139
+ * @param reportProgress flag to report request and response progress.
140
+ */
141
+ public httpAssetRelationCreate(
142
+ requestParameters?: HttpAssetRelationCreateRequestParams,
143
+ observe?: 'body',
144
+ reportProgress?: boolean,
145
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
146
+ ): Observable<AssetRelation>;
147
+ public httpAssetRelationCreate(
148
+ requestParameters?: HttpAssetRelationCreateRequestParams,
149
+ observe?: 'response',
150
+ reportProgress?: boolean,
151
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
152
+ ): Observable<HttpResponse<AssetRelation>>;
153
+ public httpAssetRelationCreate(
154
+ requestParameters?: HttpAssetRelationCreateRequestParams,
155
+ observe?: 'events',
156
+ reportProgress?: boolean,
157
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
158
+ ): Observable<HttpEvent<AssetRelation>>;
159
+ public httpAssetRelationCreate(
160
+ requestParameters?: HttpAssetRelationCreateRequestParams,
161
+ observe: any = 'body',
162
+ reportProgress: boolean = false,
163
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
164
+ ): Observable<any> {
165
+ const assetRelation = requestParameters?.assetRelation;
166
+ if (assetRelation === null || assetRelation === undefined) {
167
+ throw new Error('Required parameter assetRelation was null or undefined when calling httpAssetRelationCreate.');
168
+ }
169
+ const translations = requestParameters?.translations;
170
+ const acceptLanguage = requestParameters?.acceptLanguage;
171
+ const assetrelationtypeid = requestParameters?.assetrelationtypeid;
172
+
173
+ let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
174
+ if (translations !== undefined && translations !== null) {
175
+ localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>translations, 'translations');
176
+ }
177
+ if (assetrelationtypeid !== undefined && assetrelationtypeid !== null) {
178
+ localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>assetrelationtypeid, 'assetrelationtypeid');
179
+ }
180
+
181
+ let localVarHeaders = this.defaultHeaders;
182
+ if (acceptLanguage !== undefined && acceptLanguage !== null) {
183
+ localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage));
184
+ }
185
+
186
+ let localVarCredential: string | undefined;
187
+ // authentication (msal_auth) required
188
+ localVarCredential = this.configuration.lookupCredential('msal_auth');
189
+ if (localVarCredential) {
190
+ localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
191
+ }
192
+
193
+ let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
194
+ if (localVarHttpHeaderAcceptSelected === undefined) {
195
+ // to determine the Accept header
196
+ const httpHeaderAccepts: string[] = ['application/json'];
197
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
198
+ }
199
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
200
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
201
+ }
202
+
203
+ let localVarHttpContext: HttpContext | undefined = options && options.context;
204
+ if (localVarHttpContext === undefined) {
205
+ localVarHttpContext = new HttpContext();
206
+ }
207
+
208
+ let localVarTransferCache: boolean | undefined = options && options.transferCache;
209
+ if (localVarTransferCache === undefined) {
210
+ localVarTransferCache = true;
211
+ }
212
+
213
+ // to determine the Content-Type header
214
+ const consumes: string[] = ['application/json'];
215
+ const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
216
+ if (httpContentTypeSelected !== undefined) {
217
+ localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
218
+ }
219
+
220
+ let responseType_: 'text' | 'json' | 'blob' = 'json';
221
+ if (localVarHttpHeaderAcceptSelected) {
222
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
223
+ responseType_ = 'text';
224
+ } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
225
+ responseType_ = 'json';
226
+ } else {
227
+ responseType_ = 'blob';
228
+ }
229
+ }
230
+
231
+ let localVarPath = `/assetrelations`;
232
+ return this.httpClient.request<AssetRelation>('post', `${this.configuration.basePath}${localVarPath}`, {
233
+ context: localVarHttpContext,
234
+ body: assetRelation,
235
+ params: localVarQueryParameters,
236
+ responseType: <any>responseType_,
237
+ withCredentials: this.configuration.withCredentials,
238
+ headers: localVarHeaders,
239
+ observe: observe,
240
+ transferCache: localVarTransferCache,
241
+ reportProgress: reportProgress
242
+ });
243
+ }
244
+
245
+ /**
246
+ * This endpoint deletes a single asset relation.
247
+ * @param requestParameters
248
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
249
+ * @param reportProgress flag to report request and response progress.
250
+ */
251
+ public httpAssetRelationDeleteById(
252
+ requestParameters?: HttpAssetRelationDeleteByIdRequestParams,
253
+ observe?: 'body',
254
+ reportProgress?: boolean,
255
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
256
+ ): Observable<any>;
257
+ public httpAssetRelationDeleteById(
258
+ requestParameters?: HttpAssetRelationDeleteByIdRequestParams,
259
+ observe?: 'response',
260
+ reportProgress?: boolean,
261
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
262
+ ): Observable<HttpResponse<any>>;
263
+ public httpAssetRelationDeleteById(
264
+ requestParameters?: HttpAssetRelationDeleteByIdRequestParams,
265
+ observe?: 'events',
266
+ reportProgress?: boolean,
267
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
268
+ ): Observable<HttpEvent<any>>;
269
+ public httpAssetRelationDeleteById(
270
+ requestParameters?: HttpAssetRelationDeleteByIdRequestParams,
271
+ observe: any = 'body',
272
+ reportProgress: boolean = false,
273
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
274
+ ): Observable<any> {
275
+ const id = requestParameters?.id;
276
+ if (id === null || id === undefined) {
277
+ throw new Error('Required parameter id was null or undefined when calling httpAssetRelationDeleteById.');
278
+ }
279
+
280
+ let localVarHeaders = this.defaultHeaders;
281
+
282
+ let localVarCredential: string | undefined;
283
+ // authentication (msal_auth) required
284
+ localVarCredential = this.configuration.lookupCredential('msal_auth');
285
+ if (localVarCredential) {
286
+ localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
287
+ }
288
+
289
+ let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
290
+ if (localVarHttpHeaderAcceptSelected === undefined) {
291
+ // to determine the Accept header
292
+ const httpHeaderAccepts: string[] = ['application/json'];
293
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
294
+ }
295
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
296
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
297
+ }
298
+
299
+ let localVarHttpContext: HttpContext | undefined = options && options.context;
300
+ if (localVarHttpContext === undefined) {
301
+ localVarHttpContext = new HttpContext();
302
+ }
303
+
304
+ let localVarTransferCache: boolean | undefined = options && options.transferCache;
305
+ if (localVarTransferCache === undefined) {
306
+ localVarTransferCache = true;
307
+ }
308
+
309
+ let responseType_: 'text' | 'json' | 'blob' = 'json';
310
+ if (localVarHttpHeaderAcceptSelected) {
311
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
312
+ responseType_ = 'text';
313
+ } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
314
+ responseType_ = 'json';
315
+ } else {
316
+ responseType_ = 'blob';
317
+ }
318
+ }
319
+
320
+ let localVarPath = `/assetrelations/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`;
321
+ return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`, {
322
+ context: localVarHttpContext,
323
+ responseType: <any>responseType_,
324
+ withCredentials: this.configuration.withCredentials,
325
+ headers: localVarHeaders,
326
+ observe: observe,
327
+ transferCache: localVarTransferCache,
328
+ reportProgress: reportProgress
329
+ });
330
+ }
331
+
332
+ /**
333
+ * This endpoint lists all asset relations in database.
334
+ * @param requestParameters
335
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
336
+ * @param reportProgress flag to report request and response progress.
337
+ */
338
+ public httpAssetRelationGetAll(
339
+ requestParameters?: HttpAssetRelationGetAllRequestParams,
340
+ observe?: 'body',
341
+ reportProgress?: boolean,
342
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
343
+ ): Observable<Array<AssetRelation>>;
344
+ public httpAssetRelationGetAll(
345
+ requestParameters?: HttpAssetRelationGetAllRequestParams,
346
+ observe?: 'response',
347
+ reportProgress?: boolean,
348
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
349
+ ): Observable<HttpResponse<Array<AssetRelation>>>;
350
+ public httpAssetRelationGetAll(
351
+ requestParameters?: HttpAssetRelationGetAllRequestParams,
352
+ observe?: 'events',
353
+ reportProgress?: boolean,
354
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
355
+ ): Observable<HttpEvent<Array<AssetRelation>>>;
356
+ public httpAssetRelationGetAll(
357
+ requestParameters?: HttpAssetRelationGetAllRequestParams,
358
+ observe: any = 'body',
359
+ reportProgress: boolean = false,
360
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
361
+ ): Observable<any> {
362
+ const assetrelationtypeid = requestParameters?.assetrelationtypeid;
363
+ const acceptLanguage = requestParameters?.acceptLanguage;
364
+ const translations = requestParameters?.translations;
365
+
366
+ let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
367
+ if (assetrelationtypeid !== undefined && assetrelationtypeid !== null) {
368
+ localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>assetrelationtypeid, 'assetrelationtypeid');
369
+ }
370
+ if (translations !== undefined && translations !== null) {
371
+ localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>translations, 'translations');
372
+ }
373
+
374
+ let localVarHeaders = this.defaultHeaders;
375
+ if (acceptLanguage !== undefined && acceptLanguage !== null) {
376
+ localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage));
377
+ }
378
+
379
+ let localVarCredential: string | undefined;
380
+ // authentication (msal_auth) required
381
+ localVarCredential = this.configuration.lookupCredential('msal_auth');
382
+ if (localVarCredential) {
383
+ localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
384
+ }
385
+
386
+ let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
387
+ if (localVarHttpHeaderAcceptSelected === undefined) {
388
+ // to determine the Accept header
389
+ const httpHeaderAccepts: string[] = ['application/json'];
390
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
391
+ }
392
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
393
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
394
+ }
395
+
396
+ let localVarHttpContext: HttpContext | undefined = options && options.context;
397
+ if (localVarHttpContext === undefined) {
398
+ localVarHttpContext = new HttpContext();
399
+ }
400
+
401
+ let localVarTransferCache: boolean | undefined = options && options.transferCache;
402
+ if (localVarTransferCache === undefined) {
403
+ localVarTransferCache = true;
404
+ }
405
+
406
+ let responseType_: 'text' | 'json' | 'blob' = 'json';
407
+ if (localVarHttpHeaderAcceptSelected) {
408
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
409
+ responseType_ = 'text';
410
+ } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
411
+ responseType_ = 'json';
412
+ } else {
413
+ responseType_ = 'blob';
414
+ }
415
+ }
416
+
417
+ let localVarPath = `/assetrelations`;
418
+ return this.httpClient.request<Array<AssetRelation>>('get', `${this.configuration.basePath}${localVarPath}`, {
419
+ context: localVarHttpContext,
420
+ params: localVarQueryParameters,
421
+ responseType: <any>responseType_,
422
+ withCredentials: this.configuration.withCredentials,
423
+ headers: localVarHeaders,
424
+ observe: observe,
425
+ transferCache: localVarTransferCache,
426
+ reportProgress: reportProgress
427
+ });
428
+ }
429
+
430
+ /**
431
+ * This endpoint gets a single asset relation.
432
+ * @param requestParameters
433
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
434
+ * @param reportProgress flag to report request and response progress.
435
+ */
436
+ public httpAssetRelationGetById(
437
+ requestParameters?: HttpAssetRelationGetByIdRequestParams,
438
+ observe?: 'body',
439
+ reportProgress?: boolean,
440
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
441
+ ): Observable<AssetRelation>;
442
+ public httpAssetRelationGetById(
443
+ requestParameters?: HttpAssetRelationGetByIdRequestParams,
444
+ observe?: 'response',
445
+ reportProgress?: boolean,
446
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
447
+ ): Observable<HttpResponse<AssetRelation>>;
448
+ public httpAssetRelationGetById(
449
+ requestParameters?: HttpAssetRelationGetByIdRequestParams,
450
+ observe?: 'events',
451
+ reportProgress?: boolean,
452
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
453
+ ): Observable<HttpEvent<AssetRelation>>;
454
+ public httpAssetRelationGetById(
455
+ requestParameters?: HttpAssetRelationGetByIdRequestParams,
456
+ observe: any = 'body',
457
+ reportProgress: boolean = false,
458
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
459
+ ): Observable<any> {
460
+ const id = requestParameters?.id;
461
+ if (id === null || id === undefined) {
462
+ throw new Error('Required parameter id was null or undefined when calling httpAssetRelationGetById.');
463
+ }
464
+ const translations = requestParameters?.translations;
465
+
466
+ let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
467
+ if (translations !== undefined && translations !== null) {
468
+ localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>translations, 'translations');
469
+ }
470
+
471
+ let localVarHeaders = this.defaultHeaders;
472
+
473
+ let localVarCredential: string | undefined;
474
+ // authentication (msal_auth) required
475
+ localVarCredential = this.configuration.lookupCredential('msal_auth');
476
+ if (localVarCredential) {
477
+ localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
478
+ }
479
+
480
+ let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
481
+ if (localVarHttpHeaderAcceptSelected === undefined) {
482
+ // to determine the Accept header
483
+ const httpHeaderAccepts: string[] = ['application/json'];
484
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
485
+ }
486
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
487
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
488
+ }
489
+
490
+ let localVarHttpContext: HttpContext | undefined = options && options.context;
491
+ if (localVarHttpContext === undefined) {
492
+ localVarHttpContext = new HttpContext();
493
+ }
494
+
495
+ let localVarTransferCache: boolean | undefined = options && options.transferCache;
496
+ if (localVarTransferCache === undefined) {
497
+ localVarTransferCache = true;
498
+ }
499
+
500
+ let responseType_: 'text' | 'json' | 'blob' = 'json';
501
+ if (localVarHttpHeaderAcceptSelected) {
502
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
503
+ responseType_ = 'text';
504
+ } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
505
+ responseType_ = 'json';
506
+ } else {
507
+ responseType_ = 'blob';
508
+ }
509
+ }
510
+
511
+ let localVarPath = `/assetrelations/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`;
512
+ return this.httpClient.request<AssetRelation>('get', `${this.configuration.basePath}${localVarPath}`, {
513
+ context: localVarHttpContext,
514
+ params: localVarQueryParameters,
515
+ responseType: <any>responseType_,
516
+ withCredentials: this.configuration.withCredentials,
517
+ headers: localVarHeaders,
518
+ observe: observe,
519
+ transferCache: localVarTransferCache,
520
+ reportProgress: reportProgress
521
+ });
522
+ }
523
+
524
+ /**
525
+ * This endpoint updates an asset relation entry in the database.
526
+ * @param requestParameters
527
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
528
+ * @param reportProgress flag to report request and response progress.
529
+ */
530
+ public httpAssetRelationUpdateById(
531
+ requestParameters?: HttpAssetRelationUpdateByIdRequestParams,
532
+ observe?: 'body',
533
+ reportProgress?: boolean,
534
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
535
+ ): Observable<AssetRelation>;
536
+ public httpAssetRelationUpdateById(
537
+ requestParameters?: HttpAssetRelationUpdateByIdRequestParams,
538
+ observe?: 'response',
539
+ reportProgress?: boolean,
540
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
541
+ ): Observable<HttpResponse<AssetRelation>>;
542
+ public httpAssetRelationUpdateById(
543
+ requestParameters?: HttpAssetRelationUpdateByIdRequestParams,
544
+ observe?: 'events',
545
+ reportProgress?: boolean,
546
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
547
+ ): Observable<HttpEvent<AssetRelation>>;
548
+ public httpAssetRelationUpdateById(
549
+ requestParameters?: HttpAssetRelationUpdateByIdRequestParams,
550
+ observe: any = 'body',
551
+ reportProgress: boolean = false,
552
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
553
+ ): Observable<any> {
554
+ const id = requestParameters?.id;
555
+ if (id === null || id === undefined) {
556
+ throw new Error('Required parameter id was null or undefined when calling httpAssetRelationUpdateById.');
557
+ }
558
+ const assetRelation = requestParameters?.assetRelation;
559
+ if (assetRelation === null || assetRelation === undefined) {
560
+ throw new Error('Required parameter assetRelation was null or undefined when calling httpAssetRelationUpdateById.');
561
+ }
562
+ const translations = requestParameters?.translations;
563
+ const acceptLanguage = requestParameters?.acceptLanguage;
564
+
565
+ let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
566
+ if (translations !== undefined && translations !== null) {
567
+ localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>translations, 'translations');
568
+ }
569
+
570
+ let localVarHeaders = this.defaultHeaders;
571
+ if (acceptLanguage !== undefined && acceptLanguage !== null) {
572
+ localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage));
573
+ }
574
+
575
+ let localVarCredential: string | undefined;
576
+ // authentication (msal_auth) required
577
+ localVarCredential = this.configuration.lookupCredential('msal_auth');
578
+ if (localVarCredential) {
579
+ localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
580
+ }
581
+
582
+ let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
583
+ if (localVarHttpHeaderAcceptSelected === undefined) {
584
+ // to determine the Accept header
585
+ const httpHeaderAccepts: string[] = ['application/json'];
586
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
587
+ }
588
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
589
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
590
+ }
591
+
592
+ let localVarHttpContext: HttpContext | undefined = options && options.context;
593
+ if (localVarHttpContext === undefined) {
594
+ localVarHttpContext = new HttpContext();
595
+ }
596
+
597
+ let localVarTransferCache: boolean | undefined = options && options.transferCache;
598
+ if (localVarTransferCache === undefined) {
599
+ localVarTransferCache = true;
600
+ }
601
+
602
+ // to determine the Content-Type header
603
+ const consumes: string[] = ['application/json'];
604
+ const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
605
+ if (httpContentTypeSelected !== undefined) {
606
+ localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
607
+ }
608
+
609
+ let responseType_: 'text' | 'json' | 'blob' = 'json';
610
+ if (localVarHttpHeaderAcceptSelected) {
611
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
612
+ responseType_ = 'text';
613
+ } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
614
+ responseType_ = 'json';
615
+ } else {
616
+ responseType_ = 'blob';
617
+ }
618
+ }
619
+
620
+ let localVarPath = `/assetrelations/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`;
621
+ return this.httpClient.request<AssetRelation>('post', `${this.configuration.basePath}${localVarPath}`, {
622
+ context: localVarHttpContext,
623
+ body: assetRelation,
624
+ params: localVarQueryParameters,
625
+ responseType: <any>responseType_,
626
+ withCredentials: this.configuration.withCredentials,
627
+ headers: localVarHeaders,
628
+ observe: observe,
629
+ transferCache: localVarTransferCache,
630
+ reportProgress: reportProgress
631
+ });
632
+ }
633
+ }