/* tslint:disable */
/* eslint-disable */
/**
 * Synapse REST API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: v1
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
import * as runtime from '../runtime';
import { QuerySearchQueryToJSON, SearchResultsFromJSON, SuggestionQueryToJSON, SuggestionResultsFromJSON, } from '../models/index';
/**
 *
 */
export class SearchServicesApi extends runtime.BaseAPI {
    /**
     */
    async postRepoV1SearchRaw(requestParameters, initOverrides) {
        if (requestParameters['querySearchQuery'] == null) {
            throw new runtime.RequiredError('querySearchQuery', 'Required parameter "querySearchQuery" was null or undefined when calling postRepoV1Search().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/search`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: QuerySearchQueryToJSON(requestParameters['querySearchQuery']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => SearchResultsFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1Search(requestParameters, initOverrides) {
        const response = await this.postRepoV1SearchRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1SuggestionRaw(requestParameters, initOverrides) {
        if (requestParameters['suggestionQuery'] == null) {
            throw new runtime.RequiredError('suggestionQuery', 'Required parameter "suggestionQuery" was null or undefined when calling postRepoV1Suggestion().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/suggestion`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: SuggestionQueryToJSON(requestParameters['suggestionQuery']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => SuggestionResultsFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1Suggestion(requestParameters, initOverrides) {
        const response = await this.postRepoV1SuggestionRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
//# sourceMappingURL=SearchServicesApi.js.map