/* 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 {
  SimilarCollectionsCursorPage,
} from '../models';

export interface ApiCollectionV1CollectionsSimilarListRequest {
    collectionId: string;
    cursor?: string;
    pageSize?: number;
}

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

    /**
     * Returns public collections similar to the given collection.  Similarity is handled in the view by filtering candidates that overlap with the source via: - shared products - shared sellers - shared categories  Ordering is determined by the project\'s cursor paginator (created_at desc).
     * Similar collections (cursor-paginated)
     */
    async apiCollectionV1CollectionsSimilarListRaw(requestParameters: ApiCollectionV1CollectionsSimilarListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SimilarCollectionsCursorPage>> {
        if (requestParameters.collectionId === null || requestParameters.collectionId === undefined) {
            throw new runtime.RequiredError('collectionId','Required parameter requestParameters.collectionId was null or undefined when calling apiCollectionV1CollectionsSimilarList.');
        }

        const queryParameters: any = {};

        if (requestParameters.cursor !== undefined) {
            queryParameters['cursor'] = requestParameters.cursor;
        }

        if (requestParameters.pageSize !== undefined) {
            queryParameters['page_size'] = requestParameters.pageSize;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        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/collection/v1/collections/{collection_id}/similar/`.replace(`{${"collection_id"}}`, encodeURIComponent(String(requestParameters.collectionId))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     * Returns public collections similar to the given collection.  Similarity is handled in the view by filtering candidates that overlap with the source via: - shared products - shared sellers - shared categories  Ordering is determined by the project\'s cursor paginator (created_at desc).
     * Similar collections (cursor-paginated)
     */
    async apiCollectionV1CollectionsSimilarList(requestParameters: ApiCollectionV1CollectionsSimilarListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SimilarCollectionsCursorPage> {
        const response = await this.apiCollectionV1CollectionsSimilarListRaw(requestParameters, initOverrides);
        return await response.value();
    }

}
