/* 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 {
  HomeCategory,
  PaginatedProductHomepage,
  PublicHomeBanner,
  PublicHomeSellerTile,
} from '../models';

export interface ApiHomeV1DiscountsListRequest {
    cursor?: string;
    pageSize?: number;
}

export interface ApiHomeV1ForYouListRequest {
    cursor?: string;
    pageSize?: number;
    seed?: string;
    perSeller?: number;
    top?: number;
}

export interface ApiHomeV1TopSellersListRequest {
    cursor?: string;
    pageSize?: number;
    seed?: string;
    top?: number;
    perSeller?: number;
}

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

    /**
     * List all currently visible banners
     */
    async apiHomeV1BannersListRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<PublicHomeBanner>>> {
        const queryParameters: any = {};

        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/home/v1/banners/`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     * List all currently visible banners
     */
    async apiHomeV1BannersList(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<PublicHomeBanner>> {
        const response = await this.apiHomeV1BannersListRaw(initOverrides);
        return await response.value();
    }

    /**
     * Returns active homepage categories.
     * List homepage categories
     */
    async apiHomeV1CategoriesListRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<HomeCategory>>> {
        const queryParameters: any = {};

        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/home/v1/categories/`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     * Returns active homepage categories.
     * List homepage categories
     */
    async apiHomeV1CategoriesList(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<HomeCategory>> {
        const response = await this.apiHomeV1CategoriesListRaw(initOverrides);
        return await response.value();
    }

    /**
     * Best discounted products (cursor-paginated)
     */
    async apiHomeV1DiscountsListRaw(requestParameters: ApiHomeV1DiscountsListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedProductHomepage>> {
        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/home/v1/discounts/`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     * Best discounted products (cursor-paginated)
     */
    async apiHomeV1DiscountsList(requestParameters: ApiHomeV1DiscountsListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedProductHomepage> {
        const response = await this.apiHomeV1DiscountsListRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Personalized product recommendations (cursor-paginated, early-stage)
     */
    async apiHomeV1ForYouListRaw(requestParameters: ApiHomeV1ForYouListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedProductHomepage>> {
        const queryParameters: any = {};

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

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

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

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

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

        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/home/v1/for-you/`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     * Personalized product recommendations (cursor-paginated, early-stage)
     */
    async apiHomeV1ForYouList(requestParameters: ApiHomeV1ForYouListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedProductHomepage> {
        const response = await this.apiHomeV1ForYouListRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Returns all active seller tiles for the \'See more\' page. Only approved sellers are included.
     * List all homepage seller tiles (see more)
     */
    async apiHomeV1SellerTilesAllListRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<PublicHomeSellerTile>>> {
        const queryParameters: any = {};

        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/home/v1/seller-tiles/all/`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     * Returns all active seller tiles for the \'See more\' page. Only approved sellers are included.
     * List all homepage seller tiles (see more)
     */
    async apiHomeV1SellerTilesAllList(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<PublicHomeSellerTile>> {
        const response = await this.apiHomeV1SellerTilesAllListRaw(initOverrides);
        return await response.value();
    }

    /**
     * Returns the top 4 active seller tiles shown on the homepage. Only approved sellers are included.
     * List homepage seller tiles (top 4)
     */
    async apiHomeV1SellerTilesListRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<PublicHomeSellerTile>>> {
        const queryParameters: any = {};

        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/home/v1/seller-tiles/`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     * Returns the top 4 active seller tiles shown on the homepage. Only approved sellers are included.
     * List homepage seller tiles (top 4)
     */
    async apiHomeV1SellerTilesList(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<PublicHomeSellerTile>> {
        const response = await this.apiHomeV1SellerTilesListRaw(initOverrides);
        return await response.value();
    }

    /**
     * Products from top sellers (early-stage, cursor-paginated)
     */
    async apiHomeV1TopSellersListRaw(requestParameters: ApiHomeV1TopSellersListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedProductHomepage>> {
        const queryParameters: any = {};

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

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

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

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

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

        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/home/v1/top-sellers/`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     * Products from top sellers (early-stage, cursor-paginated)
     */
    async apiHomeV1TopSellersList(requestParameters: ApiHomeV1TopSellersListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedProductHomepage> {
        const response = await this.apiHomeV1TopSellersListRaw(requestParameters, initOverrides);
        return await response.value();
    }

}
