UNPKG

@agravity/private

Version:

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

530 lines (470 loc) 22.5 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 { PermissionToProfileBody } from '../model/permissionToProfileBody.agravity'; // @ts-ignore import { Profile } from '../model/profile.agravity'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { AgravityConfiguration } from '../configuration'; import { BaseService } from '../api.base.service'; export interface HttpPermissionsToProfileRequestParams { /** The ID of the profile. */ id: string; /** Contains information about this operation. */ permissionToProfileBody: PermissionToProfileBody; } export interface HttpProfilesCreateRequestParams { /** The profile to create. */ profile: Profile; } export interface HttpProfilesDeleteByIdRequestParams { /** The ID of the profile. */ id: string; } export interface HttpProfilesGetByIdRequestParams { /** The ID of the profile. */ id: string; } export interface HttpProfilesUpdateByIdRequestParams { /** The ID of the profile. */ id: string; /** Body has to be a valid profile item. */ profile: Profile; } @Injectable({ providedIn: 'root' }) export class ProfilesManagementService extends BaseService { constructor( protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: AgravityConfiguration ) { super(basePath, configuration); } /** * This endpoint allows to assign/unassign permissions in the form of a user or group ID to a profile. * @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 httpPermissionsToProfile( requestParameters: HttpPermissionsToProfileRequestParams, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<Profile>; public httpPermissionsToProfile( requestParameters: HttpPermissionsToProfileRequestParams, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpResponse<Profile>>; public httpPermissionsToProfile( requestParameters: HttpPermissionsToProfileRequestParams, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpEvent<Profile>>; public httpPermissionsToProfile( requestParameters: HttpPermissionsToProfileRequestParams, 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 httpPermissionsToProfile.'); } const permissionToProfileBody = requestParameters?.permissionToProfileBody; if (permissionToProfileBody === null || permissionToProfileBody === undefined) { throw new Error('Required parameter permissionToProfileBody was null or undefined when calling httpPermissionsToProfile.'); } 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; // 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 = `/profiles/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/toprofile`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request<Profile>('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: permissionToProfileBody, responseType: <any>responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } /** * This endpoint creates a profile and adds the information to the 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 httpProfilesCreate( requestParameters: HttpProfilesCreateRequestParams, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<Profile>; public httpProfilesCreate( requestParameters: HttpProfilesCreateRequestParams, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpResponse<Profile>>; public httpProfilesCreate( requestParameters: HttpProfilesCreateRequestParams, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpEvent<Profile>>; public httpProfilesCreate( requestParameters: HttpProfilesCreateRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<any> { const profile = requestParameters?.profile; if (profile === null || profile === undefined) { throw new Error('Required parameter profile was null or undefined when calling httpProfilesCreate.'); } 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; // 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 = `/profiles`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request<Profile>('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: profile, responseType: <any>responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } /** * This endpoint deletes a single profile. * @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 httpProfilesDeleteById( requestParameters: HttpProfilesDeleteByIdRequestParams, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<any>; public httpProfilesDeleteById( requestParameters: HttpProfilesDeleteByIdRequestParams, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpResponse<any>>; public httpProfilesDeleteById( requestParameters: HttpProfilesDeleteByIdRequestParams, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpEvent<any>>; public httpProfilesDeleteById( requestParameters: HttpProfilesDeleteByIdRequestParams, 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 httpProfilesDeleteById.'); } 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 = `/profiles/${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 profiles in database. * @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 httpProfilesGetAll( observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<Array<Profile>>; public httpProfilesGetAll( observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpResponse<Array<Profile>>>; public httpProfilesGetAll( observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpEvent<Array<Profile>>>; public httpProfilesGetAll( observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<any> { 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 = `/profiles`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request<Array<Profile>>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: <any>responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } /** * This endpoint gets a single profile by ID 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 httpProfilesGetById( requestParameters: HttpProfilesGetByIdRequestParams, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<Profile>; public httpProfilesGetById( requestParameters: HttpProfilesGetByIdRequestParams, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpResponse<Profile>>; public httpProfilesGetById( requestParameters: HttpProfilesGetByIdRequestParams, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpEvent<Profile>>; public httpProfilesGetById( requestParameters: HttpProfilesGetByIdRequestParams, 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 httpProfilesGetById.'); } 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 = `/profiles/${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<Profile>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: <any>responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } /** * Updates a profile 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 httpProfilesUpdateById( requestParameters: HttpProfilesUpdateByIdRequestParams, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<Profile>; public httpProfilesUpdateById( requestParameters: HttpProfilesUpdateByIdRequestParams, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpResponse<Profile>>; public httpProfilesUpdateById( requestParameters: HttpProfilesUpdateByIdRequestParams, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpEvent<Profile>>; public httpProfilesUpdateById( requestParameters: HttpProfilesUpdateByIdRequestParams, 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 httpProfilesUpdateById.'); } const profile = requestParameters?.profile; if (profile === null || profile === undefined) { throw new Error('Required parameter profile was null or undefined when calling httpProfilesUpdateById.'); } 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; // 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 = `/profiles/${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<Profile>('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: profile, responseType: <any>responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } }