@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,737 @@
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 { AgravityInfoResponse } from '../model/agravityInfoResponse.agravity';
21
+ // @ts-ignore
22
+ import { AssetRelationType } from '../model/assetRelationType.agravity';
23
+ // @ts-ignore
24
+ import { PermissionChange } from '../model/permissionChange.agravity';
25
+
26
+ // @ts-ignore
27
+ import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
28
+ import { AgravityConfiguration } from '../configuration';
29
+
30
+ export interface HttpAssetRelationTypeCreateRequestParams {
31
+ /** This endpoint creates an asset relation type in the database. */
32
+ assetRelationType: AssetRelationType;
33
+ /** When default language should be returned and the translation dictionary is delivered. (Ignores the \"Accept-Language\" header) */
34
+ translations?: boolean;
35
+ /** The requested language of the response. If not matching it falls back to default language. */
36
+ acceptLanguage?: string;
37
+ }
38
+
39
+ export interface HttpAssetRelationTypeDeleteByIdRequestParams {
40
+ /** The ID of the asset relation type. */
41
+ id: string;
42
+ }
43
+
44
+ export interface HttpAssetRelationTypeGetAllRequestParams {
45
+ /** When default language should be returned and the translation dictionary is delivered. (Ignores the \"Accept-Language\" header) */
46
+ translations?: boolean;
47
+ /** The requested language of the response. If not matching it falls back to default language. */
48
+ acceptLanguage?: string;
49
+ }
50
+
51
+ export interface HttpAssetRelationTypeGetByIdRequestParams {
52
+ /** The ID of the asset relation type. */
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
+ /** The requested language of the response. If not matching it falls back to default language. */
57
+ acceptLanguage?: string;
58
+ }
59
+
60
+ export interface HttpAssetRelationTypeUpdatePermissionsByIdRequestParams {
61
+ /** The ID of the asset relation type. */
62
+ id: string;
63
+ /** The changes which ids and how they should be added / removed / replaced / etc. */
64
+ permissionChange: PermissionChange;
65
+ }
66
+
67
+ export interface HttpAssetRelationTypeUpdateWithIdRequestParams {
68
+ /** The ID of the asset relation type. */
69
+ id: string;
70
+ /** This endpoint updates an asset relation type with ID in the database. */
71
+ assetRelationType: AssetRelationType;
72
+ /** When default language should be returned and the translation dictionary is delivered. (Ignores the \"Accept-Language\" header) */
73
+ translations?: boolean;
74
+ /** The requested language of the response. If not matching it falls back to default language. */
75
+ acceptLanguage?: string;
76
+ }
77
+
78
+ @Injectable({
79
+ providedIn: 'root'
80
+ })
81
+ export class AssetRelationTypeManagementService {
82
+ protected basePath = 'http://localhost:7071/api';
83
+ public defaultHeaders = new HttpHeaders();
84
+ public configuration = new AgravityConfiguration();
85
+ public encoder: HttpParameterCodec;
86
+
87
+ constructor(
88
+ protected httpClient: HttpClient,
89
+ @Optional() @Inject(BASE_PATH) basePath: string | string[],
90
+ @Optional() configuration: AgravityConfiguration
91
+ ) {
92
+ if (configuration) {
93
+ this.configuration = configuration;
94
+ }
95
+ if (typeof this.configuration.basePath !== 'string') {
96
+ const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined;
97
+ if (firstBasePath != undefined) {
98
+ basePath = firstBasePath;
99
+ }
100
+
101
+ if (typeof basePath !== 'string') {
102
+ basePath = this.basePath;
103
+ }
104
+ this.configuration.basePath = basePath;
105
+ }
106
+ this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
107
+ }
108
+
109
+ // @ts-ignore
110
+ private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
111
+ if (typeof value === 'object' && value instanceof Date === false) {
112
+ httpParams = this.addToHttpParamsRecursive(httpParams, value);
113
+ } else {
114
+ httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
115
+ }
116
+ return httpParams;
117
+ }
118
+
119
+ private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
120
+ if (value == null) {
121
+ return httpParams;
122
+ }
123
+
124
+ if (typeof value === 'object') {
125
+ if (Array.isArray(value)) {
126
+ (value as any[]).forEach((elem) => (httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)));
127
+ } else if (value instanceof Date) {
128
+ if (key != null) {
129
+ httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10));
130
+ } else {
131
+ throw Error('key may not be null if value is Date');
132
+ }
133
+ } else {
134
+ Object.keys(value).forEach((k) => (httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k)));
135
+ }
136
+ } else if (key != null) {
137
+ httpParams = httpParams.append(key, value);
138
+ } else {
139
+ throw Error('key may not be null if value is not object or array');
140
+ }
141
+ return httpParams;
142
+ }
143
+
144
+ /**
145
+ * This endpoint creates one asset relation type entry in the database.
146
+ * @param requestParameters
147
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
148
+ * @param reportProgress flag to report request and response progress.
149
+ */
150
+ public httpAssetRelationTypeCreate(
151
+ requestParameters?: HttpAssetRelationTypeCreateRequestParams,
152
+ observe?: 'body',
153
+ reportProgress?: boolean,
154
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
155
+ ): Observable<AssetRelationType>;
156
+ public httpAssetRelationTypeCreate(
157
+ requestParameters?: HttpAssetRelationTypeCreateRequestParams,
158
+ observe?: 'response',
159
+ reportProgress?: boolean,
160
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
161
+ ): Observable<HttpResponse<AssetRelationType>>;
162
+ public httpAssetRelationTypeCreate(
163
+ requestParameters?: HttpAssetRelationTypeCreateRequestParams,
164
+ observe?: 'events',
165
+ reportProgress?: boolean,
166
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
167
+ ): Observable<HttpEvent<AssetRelationType>>;
168
+ public httpAssetRelationTypeCreate(
169
+ requestParameters?: HttpAssetRelationTypeCreateRequestParams,
170
+ observe: any = 'body',
171
+ reportProgress: boolean = false,
172
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
173
+ ): Observable<any> {
174
+ const assetRelationType = requestParameters?.assetRelationType;
175
+ if (assetRelationType === null || assetRelationType === undefined) {
176
+ throw new Error('Required parameter assetRelationType was null or undefined when calling httpAssetRelationTypeCreate.');
177
+ }
178
+ const translations = requestParameters?.translations;
179
+ const acceptLanguage = requestParameters?.acceptLanguage;
180
+
181
+ let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
182
+ if (translations !== undefined && translations !== null) {
183
+ localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>translations, 'translations');
184
+ }
185
+
186
+ let localVarHeaders = this.defaultHeaders;
187
+ if (acceptLanguage !== undefined && acceptLanguage !== null) {
188
+ localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage));
189
+ }
190
+
191
+ let localVarCredential: string | undefined;
192
+ // authentication (msal_auth) required
193
+ localVarCredential = this.configuration.lookupCredential('msal_auth');
194
+ if (localVarCredential) {
195
+ localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
196
+ }
197
+
198
+ let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
199
+ if (localVarHttpHeaderAcceptSelected === undefined) {
200
+ // to determine the Accept header
201
+ const httpHeaderAccepts: string[] = ['application/json'];
202
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
203
+ }
204
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
205
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
206
+ }
207
+
208
+ let localVarHttpContext: HttpContext | undefined = options && options.context;
209
+ if (localVarHttpContext === undefined) {
210
+ localVarHttpContext = new HttpContext();
211
+ }
212
+
213
+ let localVarTransferCache: boolean | undefined = options && options.transferCache;
214
+ if (localVarTransferCache === undefined) {
215
+ localVarTransferCache = true;
216
+ }
217
+
218
+ // to determine the Content-Type header
219
+ const consumes: string[] = ['application/json'];
220
+ const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
221
+ if (httpContentTypeSelected !== undefined) {
222
+ localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
223
+ }
224
+
225
+ let responseType_: 'text' | 'json' | 'blob' = 'json';
226
+ if (localVarHttpHeaderAcceptSelected) {
227
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
228
+ responseType_ = 'text';
229
+ } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
230
+ responseType_ = 'json';
231
+ } else {
232
+ responseType_ = 'blob';
233
+ }
234
+ }
235
+
236
+ let localVarPath = `/assetrelationtypes`;
237
+ return this.httpClient.request<AssetRelationType>('post', `${this.configuration.basePath}${localVarPath}`, {
238
+ context: localVarHttpContext,
239
+ body: assetRelationType,
240
+ params: localVarQueryParameters,
241
+ responseType: <any>responseType_,
242
+ withCredentials: this.configuration.withCredentials,
243
+ headers: localVarHeaders,
244
+ observe: observe,
245
+ transferCache: localVarTransferCache,
246
+ reportProgress: reportProgress
247
+ });
248
+ }
249
+
250
+ /**
251
+ * This endpoint deletes a single asset relation type.
252
+ * @param requestParameters
253
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
254
+ * @param reportProgress flag to report request and response progress.
255
+ */
256
+ public httpAssetRelationTypeDeleteById(
257
+ requestParameters?: HttpAssetRelationTypeDeleteByIdRequestParams,
258
+ observe?: 'body',
259
+ reportProgress?: boolean,
260
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
261
+ ): Observable<any>;
262
+ public httpAssetRelationTypeDeleteById(
263
+ requestParameters?: HttpAssetRelationTypeDeleteByIdRequestParams,
264
+ observe?: 'response',
265
+ reportProgress?: boolean,
266
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
267
+ ): Observable<HttpResponse<any>>;
268
+ public httpAssetRelationTypeDeleteById(
269
+ requestParameters?: HttpAssetRelationTypeDeleteByIdRequestParams,
270
+ observe?: 'events',
271
+ reportProgress?: boolean,
272
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
273
+ ): Observable<HttpEvent<any>>;
274
+ public httpAssetRelationTypeDeleteById(
275
+ requestParameters?: HttpAssetRelationTypeDeleteByIdRequestParams,
276
+ observe: any = 'body',
277
+ reportProgress: boolean = false,
278
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
279
+ ): Observable<any> {
280
+ const id = requestParameters?.id;
281
+ if (id === null || id === undefined) {
282
+ throw new Error('Required parameter id was null or undefined when calling httpAssetRelationTypeDeleteById.');
283
+ }
284
+
285
+ let localVarHeaders = this.defaultHeaders;
286
+
287
+ let localVarCredential: string | undefined;
288
+ // authentication (msal_auth) required
289
+ localVarCredential = this.configuration.lookupCredential('msal_auth');
290
+ if (localVarCredential) {
291
+ localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
292
+ }
293
+
294
+ let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
295
+ if (localVarHttpHeaderAcceptSelected === undefined) {
296
+ // to determine the Accept header
297
+ const httpHeaderAccepts: string[] = ['application/json'];
298
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
299
+ }
300
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
301
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
302
+ }
303
+
304
+ let localVarHttpContext: HttpContext | undefined = options && options.context;
305
+ if (localVarHttpContext === undefined) {
306
+ localVarHttpContext = new HttpContext();
307
+ }
308
+
309
+ let localVarTransferCache: boolean | undefined = options && options.transferCache;
310
+ if (localVarTransferCache === undefined) {
311
+ localVarTransferCache = true;
312
+ }
313
+
314
+ let responseType_: 'text' | 'json' | 'blob' = 'json';
315
+ if (localVarHttpHeaderAcceptSelected) {
316
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
317
+ responseType_ = 'text';
318
+ } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
319
+ responseType_ = 'json';
320
+ } else {
321
+ responseType_ = 'blob';
322
+ }
323
+ }
324
+
325
+ let localVarPath = `/assetrelationtypes/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`;
326
+ return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`, {
327
+ context: localVarHttpContext,
328
+ responseType: <any>responseType_,
329
+ withCredentials: this.configuration.withCredentials,
330
+ headers: localVarHeaders,
331
+ observe: observe,
332
+ transferCache: localVarTransferCache,
333
+ reportProgress: reportProgress
334
+ });
335
+ }
336
+
337
+ /**
338
+ * This endpoint lists all asset relation types in database.
339
+ * @param requestParameters
340
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
341
+ * @param reportProgress flag to report request and response progress.
342
+ */
343
+ public httpAssetRelationTypeGetAll(
344
+ requestParameters?: HttpAssetRelationTypeGetAllRequestParams,
345
+ observe?: 'body',
346
+ reportProgress?: boolean,
347
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
348
+ ): Observable<Array<AssetRelationType>>;
349
+ public httpAssetRelationTypeGetAll(
350
+ requestParameters?: HttpAssetRelationTypeGetAllRequestParams,
351
+ observe?: 'response',
352
+ reportProgress?: boolean,
353
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
354
+ ): Observable<HttpResponse<Array<AssetRelationType>>>;
355
+ public httpAssetRelationTypeGetAll(
356
+ requestParameters?: HttpAssetRelationTypeGetAllRequestParams,
357
+ observe?: 'events',
358
+ reportProgress?: boolean,
359
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
360
+ ): Observable<HttpEvent<Array<AssetRelationType>>>;
361
+ public httpAssetRelationTypeGetAll(
362
+ requestParameters?: HttpAssetRelationTypeGetAllRequestParams,
363
+ observe: any = 'body',
364
+ reportProgress: boolean = false,
365
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
366
+ ): Observable<any> {
367
+ const translations = requestParameters?.translations;
368
+ const acceptLanguage = requestParameters?.acceptLanguage;
369
+
370
+ let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
371
+ if (translations !== undefined && translations !== null) {
372
+ localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>translations, 'translations');
373
+ }
374
+
375
+ let localVarHeaders = this.defaultHeaders;
376
+ if (acceptLanguage !== undefined && acceptLanguage !== null) {
377
+ localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage));
378
+ }
379
+
380
+ let localVarCredential: string | undefined;
381
+ // authentication (msal_auth) required
382
+ localVarCredential = this.configuration.lookupCredential('msal_auth');
383
+ if (localVarCredential) {
384
+ localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
385
+ }
386
+
387
+ let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
388
+ if (localVarHttpHeaderAcceptSelected === undefined) {
389
+ // to determine the Accept header
390
+ const httpHeaderAccepts: string[] = ['application/json'];
391
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
392
+ }
393
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
394
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
395
+ }
396
+
397
+ let localVarHttpContext: HttpContext | undefined = options && options.context;
398
+ if (localVarHttpContext === undefined) {
399
+ localVarHttpContext = new HttpContext();
400
+ }
401
+
402
+ let localVarTransferCache: boolean | undefined = options && options.transferCache;
403
+ if (localVarTransferCache === undefined) {
404
+ localVarTransferCache = true;
405
+ }
406
+
407
+ let responseType_: 'text' | 'json' | 'blob' = 'json';
408
+ if (localVarHttpHeaderAcceptSelected) {
409
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
410
+ responseType_ = 'text';
411
+ } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
412
+ responseType_ = 'json';
413
+ } else {
414
+ responseType_ = 'blob';
415
+ }
416
+ }
417
+
418
+ let localVarPath = `/assetrelationtypes`;
419
+ return this.httpClient.request<Array<AssetRelationType>>('get', `${this.configuration.basePath}${localVarPath}`, {
420
+ context: localVarHttpContext,
421
+ params: localVarQueryParameters,
422
+ responseType: <any>responseType_,
423
+ withCredentials: this.configuration.withCredentials,
424
+ headers: localVarHeaders,
425
+ observe: observe,
426
+ transferCache: localVarTransferCache,
427
+ reportProgress: reportProgress
428
+ });
429
+ }
430
+
431
+ /**
432
+ * This endpoint gets a single asset relation type.
433
+ * @param requestParameters
434
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
435
+ * @param reportProgress flag to report request and response progress.
436
+ */
437
+ public httpAssetRelationTypeGetById(
438
+ requestParameters?: HttpAssetRelationTypeGetByIdRequestParams,
439
+ observe?: 'body',
440
+ reportProgress?: boolean,
441
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
442
+ ): Observable<AssetRelationType>;
443
+ public httpAssetRelationTypeGetById(
444
+ requestParameters?: HttpAssetRelationTypeGetByIdRequestParams,
445
+ observe?: 'response',
446
+ reportProgress?: boolean,
447
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
448
+ ): Observable<HttpResponse<AssetRelationType>>;
449
+ public httpAssetRelationTypeGetById(
450
+ requestParameters?: HttpAssetRelationTypeGetByIdRequestParams,
451
+ observe?: 'events',
452
+ reportProgress?: boolean,
453
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
454
+ ): Observable<HttpEvent<AssetRelationType>>;
455
+ public httpAssetRelationTypeGetById(
456
+ requestParameters?: HttpAssetRelationTypeGetByIdRequestParams,
457
+ observe: any = 'body',
458
+ reportProgress: boolean = false,
459
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
460
+ ): Observable<any> {
461
+ const id = requestParameters?.id;
462
+ if (id === null || id === undefined) {
463
+ throw new Error('Required parameter id was null or undefined when calling httpAssetRelationTypeGetById.');
464
+ }
465
+ const translations = requestParameters?.translations;
466
+ const acceptLanguage = requestParameters?.acceptLanguage;
467
+
468
+ let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
469
+ if (translations !== undefined && translations !== null) {
470
+ localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>translations, 'translations');
471
+ }
472
+
473
+ let localVarHeaders = this.defaultHeaders;
474
+ if (acceptLanguage !== undefined && acceptLanguage !== null) {
475
+ localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage));
476
+ }
477
+
478
+ let localVarCredential: string | undefined;
479
+ // authentication (msal_auth) required
480
+ localVarCredential = this.configuration.lookupCredential('msal_auth');
481
+ if (localVarCredential) {
482
+ localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
483
+ }
484
+
485
+ let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
486
+ if (localVarHttpHeaderAcceptSelected === undefined) {
487
+ // to determine the Accept header
488
+ const httpHeaderAccepts: string[] = ['application/json'];
489
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
490
+ }
491
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
492
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
493
+ }
494
+
495
+ let localVarHttpContext: HttpContext | undefined = options && options.context;
496
+ if (localVarHttpContext === undefined) {
497
+ localVarHttpContext = new HttpContext();
498
+ }
499
+
500
+ let localVarTransferCache: boolean | undefined = options && options.transferCache;
501
+ if (localVarTransferCache === undefined) {
502
+ localVarTransferCache = true;
503
+ }
504
+
505
+ let responseType_: 'text' | 'json' | 'blob' = 'json';
506
+ if (localVarHttpHeaderAcceptSelected) {
507
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
508
+ responseType_ = 'text';
509
+ } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
510
+ responseType_ = 'json';
511
+ } else {
512
+ responseType_ = 'blob';
513
+ }
514
+ }
515
+
516
+ let localVarPath = `/assetrelationtypes/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`;
517
+ return this.httpClient.request<AssetRelationType>('get', `${this.configuration.basePath}${localVarPath}`, {
518
+ context: localVarHttpContext,
519
+ params: localVarQueryParameters,
520
+ responseType: <any>responseType_,
521
+ withCredentials: this.configuration.withCredentials,
522
+ headers: localVarHeaders,
523
+ observe: observe,
524
+ transferCache: localVarTransferCache,
525
+ reportProgress: reportProgress
526
+ });
527
+ }
528
+
529
+ /**
530
+ * This endpoint updates the permissions of the asset relation type.
531
+ * @param requestParameters
532
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
533
+ * @param reportProgress flag to report request and response progress.
534
+ */
535
+ public httpAssetRelationTypeUpdatePermissionsById(
536
+ requestParameters?: HttpAssetRelationTypeUpdatePermissionsByIdRequestParams,
537
+ observe?: 'body',
538
+ reportProgress?: boolean,
539
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
540
+ ): Observable<AgravityInfoResponse>;
541
+ public httpAssetRelationTypeUpdatePermissionsById(
542
+ requestParameters?: HttpAssetRelationTypeUpdatePermissionsByIdRequestParams,
543
+ observe?: 'response',
544
+ reportProgress?: boolean,
545
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
546
+ ): Observable<HttpResponse<AgravityInfoResponse>>;
547
+ public httpAssetRelationTypeUpdatePermissionsById(
548
+ requestParameters?: HttpAssetRelationTypeUpdatePermissionsByIdRequestParams,
549
+ observe?: 'events',
550
+ reportProgress?: boolean,
551
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
552
+ ): Observable<HttpEvent<AgravityInfoResponse>>;
553
+ public httpAssetRelationTypeUpdatePermissionsById(
554
+ requestParameters?: HttpAssetRelationTypeUpdatePermissionsByIdRequestParams,
555
+ observe: any = 'body',
556
+ reportProgress: boolean = false,
557
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
558
+ ): Observable<any> {
559
+ const id = requestParameters?.id;
560
+ if (id === null || id === undefined) {
561
+ throw new Error('Required parameter id was null or undefined when calling httpAssetRelationTypeUpdatePermissionsById.');
562
+ }
563
+ const permissionChange = requestParameters?.permissionChange;
564
+ if (permissionChange === null || permissionChange === undefined) {
565
+ throw new Error('Required parameter permissionChange was null or undefined when calling httpAssetRelationTypeUpdatePermissionsById.');
566
+ }
567
+
568
+ let localVarHeaders = this.defaultHeaders;
569
+
570
+ let localVarCredential: string | undefined;
571
+ // authentication (msal_auth) required
572
+ localVarCredential = this.configuration.lookupCredential('msal_auth');
573
+ if (localVarCredential) {
574
+ localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
575
+ }
576
+
577
+ let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
578
+ if (localVarHttpHeaderAcceptSelected === undefined) {
579
+ // to determine the Accept header
580
+ const httpHeaderAccepts: string[] = ['application/json'];
581
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
582
+ }
583
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
584
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
585
+ }
586
+
587
+ let localVarHttpContext: HttpContext | undefined = options && options.context;
588
+ if (localVarHttpContext === undefined) {
589
+ localVarHttpContext = new HttpContext();
590
+ }
591
+
592
+ let localVarTransferCache: boolean | undefined = options && options.transferCache;
593
+ if (localVarTransferCache === undefined) {
594
+ localVarTransferCache = true;
595
+ }
596
+
597
+ // to determine the Content-Type header
598
+ const consumes: string[] = ['application/json'];
599
+ const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
600
+ if (httpContentTypeSelected !== undefined) {
601
+ localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
602
+ }
603
+
604
+ let responseType_: 'text' | 'json' | 'blob' = 'json';
605
+ if (localVarHttpHeaderAcceptSelected) {
606
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
607
+ responseType_ = 'text';
608
+ } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
609
+ responseType_ = 'json';
610
+ } else {
611
+ responseType_ = 'blob';
612
+ }
613
+ }
614
+
615
+ let localVarPath = `/assetrelationtypes/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/permissions`;
616
+ return this.httpClient.request<AgravityInfoResponse>('post', `${this.configuration.basePath}${localVarPath}`, {
617
+ context: localVarHttpContext,
618
+ body: permissionChange,
619
+ responseType: <any>responseType_,
620
+ withCredentials: this.configuration.withCredentials,
621
+ headers: localVarHeaders,
622
+ observe: observe,
623
+ transferCache: localVarTransferCache,
624
+ reportProgress: reportProgress
625
+ });
626
+ }
627
+
628
+ /**
629
+ * This endpoint updates an asset relation type entry in the database. Changes to hierarchical, sequential and unique per asset are not allowed if there are already asset relations using this type.
630
+ * @param requestParameters
631
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
632
+ * @param reportProgress flag to report request and response progress.
633
+ */
634
+ public httpAssetRelationTypeUpdateWithId(
635
+ requestParameters?: HttpAssetRelationTypeUpdateWithIdRequestParams,
636
+ observe?: 'body',
637
+ reportProgress?: boolean,
638
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
639
+ ): Observable<AssetRelationType>;
640
+ public httpAssetRelationTypeUpdateWithId(
641
+ requestParameters?: HttpAssetRelationTypeUpdateWithIdRequestParams,
642
+ observe?: 'response',
643
+ reportProgress?: boolean,
644
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
645
+ ): Observable<HttpResponse<AssetRelationType>>;
646
+ public httpAssetRelationTypeUpdateWithId(
647
+ requestParameters?: HttpAssetRelationTypeUpdateWithIdRequestParams,
648
+ observe?: 'events',
649
+ reportProgress?: boolean,
650
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
651
+ ): Observable<HttpEvent<AssetRelationType>>;
652
+ public httpAssetRelationTypeUpdateWithId(
653
+ requestParameters?: HttpAssetRelationTypeUpdateWithIdRequestParams,
654
+ observe: any = 'body',
655
+ reportProgress: boolean = false,
656
+ options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
657
+ ): Observable<any> {
658
+ const id = requestParameters?.id;
659
+ if (id === null || id === undefined) {
660
+ throw new Error('Required parameter id was null or undefined when calling httpAssetRelationTypeUpdateWithId.');
661
+ }
662
+ const assetRelationType = requestParameters?.assetRelationType;
663
+ if (assetRelationType === null || assetRelationType === undefined) {
664
+ throw new Error('Required parameter assetRelationType was null or undefined when calling httpAssetRelationTypeUpdateWithId.');
665
+ }
666
+ const translations = requestParameters?.translations;
667
+ const acceptLanguage = requestParameters?.acceptLanguage;
668
+
669
+ let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
670
+ if (translations !== undefined && translations !== null) {
671
+ localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>translations, 'translations');
672
+ }
673
+
674
+ let localVarHeaders = this.defaultHeaders;
675
+ if (acceptLanguage !== undefined && acceptLanguage !== null) {
676
+ localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage));
677
+ }
678
+
679
+ let localVarCredential: string | undefined;
680
+ // authentication (msal_auth) required
681
+ localVarCredential = this.configuration.lookupCredential('msal_auth');
682
+ if (localVarCredential) {
683
+ localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
684
+ }
685
+
686
+ let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
687
+ if (localVarHttpHeaderAcceptSelected === undefined) {
688
+ // to determine the Accept header
689
+ const httpHeaderAccepts: string[] = ['application/json'];
690
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
691
+ }
692
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
693
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
694
+ }
695
+
696
+ let localVarHttpContext: HttpContext | undefined = options && options.context;
697
+ if (localVarHttpContext === undefined) {
698
+ localVarHttpContext = new HttpContext();
699
+ }
700
+
701
+ let localVarTransferCache: boolean | undefined = options && options.transferCache;
702
+ if (localVarTransferCache === undefined) {
703
+ localVarTransferCache = true;
704
+ }
705
+
706
+ // to determine the Content-Type header
707
+ const consumes: string[] = ['application/json'];
708
+ const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
709
+ if (httpContentTypeSelected !== undefined) {
710
+ localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
711
+ }
712
+
713
+ let responseType_: 'text' | 'json' | 'blob' = 'json';
714
+ if (localVarHttpHeaderAcceptSelected) {
715
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
716
+ responseType_ = 'text';
717
+ } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
718
+ responseType_ = 'json';
719
+ } else {
720
+ responseType_ = 'blob';
721
+ }
722
+ }
723
+
724
+ let localVarPath = `/assetrelationtypes/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`;
725
+ return this.httpClient.request<AssetRelationType>('post', `${this.configuration.basePath}${localVarPath}`, {
726
+ context: localVarHttpContext,
727
+ body: assetRelationType,
728
+ params: localVarQueryParameters,
729
+ responseType: <any>responseType_,
730
+ withCredentials: this.configuration.withCredentials,
731
+ headers: localVarHeaders,
732
+ observe: observe,
733
+ transferCache: localVarTransferCache,
734
+ reportProgress: reportProgress
735
+ });
736
+ }
737
+ }