283 lines
14 KiB
TypeScript
283 lines
14 KiB
TypeScript
/**
|
|
* Innovation Search Engine API
|
|
*
|
|
*
|
|
*
|
|
* 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 { AccessGrant } from '../model/accessGrant';
|
|
// @ts-ignore
|
|
import { BodyCreateUser } from '../model/bodyCreateUser';
|
|
// @ts-ignore
|
|
import { HTTPValidationError } from '../model/hTTPValidationError';
|
|
// @ts-ignore
|
|
import { IdentityGrant } from '../model/identityGrant';
|
|
// @ts-ignore
|
|
import { User } from '../model/user';
|
|
|
|
// @ts-ignore
|
|
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
|
|
import { Configuration } from '../configuration';
|
|
import { BaseService } from '../api.base.service';
|
|
|
|
|
|
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class INSEAccountServiceService extends BaseService {
|
|
|
|
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
|
|
super(basePath, configuration);
|
|
}
|
|
|
|
/**
|
|
* Create User
|
|
* @endpoint post /inse-account/create
|
|
* @param bodyCreateUser
|
|
* @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 createUser(bodyCreateUser: BodyCreateUser, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<User>;
|
|
public createUser(bodyCreateUser: BodyCreateUser, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<User>>;
|
|
public createUser(bodyCreateUser: BodyCreateUser, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<User>>;
|
|
public createUser(bodyCreateUser: BodyCreateUser, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
|
if (bodyCreateUser === null || bodyCreateUser === undefined) {
|
|
throw new Error('Required parameter bodyCreateUser was null or undefined when calling createUser.');
|
|
}
|
|
|
|
let localVarHeaders = this.defaultHeaders;
|
|
|
|
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 = `/inse-account/create`;
|
|
const { basePath, withCredentials } = this.configuration;
|
|
return this.httpClient.request<User>('post', `${basePath}${localVarPath}`,
|
|
{
|
|
context: localVarHttpContext,
|
|
body: bodyCreateUser,
|
|
responseType: <any>responseType_,
|
|
...(withCredentials ? { withCredentials } : {}),
|
|
headers: localVarHeaders,
|
|
observe: observe,
|
|
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Get Access Grant
|
|
* @endpoint post /inse-account/auth/access
|
|
* @param secret
|
|
* @param account
|
|
* @param organization
|
|
* @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 getAccessGrant(secret: string, account: number, organization: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<AccessGrant>;
|
|
public getAccessGrant(secret: string, account: number, organization: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<AccessGrant>>;
|
|
public getAccessGrant(secret: string, account: number, organization: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<AccessGrant>>;
|
|
public getAccessGrant(secret: string, account: number, organization: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
|
if (secret === null || secret === undefined) {
|
|
throw new Error('Required parameter secret was null or undefined when calling getAccessGrant.');
|
|
}
|
|
if (account === null || account === undefined) {
|
|
throw new Error('Required parameter account was null or undefined when calling getAccessGrant.');
|
|
}
|
|
if (organization === null || organization === undefined) {
|
|
throw new Error('Required parameter organization was null or undefined when calling getAccessGrant.');
|
|
}
|
|
|
|
let localVarHeaders = this.defaultHeaders;
|
|
|
|
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/x-www-form-urlencoded'
|
|
];
|
|
|
|
const canConsumeForm = this.canConsumeForm(consumes);
|
|
|
|
let localVarFormParams: { append(param: string, value: any): any; };
|
|
let localVarUseForm = false;
|
|
let localVarConvertFormParamsToString = false;
|
|
if (localVarUseForm) {
|
|
localVarFormParams = new FormData();
|
|
} else {
|
|
localVarFormParams = new HttpParams({encoder: this.encoder});
|
|
}
|
|
|
|
if (secret !== undefined) {
|
|
localVarFormParams = localVarFormParams.append('secret', <any>secret) as any || localVarFormParams;
|
|
}
|
|
if (account !== undefined) {
|
|
localVarFormParams = localVarFormParams.append('account', <any>account) as any || localVarFormParams;
|
|
}
|
|
if (organization !== undefined) {
|
|
localVarFormParams = localVarFormParams.append('organization', <any>organization) as any || localVarFormParams;
|
|
}
|
|
|
|
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 = `/inse-account/auth/access`;
|
|
const { basePath, withCredentials } = this.configuration;
|
|
return this.httpClient.request<AccessGrant>('post', `${basePath}${localVarPath}`,
|
|
{
|
|
context: localVarHttpContext,
|
|
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
|
|
responseType: <any>responseType_,
|
|
...(withCredentials ? { withCredentials } : {}),
|
|
headers: localVarHeaders,
|
|
observe: observe,
|
|
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Get Identity Grant
|
|
* @endpoint post /inse-account/auth/id
|
|
* @param username
|
|
* @param password
|
|
* @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 getIdentityGrant(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<IdentityGrant>;
|
|
public getIdentityGrant(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<IdentityGrant>>;
|
|
public getIdentityGrant(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<IdentityGrant>>;
|
|
public getIdentityGrant(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
|
if (username === null || username === undefined) {
|
|
throw new Error('Required parameter username was null or undefined when calling getIdentityGrant.');
|
|
}
|
|
if (password === null || password === undefined) {
|
|
throw new Error('Required parameter password was null or undefined when calling getIdentityGrant.');
|
|
}
|
|
|
|
let localVarHeaders = this.defaultHeaders;
|
|
|
|
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/x-www-form-urlencoded'
|
|
];
|
|
|
|
const canConsumeForm = this.canConsumeForm(consumes);
|
|
|
|
let localVarFormParams: { append(param: string, value: any): any; };
|
|
let localVarUseForm = false;
|
|
let localVarConvertFormParamsToString = false;
|
|
if (localVarUseForm) {
|
|
localVarFormParams = new FormData();
|
|
} else {
|
|
localVarFormParams = new HttpParams({encoder: this.encoder});
|
|
}
|
|
|
|
if (username !== undefined) {
|
|
localVarFormParams = localVarFormParams.append('username', <any>username) as any || localVarFormParams;
|
|
}
|
|
if (password !== undefined) {
|
|
localVarFormParams = localVarFormParams.append('password', <any>password) as any || localVarFormParams;
|
|
}
|
|
|
|
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 = `/inse-account/auth/id`;
|
|
const { basePath, withCredentials } = this.configuration;
|
|
return this.httpClient.request<IdentityGrant>('post', `${basePath}${localVarPath}`,
|
|
{
|
|
context: localVarHttpContext,
|
|
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
|
|
responseType: <any>responseType_,
|
|
...(withCredentials ? { withCredentials } : {}),
|
|
headers: localVarHeaders,
|
|
observe: observe,
|
|
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
}
|