405 lines
12 KiB
TypeScript
405 lines
12 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 { CreatePersonBookmark } from '../model/createPersonBookmark';
|
|
// @ts-ignore
|
|
import { HTTPValidationError } from '../model/hTTPValidationError';
|
|
// @ts-ignore
|
|
import { PersonBookmarkResponse } from '../model/personBookmarkResponse';
|
|
|
|
// @ts-ignore
|
|
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
|
|
import { Configuration } from '../configuration';
|
|
import { BaseService } from '../api.base.service';
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class BookmarksService extends BaseService {
|
|
constructor(
|
|
protected httpClient: HttpClient,
|
|
@Optional() @Inject(BASE_PATH) basePath: string | string[],
|
|
@Optional() configuration?: Configuration,
|
|
) {
|
|
super(basePath, configuration);
|
|
}
|
|
|
|
/**
|
|
* Bookmark Person
|
|
* @endpoint put /api/bookmarks/persons/{person_id}
|
|
* @param personId
|
|
* @param createPersonBookmark
|
|
* @param secureFgpAcc
|
|
* @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 bookmarkPerson(
|
|
personId: string,
|
|
createPersonBookmark: CreatePersonBookmark,
|
|
secureFgpAcc?: string,
|
|
observe?: 'body',
|
|
reportProgress?: boolean,
|
|
options?: {
|
|
httpHeaderAccept?: 'application/json';
|
|
context?: HttpContext;
|
|
transferCache?: boolean;
|
|
},
|
|
): Observable<PersonBookmarkResponse>;
|
|
public bookmarkPerson(
|
|
personId: string,
|
|
createPersonBookmark: CreatePersonBookmark,
|
|
secureFgpAcc?: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean,
|
|
options?: {
|
|
httpHeaderAccept?: 'application/json';
|
|
context?: HttpContext;
|
|
transferCache?: boolean;
|
|
},
|
|
): Observable<HttpResponse<PersonBookmarkResponse>>;
|
|
public bookmarkPerson(
|
|
personId: string,
|
|
createPersonBookmark: CreatePersonBookmark,
|
|
secureFgpAcc?: string,
|
|
observe?: 'events',
|
|
reportProgress?: boolean,
|
|
options?: {
|
|
httpHeaderAccept?: 'application/json';
|
|
context?: HttpContext;
|
|
transferCache?: boolean;
|
|
},
|
|
): Observable<HttpEvent<PersonBookmarkResponse>>;
|
|
public bookmarkPerson(
|
|
personId: string,
|
|
createPersonBookmark: CreatePersonBookmark,
|
|
secureFgpAcc?: string,
|
|
observe: any = 'body',
|
|
reportProgress: boolean = false,
|
|
options?: {
|
|
httpHeaderAccept?: 'application/json';
|
|
context?: HttpContext;
|
|
transferCache?: boolean;
|
|
},
|
|
): Observable<any> {
|
|
if (personId === null || personId === undefined) {
|
|
throw new Error(
|
|
'Required parameter personId was null or undefined when calling bookmarkPerson.',
|
|
);
|
|
}
|
|
if (createPersonBookmark === null || createPersonBookmark === undefined) {
|
|
throw new Error(
|
|
'Required parameter createPersonBookmark was null or undefined when calling bookmarkPerson.',
|
|
);
|
|
}
|
|
|
|
let localVarHeaders = this.defaultHeaders;
|
|
|
|
// authentication (HTTPBearer) required
|
|
localVarHeaders = this.configuration.addCredentialToHeaders(
|
|
'HTTPBearer',
|
|
'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 = `/api/bookmarks/persons/${this.configuration.encodeParam({ name: 'personId', value: personId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`;
|
|
const { basePath, withCredentials } = this.configuration;
|
|
return this.httpClient.request<PersonBookmarkResponse>(
|
|
'put',
|
|
`${basePath}${localVarPath}`,
|
|
{
|
|
context: localVarHttpContext,
|
|
body: createPersonBookmark,
|
|
responseType: <any>responseType_,
|
|
...(withCredentials ? { withCredentials } : {}),
|
|
headers: localVarHeaders,
|
|
observe: observe,
|
|
...(localVarTransferCache !== undefined
|
|
? { transferCache: localVarTransferCache }
|
|
: {}),
|
|
reportProgress: reportProgress,
|
|
},
|
|
);
|
|
}
|
|
|
|
/**
|
|
* List Person Bookmarks
|
|
* @endpoint get /api/bookmarks/persons
|
|
* @param secureFgpAcc
|
|
* @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 listPersonBookmarks(
|
|
secureFgpAcc?: string,
|
|
observe?: 'body',
|
|
reportProgress?: boolean,
|
|
options?: {
|
|
httpHeaderAccept?: 'application/json';
|
|
context?: HttpContext;
|
|
transferCache?: boolean;
|
|
},
|
|
): Observable<Array<PersonBookmarkResponse>>;
|
|
public listPersonBookmarks(
|
|
secureFgpAcc?: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean,
|
|
options?: {
|
|
httpHeaderAccept?: 'application/json';
|
|
context?: HttpContext;
|
|
transferCache?: boolean;
|
|
},
|
|
): Observable<HttpResponse<Array<PersonBookmarkResponse>>>;
|
|
public listPersonBookmarks(
|
|
secureFgpAcc?: string,
|
|
observe?: 'events',
|
|
reportProgress?: boolean,
|
|
options?: {
|
|
httpHeaderAccept?: 'application/json';
|
|
context?: HttpContext;
|
|
transferCache?: boolean;
|
|
},
|
|
): Observable<HttpEvent<Array<PersonBookmarkResponse>>>;
|
|
public listPersonBookmarks(
|
|
secureFgpAcc?: string,
|
|
observe: any = 'body',
|
|
reportProgress: boolean = false,
|
|
options?: {
|
|
httpHeaderAccept?: 'application/json';
|
|
context?: HttpContext;
|
|
transferCache?: boolean;
|
|
},
|
|
): Observable<any> {
|
|
let localVarHeaders = this.defaultHeaders;
|
|
|
|
// authentication (HTTPBearer) required
|
|
localVarHeaders = this.configuration.addCredentialToHeaders(
|
|
'HTTPBearer',
|
|
'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 = `/api/bookmarks/persons`;
|
|
const { basePath, withCredentials } = this.configuration;
|
|
return this.httpClient.request<Array<PersonBookmarkResponse>>(
|
|
'get',
|
|
`${basePath}${localVarPath}`,
|
|
{
|
|
context: localVarHttpContext,
|
|
responseType: <any>responseType_,
|
|
...(withCredentials ? { withCredentials } : {}),
|
|
headers: localVarHeaders,
|
|
observe: observe,
|
|
...(localVarTransferCache !== undefined
|
|
? { transferCache: localVarTransferCache }
|
|
: {}),
|
|
reportProgress: reportProgress,
|
|
},
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Remove Person Bookmark
|
|
* @endpoint delete /api/bookmarks/persons/{person_id}
|
|
* @param personId
|
|
* @param secureFgpAcc
|
|
* @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 removePersonBookmark(
|
|
personId: string,
|
|
secureFgpAcc?: string,
|
|
observe?: 'body',
|
|
reportProgress?: boolean,
|
|
options?: {
|
|
httpHeaderAccept?: 'application/json';
|
|
context?: HttpContext;
|
|
transferCache?: boolean;
|
|
},
|
|
): Observable<any>;
|
|
public removePersonBookmark(
|
|
personId: string,
|
|
secureFgpAcc?: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean,
|
|
options?: {
|
|
httpHeaderAccept?: 'application/json';
|
|
context?: HttpContext;
|
|
transferCache?: boolean;
|
|
},
|
|
): Observable<HttpResponse<any>>;
|
|
public removePersonBookmark(
|
|
personId: string,
|
|
secureFgpAcc?: string,
|
|
observe?: 'events',
|
|
reportProgress?: boolean,
|
|
options?: {
|
|
httpHeaderAccept?: 'application/json';
|
|
context?: HttpContext;
|
|
transferCache?: boolean;
|
|
},
|
|
): Observable<HttpEvent<any>>;
|
|
public removePersonBookmark(
|
|
personId: string,
|
|
secureFgpAcc?: string,
|
|
observe: any = 'body',
|
|
reportProgress: boolean = false,
|
|
options?: {
|
|
httpHeaderAccept?: 'application/json';
|
|
context?: HttpContext;
|
|
transferCache?: boolean;
|
|
},
|
|
): Observable<any> {
|
|
if (personId === null || personId === undefined) {
|
|
throw new Error(
|
|
'Required parameter personId was null or undefined when calling removePersonBookmark.',
|
|
);
|
|
}
|
|
|
|
let localVarHeaders = this.defaultHeaders;
|
|
|
|
// authentication (HTTPBearer) required
|
|
localVarHeaders = this.configuration.addCredentialToHeaders(
|
|
'HTTPBearer',
|
|
'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 = `/api/bookmarks/persons/${this.configuration.encodeParam({ name: 'personId', value: personId, 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,
|
|
...(localVarTransferCache !== undefined
|
|
? { transferCache: localVarTransferCache }
|
|
: {}),
|
|
reportProgress: reportProgress,
|
|
},
|
|
);
|
|
}
|
|
}
|