UNPKG

@agravity/private

Version:

The Agravity GlobalDAM API which allowes authenticated user to access the Agravity GlobalDAM Backend

476 lines (423 loc) 21 kB
/** * Agravity OpenAPI Documentation - Private Functions * * Contact: support@agravity.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /* tslint:disable:no-unused-variable member-ordering */ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, HttpResponse, HttpEvent, HttpParameterCodec, HttpContext } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; // @ts-ignore import { AgravityErrorResponse } from '../model/agravityErrorResponse.agravity'; // @ts-ignore import { DashboardWidget } from '../model/dashboardWidget.agravity'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { AgravityConfiguration } from '../configuration'; import { BaseService } from '../api.base.service'; export interface HttpDashboardWidgetsCreateRequestParams { /** The dashboard widget to create. */ dashboardWidget: DashboardWidget; /** The requested language of the response. If not matching it falls back to default language. */ acceptLanguage?: string; } export interface HttpDashboardWidgetsDeleteByIdRequestParams { /** The ID of the dashboard widget. */ id: string; } export interface HttpDashboardWidgetsGetAllRequestParams { /** If widgetdata should be populated. */ populate?: boolean; /** The requested language of the response. If not matching it falls back to default language. */ acceptLanguage?: string; } export interface HttpDashboardWidgetsGetByIdRequestParams { /** The ID of the dashboard widget. */ id: string; /** The requested language of the response. If not matching it falls back to default language. */ acceptLanguage?: string; } export interface HttpDashboardWidgetsUpdateByIdRequestParams { /** The ID of the dashboard widget. */ id: string; /** Body has to be a valid dashboard widget item. */ dashboardWidget: DashboardWidget; /** The requested language of the response. If not matching it falls back to default language. */ acceptLanguage?: string; } @Injectable({ providedIn: 'root' }) export class DashboardWidgetManagementService extends BaseService { constructor( protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: AgravityConfiguration ) { super(basePath, configuration); } /** * This endpoint creates a dashboard widget in database. * @param requestParameters * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public httpDashboardWidgetsCreate( requestParameters: HttpDashboardWidgetsCreateRequestParams, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<DashboardWidget>; public httpDashboardWidgetsCreate( requestParameters: HttpDashboardWidgetsCreateRequestParams, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpResponse<DashboardWidget>>; public httpDashboardWidgetsCreate( requestParameters: HttpDashboardWidgetsCreateRequestParams, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpEvent<DashboardWidget>>; public httpDashboardWidgetsCreate( requestParameters: HttpDashboardWidgetsCreateRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<any> { const dashboardWidget = requestParameters?.dashboardWidget; if (dashboardWidget === null || dashboardWidget === undefined) { throw new Error('Required parameter dashboardWidget was null or undefined when calling httpDashboardWidgetsCreate.'); } const acceptLanguage = requestParameters?.acceptLanguage; let localVarHeaders = this.defaultHeaders; if (acceptLanguage !== undefined && acceptLanguage !== null) { localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage)); } // authentication (msal_auth) required localVarHeaders = this.configuration.addCredentialToHeaders('msal_auth', 'Authorization', localVarHeaders, 'Bearer '); const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept(['application/json']); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); const localVarTransferCache: boolean = options?.transferCache ?? true; // to determine the Content-Type header const consumes: string[] = ['application/json']; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/dashboard/widgets`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request<DashboardWidget>('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: dashboardWidget, responseType: <any>responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } /** * This endpoint deletes a single dashboard widget. * @param requestParameters * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public httpDashboardWidgetsDeleteById( requestParameters: HttpDashboardWidgetsDeleteByIdRequestParams, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<any>; public httpDashboardWidgetsDeleteById( requestParameters: HttpDashboardWidgetsDeleteByIdRequestParams, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpResponse<any>>; public httpDashboardWidgetsDeleteById( requestParameters: HttpDashboardWidgetsDeleteByIdRequestParams, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpEvent<any>>; public httpDashboardWidgetsDeleteById( requestParameters: HttpDashboardWidgetsDeleteByIdRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<any> { const id = requestParameters?.id; if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling httpDashboardWidgetsDeleteById.'); } let localVarHeaders = this.defaultHeaders; // authentication (msal_auth) required localVarHeaders = this.configuration.addCredentialToHeaders('msal_auth', 'Authorization', localVarHeaders, 'Bearer '); const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept(['application/json']); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); const localVarTransferCache: boolean = options?.transferCache ?? true; let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/dashboard/widgets/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: <any>responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } /** * This endpoint lists all dashboard widgets in database. * @param requestParameters * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public httpDashboardWidgetsGetAll( requestParameters?: HttpDashboardWidgetsGetAllRequestParams, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<Array<DashboardWidget>>; public httpDashboardWidgetsGetAll( requestParameters?: HttpDashboardWidgetsGetAllRequestParams, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpResponse<Array<DashboardWidget>>>; public httpDashboardWidgetsGetAll( requestParameters?: HttpDashboardWidgetsGetAllRequestParams, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpEvent<Array<DashboardWidget>>>; public httpDashboardWidgetsGetAll( requestParameters?: HttpDashboardWidgetsGetAllRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<any> { const populate = requestParameters?.populate; const acceptLanguage = requestParameters?.acceptLanguage; let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>populate, 'populate'); let localVarHeaders = this.defaultHeaders; if (acceptLanguage !== undefined && acceptLanguage !== null) { localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage)); } // authentication (msal_auth) required localVarHeaders = this.configuration.addCredentialToHeaders('msal_auth', 'Authorization', localVarHeaders, 'Bearer '); const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept(['application/json']); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); const localVarTransferCache: boolean = options?.transferCache ?? true; let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/dashboard/widgets`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request<Array<DashboardWidget>>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: <any>responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } /** * This endpoint gets a dashboard widget from database. * @param requestParameters * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public httpDashboardWidgetsGetById( requestParameters: HttpDashboardWidgetsGetByIdRequestParams, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<DashboardWidget>; public httpDashboardWidgetsGetById( requestParameters: HttpDashboardWidgetsGetByIdRequestParams, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpResponse<DashboardWidget>>; public httpDashboardWidgetsGetById( requestParameters: HttpDashboardWidgetsGetByIdRequestParams, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpEvent<DashboardWidget>>; public httpDashboardWidgetsGetById( requestParameters: HttpDashboardWidgetsGetByIdRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<any> { const id = requestParameters?.id; if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling httpDashboardWidgetsGetById.'); } const acceptLanguage = requestParameters?.acceptLanguage; let localVarHeaders = this.defaultHeaders; if (acceptLanguage !== undefined && acceptLanguage !== null) { localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage)); } // authentication (msal_auth) required localVarHeaders = this.configuration.addCredentialToHeaders('msal_auth', 'Authorization', localVarHeaders, 'Bearer '); const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept(['application/json']); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); const localVarTransferCache: boolean = options?.transferCache ?? true; let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/dashboard/widgets/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request<DashboardWidget>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: <any>responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } /** * Updates a dashboard widget in database. * @param requestParameters * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public httpDashboardWidgetsUpdateById( requestParameters: HttpDashboardWidgetsUpdateByIdRequestParams, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<DashboardWidget>; public httpDashboardWidgetsUpdateById( requestParameters: HttpDashboardWidgetsUpdateByIdRequestParams, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpResponse<DashboardWidget>>; public httpDashboardWidgetsUpdateById( requestParameters: HttpDashboardWidgetsUpdateByIdRequestParams, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpEvent<DashboardWidget>>; public httpDashboardWidgetsUpdateById( requestParameters: HttpDashboardWidgetsUpdateByIdRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<any> { const id = requestParameters?.id; if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling httpDashboardWidgetsUpdateById.'); } const dashboardWidget = requestParameters?.dashboardWidget; if (dashboardWidget === null || dashboardWidget === undefined) { throw new Error('Required parameter dashboardWidget was null or undefined when calling httpDashboardWidgetsUpdateById.'); } const acceptLanguage = requestParameters?.acceptLanguage; let localVarHeaders = this.defaultHeaders; if (acceptLanguage !== undefined && acceptLanguage !== null) { localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage)); } // authentication (msal_auth) required localVarHeaders = this.configuration.addCredentialToHeaders('msal_auth', 'Authorization', localVarHeaders, 'Bearer '); const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept(['application/json']); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); const localVarTransferCache: boolean = options?.transferCache ?? true; // to determine the Content-Type header const consumes: string[] = ['application/json']; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/dashboard/widgets/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request<DashboardWidget>('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: dashboardWidget, responseType: <any>responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } }