/* 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 {
  ApiCollectionV1UserCollectionsDelete200Response,
  ApiCollectionV1UserCollectionsProductsDelete200Response,
  ApiSellerV1SellersList200Response,
  OrderList,
  PaginatedExploreProduct,
  PaginatedSimilarProduct,
  ProductDetail,
  ProductGenerationResponse,
  SellerCourierUpdate,
  SellerFinancialReport,
  SellerFollower,
  TokenRefresh,
  TryOnRequestCreate,
  UserCollection,
  UserCollectionAddProducts,
} from '../models';

export interface ApiAifitV1TryOnCreateRequest {
    collectionId: string;
    image: Blob;
}

export interface ApiApgsV1PostsGenerateProductCreateRequest {
    id: string;
}

export interface ApiCollectionV1UserCollectionsCreateRequest {
    data: UserCollection;
}

export interface ApiCollectionV1UserCollectionsDeleteRequest {
    id: string;
}

export interface ApiCollectionV1UserCollectionsPartialUpdateRequest {
    id: string;
    data: UserCollection;
}

export interface ApiCollectionV1UserCollectionsProductsCreateRequest {
    id: string;
    data: UserCollectionAddProducts;
}

export interface ApiCollectionV1UserCollectionsProductsDeleteRequest {
    id: string;
    productId: string;
}

export interface ApiCollectionV1UserCollectionsReadRequest {
    id: string;
}

export interface ApiEngagementV1FollowersFollowersListRequest {
    sellerId: string;
}

export interface ApiExploreV1ListRequest {
    cursor?: string;
}

export interface ApiOrderV1SellerCouriersUpdateRequest {
    id: string;
    data: SellerCourierUpdate;
}

export interface ApiProductV1ProductsSimilarListRequest {
    id: string;
    cursor?: string;
    pageSize?: number;
    sameSellerOnly?: number;
    sameCategoryOnly?: number;
}

export interface ApiProductV1ProductsUpdateRequest {
    id: string;
    data: ProductDetail;
}

export interface ApiSellerV1SellersListRequest {
    category?: string;
    state?: string;
    city?: string;
    ordering?: string;
    search?: string;
    page?: number;
    pageSize?: number;
}

export interface ApiUserV1TokenRefreshCreateRequest {
    data: TokenRefresh;
}

export interface ApiWalletV1ReportListRequest {
    fromDate?: string;
    toDate?: string;
}

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

    /**
     * AI virtual try-on
     */
    async apiAifitV1TryOnCreateRaw(requestParameters: ApiAifitV1TryOnCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TryOnRequestCreate>> {
        if (requestParameters.collectionId === null || requestParameters.collectionId === undefined) {
            throw new runtime.RequiredError('collectionId','Required parameter requestParameters.collectionId was null or undefined when calling apiAifitV1TryOnCreate.');
        }

        if (requestParameters.image === null || requestParameters.image === undefined) {
            throw new runtime.RequiredError('image','Required parameter requestParameters.image was null or undefined when calling apiAifitV1TryOnCreate.');
        }

        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 consumes: runtime.Consume[] = [
            { contentType: 'multipart/form-data' },
        ];
        // @ts-ignore: canConsumeForm may be unused
        const canConsumeForm = runtime.canConsumeForm(consumes);

        let formParams: { append(param: string, value: any): any };
        let useForm = false;
        // use FormData to transmit files using content-type "multipart/form-data"
        useForm = canConsumeForm;
        if (useForm) {
            formParams = new FormData();
        } else {
            formParams = new URLSearchParams();
        }

        if (requestParameters.collectionId !== undefined) {
            formParams.append('collection_id', requestParameters.collectionId as any);
        }

        if (requestParameters.image !== undefined) {
            formParams.append('image', requestParameters.image as any);
        }

        const response = await this.request({
            path: `/api/aifit/v1/try-on/`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: formParams,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     * AI virtual try-on
     */
    async apiAifitV1TryOnCreate(requestParameters: ApiAifitV1TryOnCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TryOnRequestCreate> {
        const response = await this.apiAifitV1TryOnCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Generate product info from Instagram post
     */
    async apiApgsV1PostsGenerateProductCreateRaw(requestParameters: ApiApgsV1PostsGenerateProductCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProductGenerationResponse>> {
        if (requestParameters.id === null || requestParameters.id === undefined) {
            throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiApgsV1PostsGenerateProductCreate.');
        }

        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/apgs/v1/posts/{id}/generate-product/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     * Generate product info from Instagram post
     */
    async apiApgsV1PostsGenerateProductCreate(requestParameters: ApiApgsV1PostsGenerateProductCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProductGenerationResponse> {
        const response = await this.apiApgsV1PostsGenerateProductCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * - GET  /user/collections/      → list current user\'s collections - POST /user/collections/      → create a new collection (must have at least 1 product)
     * Create a new user collection
     */
    async apiCollectionV1UserCollectionsCreateRaw(requestParameters: ApiCollectionV1UserCollectionsCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserCollection>> {
        if (requestParameters.data === null || requestParameters.data === undefined) {
            throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiCollectionV1UserCollectionsCreate.');
        }

        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/collection/v1/user/collections/`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: requestParameters.data,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     * - GET  /user/collections/      → list current user\'s collections - POST /user/collections/      → create a new collection (must have at least 1 product)
     * Create a new user collection
     */
    async apiCollectionV1UserCollectionsCreate(requestParameters: ApiCollectionV1UserCollectionsCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserCollection> {
        const response = await this.apiCollectionV1UserCollectionsCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * - GET    /user/collections/<id>/   → retrieve - PATCH  /user/collections/<id>/   → update (title/description/products) - DELETE /user/collections/<id>/   → delete collection
     * Delete a user collection
     */
    async apiCollectionV1UserCollectionsDeleteRaw(requestParameters: ApiCollectionV1UserCollectionsDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApiCollectionV1UserCollectionsDelete200Response>> {
        if (requestParameters.id === null || requestParameters.id === undefined) {
            throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiCollectionV1UserCollectionsDelete.');
        }

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

        return new runtime.JSONApiResponse(response);
    }

    /**
     * - GET    /user/collections/<id>/   → retrieve - PATCH  /user/collections/<id>/   → update (title/description/products) - DELETE /user/collections/<id>/   → delete collection
     * Delete a user collection
     */
    async apiCollectionV1UserCollectionsDelete(requestParameters: ApiCollectionV1UserCollectionsDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiCollectionV1UserCollectionsDelete200Response> {
        const response = await this.apiCollectionV1UserCollectionsDeleteRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * - GET  /user/collections/      → list current user\'s collections - POST /user/collections/      → create a new collection (must have at least 1 product)
     * List user\'s collections
     */
    async apiCollectionV1UserCollectionsListRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<UserCollection>>> {
        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/collection/v1/user/collections/`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     * - GET  /user/collections/      → list current user\'s collections - POST /user/collections/      → create a new collection (must have at least 1 product)
     * List user\'s collections
     */
    async apiCollectionV1UserCollectionsList(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<UserCollection>> {
        const response = await this.apiCollectionV1UserCollectionsListRaw(initOverrides);
        return await response.value();
    }

    /**
     * No void response: always return updated collection or deletion info if it\'s auto-deleted because empty.
     * Partially update a user collection
     */
    async apiCollectionV1UserCollectionsPartialUpdateRaw(requestParameters: ApiCollectionV1UserCollectionsPartialUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserCollection>> {
        if (requestParameters.id === null || requestParameters.id === undefined) {
            throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiCollectionV1UserCollectionsPartialUpdate.');
        }

        if (requestParameters.data === null || requestParameters.data === undefined) {
            throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiCollectionV1UserCollectionsPartialUpdate.');
        }

        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/collection/v1/user/collections/{id}/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
            method: 'PATCH',
            headers: headerParameters,
            query: queryParameters,
            body: requestParameters.data,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     * No void response: always return updated collection or deletion info if it\'s auto-deleted because empty.
     * Partially update a user collection
     */
    async apiCollectionV1UserCollectionsPartialUpdate(requestParameters: ApiCollectionV1UserCollectionsPartialUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserCollection> {
        const response = await this.apiCollectionV1UserCollectionsPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * - POST /user/collections/<id>/products/   Body:   {     \"product_ids\": [\"uuid1\", \"uuid2\"]   }  Adds products to an existing collection and returns the updated collection.
     * Add products to a user collection
     */
    async apiCollectionV1UserCollectionsProductsCreateRaw(requestParameters: ApiCollectionV1UserCollectionsProductsCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserCollection>> {
        if (requestParameters.id === null || requestParameters.id === undefined) {
            throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiCollectionV1UserCollectionsProductsCreate.');
        }

        if (requestParameters.data === null || requestParameters.data === undefined) {
            throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiCollectionV1UserCollectionsProductsCreate.');
        }

        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/collection/v1/user/collections/{id}/products/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: requestParameters.data,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     * - POST /user/collections/<id>/products/   Body:   {     \"product_ids\": [\"uuid1\", \"uuid2\"]   }  Adds products to an existing collection and returns the updated collection.
     * Add products to a user collection
     */
    async apiCollectionV1UserCollectionsProductsCreate(requestParameters: ApiCollectionV1UserCollectionsProductsCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserCollection> {
        const response = await this.apiCollectionV1UserCollectionsProductsCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * - DELETE /user/collections/<id>/products/<product_id>/  Removes a product from a collection. If it was the last product, the collection is auto-deleted.
     * Remove a product from a user collection
     */
    async apiCollectionV1UserCollectionsProductsDeleteRaw(requestParameters: ApiCollectionV1UserCollectionsProductsDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApiCollectionV1UserCollectionsProductsDelete200Response>> {
        if (requestParameters.id === null || requestParameters.id === undefined) {
            throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiCollectionV1UserCollectionsProductsDelete.');
        }

        if (requestParameters.productId === null || requestParameters.productId === undefined) {
            throw new runtime.RequiredError('productId','Required parameter requestParameters.productId was null or undefined when calling apiCollectionV1UserCollectionsProductsDelete.');
        }

        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/collection/v1/user/collections/{id}/products/{product_id}/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"product_id"}}`, encodeURIComponent(String(requestParameters.productId))),
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     * - DELETE /user/collections/<id>/products/<product_id>/  Removes a product from a collection. If it was the last product, the collection is auto-deleted.
     * Remove a product from a user collection
     */
    async apiCollectionV1UserCollectionsProductsDelete(requestParameters: ApiCollectionV1UserCollectionsProductsDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiCollectionV1UserCollectionsProductsDelete200Response> {
        const response = await this.apiCollectionV1UserCollectionsProductsDeleteRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * - GET    /user/collections/<id>/   → retrieve - PATCH  /user/collections/<id>/   → update (title/description/products) - DELETE /user/collections/<id>/   → delete collection
     * Get a user collection
     */
    async apiCollectionV1UserCollectionsReadRaw(requestParameters: ApiCollectionV1UserCollectionsReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserCollection>> {
        if (requestParameters.id === null || requestParameters.id === undefined) {
            throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiCollectionV1UserCollectionsRead.');
        }

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

        return new runtime.JSONApiResponse(response);
    }

    /**
     * - GET    /user/collections/<id>/   → retrieve - PATCH  /user/collections/<id>/   → update (title/description/products) - DELETE /user/collections/<id>/   → delete collection
     * Get a user collection
     */
    async apiCollectionV1UserCollectionsRead(requestParameters: ApiCollectionV1UserCollectionsReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserCollection> {
        const response = await this.apiCollectionV1UserCollectionsReadRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async apiEngagementV1FollowersFollowersListRaw(requestParameters: ApiEngagementV1FollowersFollowersListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<SellerFollower>>> {
        if (requestParameters.sellerId === null || requestParameters.sellerId === undefined) {
            throw new runtime.RequiredError('sellerId','Required parameter requestParameters.sellerId was null or undefined when calling apiEngagementV1FollowersFollowersList.');
        }

        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/engagement/v1/followers/followers/{seller_id}`.replace(`{${"seller_id"}}`, encodeURIComponent(String(requestParameters.sellerId))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     */
    async apiEngagementV1FollowersFollowersList(requestParameters: ApiEngagementV1FollowersFollowersListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<SellerFollower>> {
        const response = await this.apiEngagementV1FollowersFollowersListRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * List random products for explore page
     */
    async apiExploreV1ListRaw(requestParameters: ApiExploreV1ListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedExploreProduct>> {
        const queryParameters: any = {};

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

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

        return new runtime.JSONApiResponse(response);
    }

    /**
     * List random products for explore page
     */
    async apiExploreV1List(requestParameters: ApiExploreV1ListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedExploreProduct> {
        const response = await this.apiExploreV1ListRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async apiOrderV1OrdersListRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<OrderList>>> {
        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/order/v1/orders/`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     */
    async apiOrderV1OrdersList(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<OrderList>> {
        const response = await this.apiOrderV1OrdersListRaw(initOverrides);
        return await response.value();
    }

    /**
     */
    async apiOrderV1SellerCouriersUpdateRaw(requestParameters: ApiOrderV1SellerCouriersUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SellerCourierUpdate>> {
        if (requestParameters.id === null || requestParameters.id === undefined) {
            throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiOrderV1SellerCouriersUpdate.');
        }

        if (requestParameters.data === null || requestParameters.data === undefined) {
            throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiOrderV1SellerCouriersUpdate.');
        }

        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/order/v1/seller-couriers/{id}/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: requestParameters.data,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     */
    async apiOrderV1SellerCouriersUpdate(requestParameters: ApiOrderV1SellerCouriersUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SellerCourierUpdate> {
        const response = await this.apiOrderV1SellerCouriersUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Returns products similar to the given product (by UUID). Similarity scoring (simple): +2 same category, +1 same seller. Ordered by score, then newest.  Query params: - `same_seller_only=1` → restrict to same seller - `same_category_only=1` → restrict to same category - `pageSize` (default 12, max 50) - `cursor` (opaque token from `next`/`previous`) 
     * Similar products (cursor-paginated)
     */
    async apiProductV1ProductsSimilarListRaw(requestParameters: ApiProductV1ProductsSimilarListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedSimilarProduct>> {
        if (requestParameters.id === null || requestParameters.id === undefined) {
            throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiProductV1ProductsSimilarList.');
        }

        const queryParameters: any = {};

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

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

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

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

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

        return new runtime.JSONApiResponse(response);
    }

    /**
     * Returns products similar to the given product (by UUID). Similarity scoring (simple): +2 same category, +1 same seller. Ordered by score, then newest.  Query params: - `same_seller_only=1` → restrict to same seller - `same_category_only=1` → restrict to same category - `pageSize` (default 12, max 50) - `cursor` (opaque token from `next`/`previous`) 
     * Similar products (cursor-paginated)
     */
    async apiProductV1ProductsSimilarList(requestParameters: ApiProductV1ProductsSimilarListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedSimilarProduct> {
        const response = await this.apiProductV1ProductsSimilarListRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async apiProductV1ProductsUpdateRaw(requestParameters: ApiProductV1ProductsUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProductDetail>> {
        if (requestParameters.id === null || requestParameters.id === undefined) {
            throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiProductV1ProductsUpdate.');
        }

        if (requestParameters.data === null || requestParameters.data === undefined) {
            throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProductV1ProductsUpdate.');
        }

        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/v1/products/{id}/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: requestParameters.data,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     */
    async apiProductV1ProductsUpdate(requestParameters: ApiProductV1ProductsUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProductDetail> {
        const response = await this.apiProductV1ProductsUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * List all approved sellers with pagination and filters (Only GET).
     */
    async apiSellerV1SellersListRaw(requestParameters: ApiSellerV1SellersListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApiSellerV1SellersList200Response>> {
        const queryParameters: any = {};

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

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

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

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

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

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

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

        return new runtime.JSONApiResponse(response);
    }

    /**
     * List all approved sellers with pagination and filters (Only GET).
     */
    async apiSellerV1SellersList(requestParameters: ApiSellerV1SellersListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiSellerV1SellersList200Response> {
        const response = await this.apiSellerV1SellersListRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Refresh JWT access token.
     */
    async apiUserV1TokenRefreshCreateRaw(requestParameters: ApiUserV1TokenRefreshCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TokenRefresh>> {
        if (requestParameters.data === null || requestParameters.data === undefined) {
            throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiUserV1TokenRefreshCreate.');
        }

        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/user/v1/token/refresh/`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: requestParameters.data,
        }, initOverrides);

        return new runtime.JSONApiResponse(response);
    }

    /**
     * Refresh JWT access token.
     */
    async apiUserV1TokenRefreshCreate(requestParameters: ApiUserV1TokenRefreshCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TokenRefresh> {
        const response = await this.apiUserV1TokenRefreshCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Returns total net sales, settled payouts, and pending payout amounts. Supports optional from_date and to_date filters.
     * Get seller financial report
     */
    async apiWalletV1ReportListRaw(requestParameters: ApiWalletV1ReportListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SellerFinancialReport>> {
        const queryParameters: any = {};

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

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

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

        return new runtime.JSONApiResponse(response);
    }

    /**
     * Returns total net sales, settled payouts, and pending payout amounts. Supports optional from_date and to_date filters.
     * Get seller financial report
     */
    async apiWalletV1ReportList(requestParameters: ApiWalletV1ReportListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SellerFinancialReport> {
        const response = await this.apiWalletV1ReportListRaw(requestParameters, initOverrides);
        return await response.value();
    }

}
