/* tslint:disable */
/* eslint-disable */
/**
 * Vitron API
 * API documentation for Vitron backend
 *
 * The version of the OpenAPI document: v1
 * Contact: support@yourcompany.com
 *
 * 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 type {
  ServiceProduct,
  VectorSearchRequest,
} from '../models';

export interface ApiProductServiceV1SimilarCreateRequest {
    data: VectorSearchRequest;
}

/**
 * 
 */
export class ServiceProductApi extends runtime.BaseAPI {

    /**
     * POST /api/product/service/v1/similar/ Accepts a vector and returns up to 50 most similar products by cosine distance. Searches ONLY active products (is_active=True). Ranking is purely vector-based.
     * Vector similarity search (S2S, vector-only, active products only)
     */
    async apiProductServiceV1SimilarCreateRaw(requestParameters: ApiProductServiceV1SimilarCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ServiceProduct>>> {
        if (requestParameters.data === null || requestParameters.data === undefined) {
            throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProductServiceV1SimilarCreate.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
            headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
        }
        const response = await this.request({
            path: `/api/product/service/v1/similar/`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: requestParameters.data,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     * POST /api/product/service/v1/similar/ Accepts a vector and returns up to 50 most similar products by cosine distance. Searches ONLY active products (is_active=True). Ranking is purely vector-based.
     * Vector similarity search (S2S, vector-only, active products only)
     */
    async apiProductServiceV1SimilarCreate(requestParameters: ApiProductServiceV1SimilarCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ServiceProduct>> {
        const response = await this.apiProductServiceV1SimilarCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

}
