|
|
|
@@ -0,0 +1,275 @@
|
|
|
|
|
/**
|
|
|
|
|
* 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 { AuthorWorkPage } from '../model/authorWorkPage';
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
import { HTTPValidationError } from '../model/hTTPValidationError';
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
import { Institution } from '../model/institution';
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
import { SortDirection } from '../model/sortDirection';
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
import { WorkSortBy } from '../model/workSortBy';
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
import { WorkTopic } from '../model/workTopic';
|
|
|
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
|
|
|
|
|
import { Configuration } from '../configuration';
|
|
|
|
|
import { BaseService } from '../api.base.service';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Injectable({
|
|
|
|
|
providedIn: 'root'
|
|
|
|
|
})
|
|
|
|
|
export class WorksV2Service extends BaseService {
|
|
|
|
|
|
|
|
|
|
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
|
|
|
|
|
super(basePath, configuration);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a paginated list of works for a given author based on their ID.
|
|
|
|
|
* @endpoint get /api/v2/works/{raw_oa_author_id}
|
|
|
|
|
* @param rawOaAuthorId The raw OpenAlex author id.
|
|
|
|
|
* @param page The page number to retrieve. (0-based)
|
|
|
|
|
* @param size The number of works to retrieve per page.
|
|
|
|
|
* @param publicationYears A list of publication years to filter by.
|
|
|
|
|
* @param publicationTypes A list of publication types to filter by.
|
|
|
|
|
* @param institutionIds A list of institution IDs to filter by.
|
|
|
|
|
* @param topicIds A list of topic IDs to filter by.
|
|
|
|
|
* @param languageCodes A list of language codes to filter by.
|
|
|
|
|
* @param sortBy The field to sort by.
|
|
|
|
|
* @param sortOrder The order to sort by.
|
|
|
|
|
* @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 getAuthorWorkPage(rawOaAuthorId: string, page?: number, size?: number, publicationYears?: Array<number>, publicationTypes?: Array<string>, institutionIds?: Array<string>, topicIds?: Array<string>, languageCodes?: Array<string>, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<AuthorWorkPage>;
|
|
|
|
|
public getAuthorWorkPage(rawOaAuthorId: string, page?: number, size?: number, publicationYears?: Array<number>, publicationTypes?: Array<string>, institutionIds?: Array<string>, topicIds?: Array<string>, languageCodes?: Array<string>, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<AuthorWorkPage>>;
|
|
|
|
|
public getAuthorWorkPage(rawOaAuthorId: string, page?: number, size?: number, publicationYears?: Array<number>, publicationTypes?: Array<string>, institutionIds?: Array<string>, topicIds?: Array<string>, languageCodes?: Array<string>, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<AuthorWorkPage>>;
|
|
|
|
|
public getAuthorWorkPage(rawOaAuthorId: string, page?: number, size?: number, publicationYears?: Array<number>, publicationTypes?: Array<string>, institutionIds?: Array<string>, topicIds?: Array<string>, languageCodes?: Array<string>, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
|
|
|
|
if (rawOaAuthorId === null || rawOaAuthorId === undefined) {
|
|
|
|
|
throw new Error('Required parameter rawOaAuthorId was null or undefined when calling getAuthorWorkPage.');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
|
|
|
|
|
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
|
|
|
|
<any>page, 'page');
|
|
|
|
|
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
|
|
|
|
<any>size, 'size');
|
|
|
|
|
if (publicationYears) {
|
|
|
|
|
publicationYears.forEach((element) => {
|
|
|
|
|
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
|
|
|
|
<any>element, 'publication_years');
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (publicationTypes) {
|
|
|
|
|
publicationTypes.forEach((element) => {
|
|
|
|
|
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
|
|
|
|
<any>element, 'publication_types');
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (institutionIds) {
|
|
|
|
|
institutionIds.forEach((element) => {
|
|
|
|
|
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
|
|
|
|
<any>element, 'institution_ids');
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (topicIds) {
|
|
|
|
|
topicIds.forEach((element) => {
|
|
|
|
|
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
|
|
|
|
<any>element, 'topic_ids');
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (languageCodes) {
|
|
|
|
|
languageCodes.forEach((element) => {
|
|
|
|
|
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
|
|
|
|
<any>element, 'language_codes');
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
|
|
|
|
<any>sortBy, 'sort_by');
|
|
|
|
|
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
|
|
|
|
<any>sortOrder, 'sort_order');
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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/v2/works/${this.configuration.encodeParam({name: "rawOaAuthorId", value: rawOaAuthorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
|
|
|
|
|
const { basePath, withCredentials } = this.configuration;
|
|
|
|
|
return this.httpClient.request<AuthorWorkPage>('get', `${basePath}${localVarPath}`,
|
|
|
|
|
{
|
|
|
|
|
context: localVarHttpContext,
|
|
|
|
|
params: localVarQueryParameters,
|
|
|
|
|
responseType: <any>responseType_,
|
|
|
|
|
...(withCredentials ? { withCredentials } : {}),
|
|
|
|
|
headers: localVarHeaders,
|
|
|
|
|
observe: observe,
|
|
|
|
|
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
|
|
|
|
reportProgress: reportProgress
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a list of institutions based on their IDs.
|
|
|
|
|
* @endpoint get /api/v2/works/institutions/search
|
|
|
|
|
* @param institutionIds A list of institution IDs to retrieve.
|
|
|
|
|
* @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 getInstitutionsByIds(institutionIds?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<Institution>>;
|
|
|
|
|
public getInstitutionsByIds(institutionIds?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<Institution>>>;
|
|
|
|
|
public getInstitutionsByIds(institutionIds?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<Institution>>>;
|
|
|
|
|
public getInstitutionsByIds(institutionIds?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
|
|
|
|
|
|
|
|
|
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
|
|
|
|
|
if (institutionIds) {
|
|
|
|
|
institutionIds.forEach((element) => {
|
|
|
|
|
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
|
|
|
|
<any>element, 'institution_ids');
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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/v2/works/institutions/search`;
|
|
|
|
|
const { basePath, withCredentials } = this.configuration;
|
|
|
|
|
return this.httpClient.request<Array<Institution>>('get', `${basePath}${localVarPath}`,
|
|
|
|
|
{
|
|
|
|
|
context: localVarHttpContext,
|
|
|
|
|
params: localVarQueryParameters,
|
|
|
|
|
responseType: <any>responseType_,
|
|
|
|
|
...(withCredentials ? { withCredentials } : {}),
|
|
|
|
|
headers: localVarHeaders,
|
|
|
|
|
observe: observe,
|
|
|
|
|
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
|
|
|
|
reportProgress: reportProgress
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a list of work topics based on their IDs.
|
|
|
|
|
* @endpoint get /api/v2/works/topics/search
|
|
|
|
|
* @param topicIds A list of topic IDs to retrieve.
|
|
|
|
|
* @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 getWorkTopicsByIds(topicIds?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<WorkTopic>>;
|
|
|
|
|
public getWorkTopicsByIds(topicIds?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<WorkTopic>>>;
|
|
|
|
|
public getWorkTopicsByIds(topicIds?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<WorkTopic>>>;
|
|
|
|
|
public getWorkTopicsByIds(topicIds?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
|
|
|
|
|
|
|
|
|
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
|
|
|
|
|
if (topicIds) {
|
|
|
|
|
topicIds.forEach((element) => {
|
|
|
|
|
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
|
|
|
|
<any>element, 'topic_ids');
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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/v2/works/topics/search`;
|
|
|
|
|
const { basePath, withCredentials } = this.configuration;
|
|
|
|
|
return this.httpClient.request<Array<WorkTopic>>('get', `${basePath}${localVarPath}`,
|
|
|
|
|
{
|
|
|
|
|
context: localVarHttpContext,
|
|
|
|
|
params: localVarQueryParameters,
|
|
|
|
|
responseType: <any>responseType_,
|
|
|
|
|
...(withCredentials ? { withCredentials } : {}),
|
|
|
|
|
headers: localVarHeaders,
|
|
|
|
|
observe: observe,
|
|
|
|
|
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
|
|
|
|
reportProgress: reportProgress
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|