/** * Gravitee.io Portal Rest API * API dedicated to the devportal part of Gravitee * * The version of the OpenAPI document: 3.0.0 * Contact: contact@graviteesource.com * * 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 } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; import { ConfigurationIdentitiesResponse } from '../model/configurationIdentitiesResponse'; import { ConfigurationResponse } from '../model/configurationResponse'; import { ErrorResponse } from '../model/errorResponse'; import { Info } from '../model/info'; import { TicketInput } from '../model/ticketInput'; import { View } from '../model/view'; import { ViewsResponse } from '../model/viewsResponse'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; export interface CreateTicketRequestParams { TicketInput?: TicketInput; } export interface GetPictureByViewIdRequestParams { viewId: string; } export interface GetViewByViewIdRequestParams { viewId: string; } export interface GetViewsRequestParams { page?: number; size?: number; } @Injectable({ providedIn: 'root' }) export class PortalService { protected basePath = 'http://demo.gravitee.io/portal/DEFAULT'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { if (configuration) { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { if (typeof basePath !== 'string') { basePath = this.basePath; } this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } /** * Create a ticket. * Create a ticket. This ticket can aim : * a specific application * a specific API * the gravitee portal User must be authenticated to use this service. * @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 createTicket(requestParameters: CreateTicketRequestParams, observe?: 'body', reportProgress?: boolean): Observable; public createTicket(requestParameters: CreateTicketRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; public createTicket(requestParameters: CreateTicketRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; public createTicket(requestParameters: CreateTicketRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { const TicketInput = requestParameters.TicketInput; let headers = this.defaultHeaders; // authentication (BasicAuth) required if (this.configuration.username || this.configuration.password) { headers = headers.set('Authorization', 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password)); } // authentication (CookieAuth) required // to determine the Accept header const httpHeaderAccepts: string[] = [ 'application/json' ]; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } // to determine the Content-Type header const consumes: string[] = [ 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } return this.httpClient.post(`${this.configuration.basePath}/tickets`, TicketInput, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * Get picture of a View * Get the picture of a view. * @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 getPictureByViewId(requestParameters: GetPictureByViewIdRequestParams, observe?: 'body', reportProgress?: boolean): Observable; public getPictureByViewId(requestParameters: GetPictureByViewIdRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; public getPictureByViewId(requestParameters: GetPictureByViewIdRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; public getPictureByViewId(requestParameters: GetPictureByViewIdRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { const viewId = requestParameters.viewId; if (viewId === null || viewId === undefined) { throw new Error('Required parameter viewId was null or undefined when calling getPictureByViewId.'); } let headers = this.defaultHeaders; // to determine the Accept header const httpHeaderAccepts: string[] = [ 'image/_*', 'application/json' ]; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.get(`${this.configuration.basePath}/views/${encodeURIComponent(String(viewId))}/picture`, { responseType: "blob", withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * Get portal configuration. * Get all the portal configuration from the platform settings. * @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 getPortalConfiguration(observe?: 'body', reportProgress?: boolean): Observable; public getPortalConfiguration(observe?: 'response', reportProgress?: boolean): Observable>; public getPortalConfiguration(observe?: 'events', reportProgress?: boolean): Observable>; public getPortalConfiguration(observe: any = 'body', reportProgress: boolean = false ): Observable { let headers = this.defaultHeaders; // to determine the Accept header const httpHeaderAccepts: string[] = [ 'application/json' ]; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.get(`${this.configuration.basePath}/configuration`, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * Get the identity provider list. * Get all the identity providers that can used in the portal. * @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 getPortalIdentityProviders(observe?: 'body', reportProgress?: boolean): Observable; public getPortalIdentityProviders(observe?: 'response', reportProgress?: boolean): Observable>; public getPortalIdentityProviders(observe?: 'events', reportProgress?: boolean): Observable>; public getPortalIdentityProviders(observe: any = 'body', reportProgress: boolean = false ): Observable { let headers = this.defaultHeaders; // to determine the Accept header const httpHeaderAccepts: string[] = [ 'application/json' ]; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.get(`${this.configuration.basePath}/configuration/identities`, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * Get portal information. * Get some information about the portal (version, ...). * @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 getPortalInformation(observe?: 'body', reportProgress?: boolean): Observable; public getPortalInformation(observe?: 'response', reportProgress?: boolean): Observable>; public getPortalInformation(observe?: 'events', reportProgress?: boolean): Observable>; public getPortalInformation(observe: any = 'body', reportProgress: boolean = false ): Observable { let headers = this.defaultHeaders; // to determine the Accept header const httpHeaderAccepts: string[] = [ 'application/json' ]; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.get(`${this.configuration.basePath}/info`, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * Get a View * Get a specific view. * @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 getViewByViewId(requestParameters: GetViewByViewIdRequestParams, observe?: 'body', reportProgress?: boolean): Observable; public getViewByViewId(requestParameters: GetViewByViewIdRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; public getViewByViewId(requestParameters: GetViewByViewIdRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; public getViewByViewId(requestParameters: GetViewByViewIdRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { const viewId = requestParameters.viewId; if (viewId === null || viewId === undefined) { throw new Error('Required parameter viewId was null or undefined when calling getViewByViewId.'); } let headers = this.defaultHeaders; // to determine the Accept header const httpHeaderAccepts: string[] = [ 'application/json' ]; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.get(`${this.configuration.basePath}/views/${encodeURIComponent(String(viewId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * Get a View list * Get all views of the platform. * @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 getViews(requestParameters: GetViewsRequestParams, observe?: 'body', reportProgress?: boolean): Observable; public getViews(requestParameters: GetViewsRequestParams, observe?: 'response', reportProgress?: boolean): Observable>; public getViews(requestParameters: GetViewsRequestParams, observe?: 'events', reportProgress?: boolean): Observable>; public getViews(requestParameters: GetViewsRequestParams, observe: any = 'body', reportProgress: boolean = false ): Observable { const page = requestParameters.page; const size = requestParameters.size; let queryParameters = new HttpParams({encoder: this.encoder}); if (page !== undefined && page !== null) { queryParameters = queryParameters.set('page', page); } if (size !== undefined && size !== null) { queryParameters = queryParameters.set('size', size); } let headers = this.defaultHeaders; // to determine the Accept header const httpHeaderAccepts: string[] = [ 'application/json' ]; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.get(`${this.configuration.basePath}/views`, { params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } }