// This file is auto-generated by @hey-api/openapi-ts

import {
    formDataBodySerializer,
    type Client,
    type Options as ClientOptions,
    type TDataShape,
} from "./client";
import { client as _heyApiClient } from "./client.gen";
import type {
    AddAttributeToModuleData,
    AddAttributeToModuleErrors,
    AddAttributeToModuleResponses,
    AddKitToDealData,
    AddKitToDealErrors,
    AddKitToDealProductData,
    AddKitToDealProductErrors,
    AddKitToDealProductResponses,
    AddKitToDealResponses,
    CreateAttributeData,
    CreateAttributeErrors,
    CreateAttributeResponses,
    CreateBarcodeTemplateData,
    CreateBarcodeTemplateErrors,
    CreateBarcodeTemplateResponses,
    CreateBoardData,
    CreateBoardErrors,
    CreateBoardResponses,
    CreateClientData,
    CreateClientErrors,
    CreateClientResponses,
    CreateDealData,
    CreateDealErrors,
    CreateDealGroupData,
    CreateDealGroupErrors,
    CreateDealGroupResponses,
    CreateDealProductData,
    CreateDealProductErrors,
    CreateDealProductResponses,
    CreateDealProductServiceData,
    CreateDealProductServiceErrors,
    CreateDealProductServiceResponses,
    CreateDealResponses,
    CreateDealServiceData,
    CreateDealServiceErrors,
    CreateDealServiceResponses,
    CreateDealTagData,
    CreateDealTagErrors,
    CreateDealTagResponses,
    CreateMarketplaceData,
    CreateMarketplaceErrors,
    CreateMarketplaceResponses,
    CreateModuleData,
    CreateModuleErrors,
    CreateModuleResponses,
    CreateProductData,
    CreateProductErrors,
    CreateProductResponses,
    CreateProjectData,
    CreateProjectErrors,
    CreateProjectResponses,
    CreateServiceCategoryData,
    CreateServiceCategoryErrors,
    CreateServiceCategoryResponses,
    CreateServiceData,
    CreateServiceErrors,
    CreateServiceResponses,
    CreateServicesKitData,
    CreateServicesKitErrors,
    CreateServicesKitResponses,
    CreateStatusData,
    CreateStatusErrors,
    CreateStatusResponses,
    DeleteAttributeData,
    DeleteAttributeErrors,
    DeleteAttributeResponses,
    DeleteBarcodeTemplateData,
    DeleteBarcodeTemplateErrors,
    DeleteBarcodeTemplateResponses,
    DeleteBoardData,
    DeleteBoardErrors,
    DeleteBoardResponses,
    DeleteClientData,
    DeleteClientErrors,
    DeleteClientResponses,
    DeleteDealData,
    DeleteDealErrors,
    DeleteDealGroupData,
    DeleteDealGroupErrors,
    DeleteDealGroupResponses,
    DeleteDealProductData,
    DeleteDealProductErrors,
    DeleteDealProductResponses,
    DeleteDealProductServiceData,
    DeleteDealProductServiceErrors,
    DeleteDealProductServiceResponses,
    DeleteDealResponses,
    DeleteDealServiceData,
    DeleteDealServiceErrors,
    DeleteDealServiceResponses,
    DeleteDealTagData,
    DeleteDealTagErrors,
    DeleteDealTagResponses,
    DeleteMarketplaceData,
    DeleteMarketplaceErrors,
    DeleteMarketplaceResponses,
    DeleteModuleData,
    DeleteModuleErrors,
    DeleteModuleResponses,
    DeleteProductBarcodeImageData,
    DeleteProductBarcodeImageErrors,
    DeleteProductBarcodeImageResponses,
    DeleteProductData,
    DeleteProductErrors,
    DeleteProductResponses,
    DeleteProjectData,
    DeleteProjectErrors,
    DeleteProjectResponses,
    DeleteServiceCategoryData,
    DeleteServiceCategoryErrors,
    DeleteServiceCategoryResponses,
    DeleteServiceData,
    DeleteServiceErrors,
    DeleteServiceResponses,
    DeleteServicesKitData,
    DeleteServicesKitErrors,
    DeleteServicesKitResponses,
    DeleteStatusData,
    DeleteStatusErrors,
    DeleteStatusResponses,
    DuplicateProductServicesData,
    DuplicateProductServicesErrors,
    DuplicateProductServicesResponses,
    GetAttributesData,
    GetAttributesResponses,
    GetAttributeTypesData,
    GetAttributeTypesResponses,
    GetAttrSelectOptionsData,
    GetAttrSelectOptionsErrors,
    GetAttrSelectOptionsResponses,
    GetAttrSelectsData,
    GetAttrSelectsResponses,
    GetBarcodeTemplateAttributesData,
    GetBarcodeTemplateAttributesResponses,
    GetBarcodeTemplatesData,
    GetBarcodeTemplateSizesData,
    GetBarcodeTemplateSizesResponses,
    GetBarcodeTemplatesResponses,
    GetBaseMarketplacesData,
    GetBaseMarketplacesResponses,
    GetBoardsData,
    GetBoardsErrors,
    GetBoardsResponses,
    GetClientsData,
    GetClientsErrors,
    GetClientsResponses,
    GetDealBarcodesPdfData,
    GetDealBarcodesPdfErrors,
    GetDealBarcodesPdfResponses,
    GetDealModuleAttributesData,
    GetDealModuleAttributesErrors,
    GetDealModuleAttributesResponses,
    GetDealProductsData,
    GetDealProductsErrors,
    GetDealProductsResponses,
    GetDealsData,
    GetDealsErrors,
    GetDealServicesData,
    GetDealServicesErrors,
    GetDealServicesResponses,
    GetDealsResponses,
    GetDealTagColorsData,
    GetDealTagColorsResponses,
    GetDealTagsData,
    GetDealTagsErrors,
    GetDealTagsResponses,
    GetMarketplacesData,
    GetMarketplacesErrors,
    GetMarketplacesResponses,
    GetModulesData,
    GetModulesResponses,
    GetModulesWithAttributesData,
    GetModulesWithAttributesResponses,
    GetModuleWithAttributesData,
    GetModuleWithAttributesErrors,
    GetModuleWithAttributesResponses,
    GetProductBarcodePdfData,
    GetProductBarcodePdfErrors,
    GetProductBarcodePdfResponses,
    GetProductsData,
    GetProductsErrors,
    GetProductsResponses,
    GetProjectsData,
    GetProjectsResponses,
    GetServiceCategoriesData,
    GetServiceCategoriesResponses,
    GetServicesData,
    GetServicesKitsData,
    GetServicesKitsResponses,
    GetServicesResponses,
    GetStatusesData,
    GetStatusesErrors,
    GetStatusesResponses,
    GetStatusHistoryData,
    GetStatusHistoryErrors,
    GetStatusHistoryResponses,
    RemoveAttributeFromModuleData,
    RemoveAttributeFromModuleErrors,
    RemoveAttributeFromModuleResponses,
    SwitchDealTagData,
    SwitchDealTagErrors,
    SwitchDealTagResponses,
    UpdateAttributeData,
    UpdateAttributeErrors,
    UpdateAttributeLabelData,
    UpdateAttributeLabelErrors,
    UpdateAttributeLabelResponses,
    UpdateAttributeResponses,
    UpdateBarcodeTemplateData,
    UpdateBarcodeTemplateErrors,
    UpdateBarcodeTemplateResponses,
    UpdateBoardData,
    UpdateBoardErrors,
    UpdateBoardResponses,
    UpdateClientData,
    UpdateClientErrors,
    UpdateClientResponses,
    UpdateDealData,
    UpdateDealErrors,
    UpdateDealGroupData,
    UpdateDealGroupErrors,
    UpdateDealGroupResponses,
    UpdateDealModuleAttributesData,
    UpdateDealModuleAttributesErrors,
    UpdateDealModuleAttributesResponses,
    UpdateDealProductData,
    UpdateDealProductErrors,
    UpdateDealProductResponses,
    UpdateDealProductServiceData,
    UpdateDealProductServiceErrors,
    UpdateDealProductServiceResponses,
    UpdateDealResponses,
    UpdateDealServiceData,
    UpdateDealServiceErrors,
    UpdateDealServiceResponses,
    UpdateDealsInGroupData,
    UpdateDealsInGroupErrors,
    UpdateDealsInGroupResponses,
    UpdateDealTagData,
    UpdateDealTagErrors,
    UpdateDealTagResponses,
    UpdateMarketplaceData,
    UpdateMarketplaceErrors,
    UpdateMarketplaceResponses,
    UpdateModuleData,
    UpdateModuleErrors,
    UpdateModuleResponses,
    UpdateProductData,
    UpdateProductErrors,
    UpdateProductResponses,
    UpdateProjectData,
    UpdateProjectErrors,
    UpdateProjectResponses,
    UpdateServiceCategoryData,
    UpdateServiceCategoryErrors,
    UpdateServiceCategoryResponses,
    UpdateServiceData,
    UpdateServiceErrors,
    UpdateServiceResponses,
    UpdateServicesKitData,
    UpdateServicesKitErrors,
    UpdateServicesKitResponses,
    UpdateStatusData,
    UpdateStatusErrors,
    UpdateStatusResponses,
    UploadProductBarcodeImageData,
    UploadProductBarcodeImageErrors,
    UploadProductBarcodeImageResponses,
    UploadProductImageData,
    UploadProductImageErrors,
    UploadProductImageResponses,
} from "./types.gen";
import {
    zAddAttributeToModuleData,
    zAddAttributeToModuleResponse,
    zAddKitToDealData,
    zAddKitToDealProductData,
    zAddKitToDealProductResponse,
    zAddKitToDealResponse,
    zCreateAttributeData,
    zCreateAttributeResponse2,
    zCreateBarcodeTemplateData,
    zCreateBarcodeTemplateResponse2,
    zCreateBoardData,
    zCreateBoardResponse2,
    zCreateClientData,
    zCreateClientResponse2,
    zCreateDealData,
    zCreateDealGroupData,
    zCreateDealGroupResponse2,
    zCreateDealProductData,
    zCreateDealProductResponse2,
    zCreateDealProductServiceData,
    zCreateDealProductServiceResponse,
    zCreateDealResponse2,
    zCreateDealServiceData,
    zCreateDealServiceResponse2,
    zCreateDealTagData,
    zCreateDealTagResponse2,
    zCreateMarketplaceData,
    zCreateMarketplaceResponse2,
    zCreateModuleData,
    zCreateModuleResponse2,
    zCreateProductData,
    zCreateProductResponse2,
    zCreateProjectData,
    zCreateProjectResponse2,
    zCreateServiceCategoryData,
    zCreateServiceCategoryResponse2,
    zCreateServiceData,
    zCreateServiceResponse2,
    zCreateServicesKitData,
    zCreateServicesKitResponse2,
    zCreateStatusData,
    zCreateStatusResponse2,
    zDeleteAttributeData,
    zDeleteAttributeResponse2,
    zDeleteBarcodeTemplateData,
    zDeleteBarcodeTemplateResponse2,
    zDeleteBoardData,
    zDeleteBoardResponse2,
    zDeleteClientData,
    zDeleteClientResponse2,
    zDeleteDealData,
    zDeleteDealGroupData,
    zDeleteDealGroupResponse2,
    zDeleteDealProductData,
    zDeleteDealProductResponse2,
    zDeleteDealProductServiceData,
    zDeleteDealProductServiceResponse,
    zDeleteDealResponse2,
    zDeleteDealServiceData,
    zDeleteDealServiceResponse2,
    zDeleteDealTagData,
    zDeleteDealTagResponse2,
    zDeleteMarketplaceData,
    zDeleteMarketplaceResponse2,
    zDeleteModuleData,
    zDeleteModuleResponse2,
    zDeleteProductBarcodeImageData,
    zDeleteProductBarcodeImageResponse,
    zDeleteProductData,
    zDeleteProductResponse2,
    zDeleteProjectData,
    zDeleteProjectResponse2,
    zDeleteServiceCategoryData,
    zDeleteServiceCategoryResponse2,
    zDeleteServiceData,
    zDeleteServiceResponse2,
    zDeleteServicesKitData,
    zDeleteServicesKitResponse2,
    zDeleteStatusData,
    zDeleteStatusResponse2,
    zDuplicateProductServicesData,
    zDuplicateProductServicesResponse,
    zGetAttributesData,
    zGetAttributesResponse,
    zGetAttributeTypesData,
    zGetAttributeTypesResponse,
    zGetAttrSelectOptionsData,
    zGetAttrSelectOptionsResponse,
    zGetAttrSelectsData,
    zGetAttrSelectsResponse,
    zGetBarcodeTemplateAttributesData,
    zGetBarcodeTemplateAttributesResponse,
    zGetBarcodeTemplatesData,
    zGetBarcodeTemplateSizesData,
    zGetBarcodeTemplateSizesResponse2,
    zGetBarcodeTemplatesResponse2,
    zGetBaseMarketplacesData,
    zGetBaseMarketplacesResponse2,
    zGetBoardsData,
    zGetBoardsResponse2,
    zGetClientsData,
    zGetClientsResponse2,
    zGetDealBarcodesPdfData,
    zGetDealBarcodesPdfResponse2,
    zGetDealModuleAttributesData,
    zGetDealModuleAttributesResponse2,
    zGetDealProductsData,
    zGetDealProductsResponse2,
    zGetDealsData,
    zGetDealServicesData,
    zGetDealServicesResponse2,
    zGetDealsResponse2,
    zGetDealTagColorsData,
    zGetDealTagColorsResponse,
    zGetDealTagsData,
    zGetDealTagsResponse2,
    zGetMarketplacesData,
    zGetMarketplacesResponse2,
    zGetModulesData,
    zGetModulesResponse,
    zGetModulesWithAttributesData,
    zGetModulesWithAttributesResponse,
    zGetModuleWithAttributesData,
    zGetModuleWithAttributesResponse,
    zGetProductBarcodePdfData,
    zGetProductBarcodePdfResponse2,
    zGetProductsData,
    zGetProductsResponse2,
    zGetProjectsData,
    zGetProjectsResponse2,
    zGetServiceCategoriesData,
    zGetServiceCategoriesResponse2,
    zGetServicesData,
    zGetServicesKitsData,
    zGetServicesKitsResponse,
    zGetServicesResponse2,
    zGetStatusesData,
    zGetStatusesResponse2,
    zGetStatusHistoryData,
    zGetStatusHistoryResponse2,
    zRemoveAttributeFromModuleData,
    zRemoveAttributeFromModuleResponse,
    zSwitchDealTagData,
    zSwitchDealTagResponse2,
    zUpdateAttributeData,
    zUpdateAttributeLabelData,
    zUpdateAttributeLabelResponse2,
    zUpdateAttributeResponse2,
    zUpdateBarcodeTemplateData,
    zUpdateBarcodeTemplateResponse2,
    zUpdateBoardData,
    zUpdateBoardResponse2,
    zUpdateClientData,
    zUpdateClientResponse2,
    zUpdateDealData,
    zUpdateDealGroupData,
    zUpdateDealGroupResponse2,
    zUpdateDealModuleAttributesData,
    zUpdateDealModuleAttributesResponse2,
    zUpdateDealProductData,
    zUpdateDealProductResponse2,
    zUpdateDealProductServiceData,
    zUpdateDealProductServiceResponse,
    zUpdateDealResponse2,
    zUpdateDealServiceData,
    zUpdateDealServiceResponse2,
    zUpdateDealsInGroupData,
    zUpdateDealsInGroupResponse2,
    zUpdateDealTagData,
    zUpdateDealTagResponse2,
    zUpdateMarketplaceData,
    zUpdateMarketplaceResponse2,
    zUpdateModuleData,
    zUpdateModuleResponse,
    zUpdateProductData,
    zUpdateProductResponse2,
    zUpdateProjectData,
    zUpdateProjectResponse2,
    zUpdateServiceCategoryData,
    zUpdateServiceCategoryResponse2,
    zUpdateServiceData,
    zUpdateServiceResponse2,
    zUpdateServicesKitData,
    zUpdateServicesKitResponse2,
    zUpdateStatusData,
    zUpdateStatusResponse2,
    zUploadProductBarcodeImageData,
    zUploadProductBarcodeImageResponse,
    zUploadProductImageData,
    zUploadProductImageResponse,
} from "./zod.gen";

export type Options<
    TData extends TDataShape = TDataShape,
    ThrowOnError extends boolean = boolean,
> = ClientOptions<TData, ThrowOnError> & {
    /**
     * You can provide a client instance returned by `createClient()` instead of
     * individual options. This might be also useful if you want to implement a
     * custom client.
     */
    client?: Client;
    /**
     * You can pass arbitrary values through the `meta` object. This can be
     * used to access values that aren't defined as part of the SDK function.
     */
    meta?: Record<string, unknown>;
};

/**
 * Get Attr Selects
 */
export const getAttrSelects = <ThrowOnError extends boolean = false>(
    options?: Options<GetAttrSelectsData, ThrowOnError>
) => {
    return (options?.client ?? _heyApiClient).get<
        GetAttrSelectsResponses,
        unknown,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetAttrSelectsData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetAttrSelectsResponse.parseAsync(data);
        },
        url: "/crm/v1/attr-select/",
        ...options,
    });
};

/**
 * Get Attr Select Options
 */
export const getAttrSelectOptions = <ThrowOnError extends boolean = false>(
    options: Options<GetAttrSelectOptionsData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).get<
        GetAttrSelectOptionsResponses,
        GetAttrSelectOptionsErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetAttrSelectOptionsData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetAttrSelectOptionsResponse.parseAsync(data);
        },
        url: "/crm/v1/attr-select/{selectId}",
        ...options,
    });
};

/**
 * Get Attributes
 */
export const getAttributes = <ThrowOnError extends boolean = false>(
    options?: Options<GetAttributesData, ThrowOnError>
) => {
    return (options?.client ?? _heyApiClient).get<
        GetAttributesResponses,
        unknown,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetAttributesData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetAttributesResponse.parseAsync(data);
        },
        url: "/crm/v1/attribute/",
        ...options,
    });
};

/**
 * Create Attribute
 */
export const createAttribute = <ThrowOnError extends boolean = false>(
    options: Options<CreateAttributeData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        CreateAttributeResponses,
        CreateAttributeErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zCreateAttributeData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zCreateAttributeResponse2.parseAsync(data);
        },
        url: "/crm/v1/attribute/",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Delete Attribute
 */
export const deleteAttribute = <ThrowOnError extends boolean = false>(
    options: Options<DeleteAttributeData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).delete<
        DeleteAttributeResponses,
        DeleteAttributeErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zDeleteAttributeData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zDeleteAttributeResponse2.parseAsync(data);
        },
        url: "/crm/v1/attribute/{pk}",
        ...options,
    });
};

/**
 * Update Attribute
 */
export const updateAttribute = <ThrowOnError extends boolean = false>(
    options: Options<UpdateAttributeData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).patch<
        UpdateAttributeResponses,
        UpdateAttributeErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateAttributeData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateAttributeResponse2.parseAsync(data);
        },
        url: "/crm/v1/attribute/{pk}",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Update Attribute Label
 */
export const updateAttributeLabel = <ThrowOnError extends boolean = false>(
    options: Options<UpdateAttributeLabelData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        UpdateAttributeLabelResponses,
        UpdateAttributeLabelErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateAttributeLabelData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateAttributeLabelResponse2.parseAsync(data);
        },
        url: "/crm/v1/attribute/label",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Get Attribute Types
 */
export const getAttributeTypes = <ThrowOnError extends boolean = false>(
    options?: Options<GetAttributeTypesData, ThrowOnError>
) => {
    return (options?.client ?? _heyApiClient).get<
        GetAttributeTypesResponses,
        unknown,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetAttributeTypesData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetAttributeTypesResponse.parseAsync(data);
        },
        url: "/crm/v1/attribute/type",
        ...options,
    });
};

/**
 * Get Deal Module Attributes
 */
export const getDealModuleAttributes = <ThrowOnError extends boolean = false>(
    options: Options<GetDealModuleAttributesData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).get<
        GetDealModuleAttributesResponses,
        GetDealModuleAttributesErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetDealModuleAttributesData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetDealModuleAttributesResponse2.parseAsync(data);
        },
        url: "/crm/v1/attribute/deal/{dealId}/module/{moduleId}",
        ...options,
    });
};

/**
 * Update Deal Module Attributes
 */
export const updateDealModuleAttributes = <
    ThrowOnError extends boolean = false,
>(
    options: Options<UpdateDealModuleAttributesData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        UpdateDealModuleAttributesResponses,
        UpdateDealModuleAttributesErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateDealModuleAttributesData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateDealModuleAttributesResponse2.parseAsync(data);
        },
        url: "/crm/v1/attribute/deal/{dealId}/module/{moduleId}",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Get Boards
 */
export const getBoards = <ThrowOnError extends boolean = false>(
    options: Options<GetBoardsData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).get<
        GetBoardsResponses,
        GetBoardsErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetBoardsData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetBoardsResponse2.parseAsync(data);
        },
        url: "/crm/v1/board/{projectId}",
        ...options,
    });
};

/**
 * Create Board
 */
export const createBoard = <ThrowOnError extends boolean = false>(
    options: Options<CreateBoardData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        CreateBoardResponses,
        CreateBoardErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zCreateBoardData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zCreateBoardResponse2.parseAsync(data);
        },
        url: "/crm/v1/board/",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Delete Board
 */
export const deleteBoard = <ThrowOnError extends boolean = false>(
    options: Options<DeleteBoardData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).delete<
        DeleteBoardResponses,
        DeleteBoardErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zDeleteBoardData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zDeleteBoardResponse2.parseAsync(data);
        },
        url: "/crm/v1/board/{pk}",
        ...options,
    });
};

/**
 * Update Board
 */
export const updateBoard = <ThrowOnError extends boolean = false>(
    options: Options<UpdateBoardData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).patch<
        UpdateBoardResponses,
        UpdateBoardErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateBoardData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateBoardResponse2.parseAsync(data);
        },
        url: "/crm/v1/board/{pk}",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Get Deals
 */
export const getDeals = <ThrowOnError extends boolean = false>(
    options?: Options<GetDealsData, ThrowOnError>
) => {
    return (options?.client ?? _heyApiClient).get<
        GetDealsResponses,
        GetDealsErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetDealsData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetDealsResponse2.parseAsync(data);
        },
        url: "/crm/v1/deal/",
        ...options,
    });
};

/**
 * Create Deal
 */
export const createDeal = <ThrowOnError extends boolean = false>(
    options: Options<CreateDealData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        CreateDealResponses,
        CreateDealErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zCreateDealData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zCreateDealResponse2.parseAsync(data);
        },
        url: "/crm/v1/deal/",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Delete Deal
 */
export const deleteDeal = <ThrowOnError extends boolean = false>(
    options: Options<DeleteDealData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).delete<
        DeleteDealResponses,
        DeleteDealErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zDeleteDealData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zDeleteDealResponse2.parseAsync(data);
        },
        url: "/crm/v1/deal/{pk}",
        ...options,
    });
};

/**
 * Update Deal
 */
export const updateDeal = <ThrowOnError extends boolean = false>(
    options: Options<UpdateDealData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).patch<
        UpdateDealResponses,
        UpdateDealErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateDealData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateDealResponse2.parseAsync(data);
        },
        url: "/crm/v1/deal/{pk}",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Delete Group
 */
export const deleteDealGroup = <ThrowOnError extends boolean = false>(
    options: Options<DeleteDealGroupData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).delete<
        DeleteDealGroupResponses,
        DeleteDealGroupErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zDeleteDealGroupData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zDeleteDealGroupResponse2.parseAsync(data);
        },
        url: "/crm/v1/deal-group/{pk}",
        ...options,
    });
};

/**
 * Update Group
 */
export const updateDealGroup = <ThrowOnError extends boolean = false>(
    options: Options<UpdateDealGroupData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).patch<
        UpdateDealGroupResponses,
        UpdateDealGroupErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateDealGroupData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateDealGroupResponse2.parseAsync(data);
        },
        url: "/crm/v1/deal-group/{pk}",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Create Group
 */
export const createDealGroup = <ThrowOnError extends boolean = false>(
    options: Options<CreateDealGroupData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        CreateDealGroupResponses,
        CreateDealGroupErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zCreateDealGroupData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zCreateDealGroupResponse2.parseAsync(data);
        },
        url: "/crm/v1/deal-group/",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Update Deals In Group
 */
export const updateDealsInGroup = <ThrowOnError extends boolean = false>(
    options: Options<UpdateDealsInGroupData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        UpdateDealsInGroupResponses,
        UpdateDealsInGroupErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateDealsInGroupData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateDealsInGroupResponse2.parseAsync(data);
        },
        url: "/crm/v1/deal-group/{pk}/deals",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Get Deal Tags
 */
export const getDealTags = <ThrowOnError extends boolean = false>(
    options: Options<GetDealTagsData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).get<
        GetDealTagsResponses,
        GetDealTagsErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetDealTagsData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetDealTagsResponse2.parseAsync(data);
        },
        url: "/crm/v1/deal-tag/{projectId}",
        ...options,
    });
};

/**
 * Create Deal Tag
 */
export const createDealTag = <ThrowOnError extends boolean = false>(
    options: Options<CreateDealTagData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        CreateDealTagResponses,
        CreateDealTagErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zCreateDealTagData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zCreateDealTagResponse2.parseAsync(data);
        },
        url: "/crm/v1/deal-tag/",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Delete Deal Tag
 */
export const deleteDealTag = <ThrowOnError extends boolean = false>(
    options: Options<DeleteDealTagData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).delete<
        DeleteDealTagResponses,
        DeleteDealTagErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zDeleteDealTagData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zDeleteDealTagResponse2.parseAsync(data);
        },
        url: "/crm/v1/deal-tag/{pk}",
        ...options,
    });
};

/**
 * Update Deal Tag
 */
export const updateDealTag = <ThrowOnError extends boolean = false>(
    options: Options<UpdateDealTagData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).patch<
        UpdateDealTagResponses,
        UpdateDealTagErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateDealTagData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateDealTagResponse2.parseAsync(data);
        },
        url: "/crm/v1/deal-tag/{pk}",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Switch Deal Tag
 */
export const switchDealTag = <ThrowOnError extends boolean = false>(
    options: Options<SwitchDealTagData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        SwitchDealTagResponses,
        SwitchDealTagErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zSwitchDealTagData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zSwitchDealTagResponse2.parseAsync(data);
        },
        url: "/crm/v1/deal-tag/switch",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Get Deal Tag Colors
 */
export const getDealTagColors = <ThrowOnError extends boolean = false>(
    options?: Options<GetDealTagColorsData, ThrowOnError>
) => {
    return (options?.client ?? _heyApiClient).post<
        GetDealTagColorsResponses,
        unknown,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetDealTagColorsData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetDealTagColorsResponse.parseAsync(data);
        },
        url: "/crm/v1/deal-tag/colors",
        ...options,
    });
};

/**
 * Get Modules
 */
export const getModules = <ThrowOnError extends boolean = false>(
    options?: Options<GetModulesData, ThrowOnError>
) => {
    return (options?.client ?? _heyApiClient).get<
        GetModulesResponses,
        unknown,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetModulesData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetModulesResponse.parseAsync(data);
        },
        url: "/crm/v1/module/",
        ...options,
    });
};

/**
 * Create Module
 */
export const createModule = <ThrowOnError extends boolean = false>(
    options: Options<CreateModuleData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        CreateModuleResponses,
        CreateModuleErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zCreateModuleData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zCreateModuleResponse2.parseAsync(data);
        },
        url: "/crm/v1/module/",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Get Modules With Attributes
 */
export const getModulesWithAttributes = <ThrowOnError extends boolean = false>(
    options?: Options<GetModulesWithAttributesData, ThrowOnError>
) => {
    return (options?.client ?? _heyApiClient).get<
        GetModulesWithAttributesResponses,
        unknown,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetModulesWithAttributesData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetModulesWithAttributesResponse.parseAsync(data);
        },
        url: "/crm/v1/module/with-attributes",
        ...options,
    });
};

/**
 * Get Module With Attributes
 */
export const getModuleWithAttributes = <ThrowOnError extends boolean = false>(
    options: Options<GetModuleWithAttributesData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).get<
        GetModuleWithAttributesResponses,
        GetModuleWithAttributesErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetModuleWithAttributesData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetModuleWithAttributesResponse.parseAsync(data);
        },
        url: "/crm/v1/module/{pk}/with-attributes",
        ...options,
    });
};

/**
 * Update Module Common Info
 */
export const updateModule = <ThrowOnError extends boolean = false>(
    options: Options<UpdateModuleData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).patch<
        UpdateModuleResponses,
        UpdateModuleErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateModuleData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateModuleResponse.parseAsync(data);
        },
        url: "/crm/v1/module/{pk}/common-info",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Delete Module
 */
export const deleteModule = <ThrowOnError extends boolean = false>(
    options: Options<DeleteModuleData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).delete<
        DeleteModuleResponses,
        DeleteModuleErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zDeleteModuleData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zDeleteModuleResponse2.parseAsync(data);
        },
        url: "/crm/v1/module/{pk}",
        ...options,
    });
};

/**
 * Remove Attribute From Module
 */
export const removeAttributeFromModule = <ThrowOnError extends boolean = false>(
    options: Options<RemoveAttributeFromModuleData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).delete<
        RemoveAttributeFromModuleResponses,
        RemoveAttributeFromModuleErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zRemoveAttributeFromModuleData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zRemoveAttributeFromModuleResponse.parseAsync(data);
        },
        url: "/crm/v1/module/{moduleId}/attribute/{attributeId}",
        ...options,
    });
};

/**
 * Add Attribute To Module
 */
export const addAttributeToModule = <ThrowOnError extends boolean = false>(
    options: Options<AddAttributeToModuleData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        AddAttributeToModuleResponses,
        AddAttributeToModuleErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zAddAttributeToModuleData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zAddAttributeToModuleResponse.parseAsync(data);
        },
        url: "/crm/v1/module/{moduleId}/attribute/{attributeId}",
        ...options,
    });
};

/**
 * Get Clients
 */
export const getClients = <ThrowOnError extends boolean = false>(
    options?: Options<GetClientsData, ThrowOnError>
) => {
    return (options?.client ?? _heyApiClient).get<
        GetClientsResponses,
        GetClientsErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetClientsData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetClientsResponse2.parseAsync(data);
        },
        url: "/crm/v1/clients/client/",
        ...options,
    });
};

/**
 * Create Client
 */
export const createClient = <ThrowOnError extends boolean = false>(
    options: Options<CreateClientData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        CreateClientResponses,
        CreateClientErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zCreateClientData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zCreateClientResponse2.parseAsync(data);
        },
        url: "/crm/v1/clients/client/",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Delete Product
 */
export const deleteClient = <ThrowOnError extends boolean = false>(
    options: Options<DeleteClientData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).delete<
        DeleteClientResponses,
        DeleteClientErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zDeleteClientData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zDeleteClientResponse2.parseAsync(data);
        },
        url: "/crm/v1/clients/client/{pk}",
        ...options,
    });
};

/**
 * Update Client
 */
export const updateClient = <ThrowOnError extends boolean = false>(
    options: Options<UpdateClientData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).patch<
        UpdateClientResponses,
        UpdateClientErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateClientData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateClientResponse2.parseAsync(data);
        },
        url: "/crm/v1/clients/client/{pk}",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Get Barcode Templates
 */
export const getBarcodeTemplates = <ThrowOnError extends boolean = false>(
    options?: Options<GetBarcodeTemplatesData, ThrowOnError>
) => {
    return (options?.client ?? _heyApiClient).get<
        GetBarcodeTemplatesResponses,
        unknown,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetBarcodeTemplatesData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetBarcodeTemplatesResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/barcode-template/",
        ...options,
    });
};

/**
 * Create Barcode Template
 */
export const createBarcodeTemplate = <ThrowOnError extends boolean = false>(
    options: Options<CreateBarcodeTemplateData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        CreateBarcodeTemplateResponses,
        CreateBarcodeTemplateErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zCreateBarcodeTemplateData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zCreateBarcodeTemplateResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/barcode-template/",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Delete Barcode Template
 */
export const deleteBarcodeTemplate = <ThrowOnError extends boolean = false>(
    options: Options<DeleteBarcodeTemplateData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).delete<
        DeleteBarcodeTemplateResponses,
        DeleteBarcodeTemplateErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zDeleteBarcodeTemplateData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zDeleteBarcodeTemplateResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/barcode-template/{pk}",
        ...options,
    });
};

/**
 * Update Barcode Template
 */
export const updateBarcodeTemplate = <ThrowOnError extends boolean = false>(
    options: Options<UpdateBarcodeTemplateData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).patch<
        UpdateBarcodeTemplateResponses,
        UpdateBarcodeTemplateErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateBarcodeTemplateData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateBarcodeTemplateResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/barcode-template/{pk}",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Get Barcode Template Attributes
 */
export const getBarcodeTemplateAttributes = <
    ThrowOnError extends boolean = false,
>(
    options?: Options<GetBarcodeTemplateAttributesData, ThrowOnError>
) => {
    return (options?.client ?? _heyApiClient).get<
        GetBarcodeTemplateAttributesResponses,
        unknown,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetBarcodeTemplateAttributesData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetBarcodeTemplateAttributesResponse.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/barcode-template/attributes",
        ...options,
    });
};

/**
 * Get Barcode Template Sizes
 */
export const getBarcodeTemplateSizes = <ThrowOnError extends boolean = false>(
    options?: Options<GetBarcodeTemplateSizesData, ThrowOnError>
) => {
    return (options?.client ?? _heyApiClient).get<
        GetBarcodeTemplateSizesResponses,
        unknown,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetBarcodeTemplateSizesData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetBarcodeTemplateSizesResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/barcode-template/sizes",
        ...options,
    });
};

/**
 * Get Deal Products
 */
export const getDealProducts = <ThrowOnError extends boolean = false>(
    options: Options<GetDealProductsData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).get<
        GetDealProductsResponses,
        GetDealProductsErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetDealProductsData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetDealProductsResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/deal-product/{dealId}",
        ...options,
    });
};

/**
 * Create Deal Product
 */
export const createDealProduct = <ThrowOnError extends boolean = false>(
    options: Options<CreateDealProductData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        CreateDealProductResponses,
        CreateDealProductErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zCreateDealProductData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zCreateDealProductResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/deal-product/",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Delete Deal Product
 */
export const deleteDealProduct = <ThrowOnError extends boolean = false>(
    options: Options<DeleteDealProductData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).delete<
        DeleteDealProductResponses,
        DeleteDealProductErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zDeleteDealProductData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zDeleteDealProductResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/deal-product/{dealId}/product/{productId}",
        ...options,
    });
};

/**
 * Update Deal Product
 */
export const updateDealProduct = <ThrowOnError extends boolean = false>(
    options: Options<UpdateDealProductData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).patch<
        UpdateDealProductResponses,
        UpdateDealProductErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateDealProductData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateDealProductResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/deal-product/{dealId}/product/{productId}",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Create Deal Product Service
 */
export const createDealProductService = <ThrowOnError extends boolean = false>(
    options: Options<CreateDealProductServiceData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        CreateDealProductServiceResponses,
        CreateDealProductServiceErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zCreateDealProductServiceData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zCreateDealProductServiceResponse.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/deal-product/service",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Delete Deal Product Service
 */
export const deleteDealProductService = <ThrowOnError extends boolean = false>(
    options: Options<DeleteDealProductServiceData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).delete<
        DeleteDealProductServiceResponses,
        DeleteDealProductServiceErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zDeleteDealProductServiceData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zDeleteDealProductServiceResponse.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/deal-product/{dealId}/product/{productId}/service/{serviceId}",
        ...options,
    });
};

/**
 * Update Deal Product Service
 */
export const updateDealProductService = <ThrowOnError extends boolean = false>(
    options: Options<UpdateDealProductServiceData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).patch<
        UpdateDealProductServiceResponses,
        UpdateDealProductServiceErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateDealProductServiceData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateDealProductServiceResponse.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/deal-product/{dealId}/product/{productId}/service/{serviceId}",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Copy Product Services
 */
export const duplicateProductServices = <ThrowOnError extends boolean = false>(
    options: Options<DuplicateProductServicesData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        DuplicateProductServicesResponses,
        DuplicateProductServicesErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zDuplicateProductServicesData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zDuplicateProductServicesResponse.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/deal-product/services/duplicate",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Add Kit To Deal Product
 */
export const addKitToDealProduct = <ThrowOnError extends boolean = false>(
    options: Options<AddKitToDealProductData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        AddKitToDealProductResponses,
        AddKitToDealProductErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zAddKitToDealProductData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zAddKitToDealProductResponse.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/deal-product/add-services-kit",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Get Deal Services
 */
export const getDealServices = <ThrowOnError extends boolean = false>(
    options: Options<GetDealServicesData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).get<
        GetDealServicesResponses,
        GetDealServicesErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetDealServicesData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetDealServicesResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/deal-service/{dealId}",
        ...options,
    });
};

/**
 * Create Deal Service
 */
export const createDealService = <ThrowOnError extends boolean = false>(
    options: Options<CreateDealServiceData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        CreateDealServiceResponses,
        CreateDealServiceErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zCreateDealServiceData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zCreateDealServiceResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/deal-service/",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Delete Deal Service
 */
export const deleteDealService = <ThrowOnError extends boolean = false>(
    options: Options<DeleteDealServiceData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).delete<
        DeleteDealServiceResponses,
        DeleteDealServiceErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zDeleteDealServiceData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zDeleteDealServiceResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/deal-service/{dealId}/service/{serviceId}",
        ...options,
    });
};

/**
 * Update Deal Service
 */
export const updateDealService = <ThrowOnError extends boolean = false>(
    options: Options<UpdateDealServiceData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).patch<
        UpdateDealServiceResponses,
        UpdateDealServiceErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateDealServiceData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateDealServiceResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/deal-service/{dealId}/service/{serviceId}",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Add Kit To Deal
 */
export const addKitToDeal = <ThrowOnError extends boolean = false>(
    options: Options<AddKitToDealData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        AddKitToDealResponses,
        AddKitToDealErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zAddKitToDealData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zAddKitToDealResponse.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/deal-service/add-services-kit",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Get Base Marketplaces
 */
export const getBaseMarketplaces = <ThrowOnError extends boolean = false>(
    options?: Options<GetBaseMarketplacesData, ThrowOnError>
) => {
    return (options?.client ?? _heyApiClient).get<
        GetBaseMarketplacesResponses,
        unknown,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetBaseMarketplacesData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetBaseMarketplacesResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/marketplace/base",
        ...options,
    });
};

/**
 * Get Marketplaces
 */
export const getMarketplaces = <ThrowOnError extends boolean = false>(
    options: Options<GetMarketplacesData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).get<
        GetMarketplacesResponses,
        GetMarketplacesErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetMarketplacesData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetMarketplacesResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/marketplace/{clientId}",
        ...options,
    });
};

/**
 * Create Product
 */
export const createMarketplace = <ThrowOnError extends boolean = false>(
    options: Options<CreateMarketplaceData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        CreateMarketplaceResponses,
        CreateMarketplaceErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zCreateMarketplaceData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zCreateMarketplaceResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/marketplace/",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Delete Marketplace
 */
export const deleteMarketplace = <ThrowOnError extends boolean = false>(
    options: Options<DeleteMarketplaceData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).delete<
        DeleteMarketplaceResponses,
        DeleteMarketplaceErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zDeleteMarketplaceData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zDeleteMarketplaceResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/marketplace/{pk}",
        ...options,
    });
};

/**
 * Update Marketplace
 */
export const updateMarketplace = <ThrowOnError extends boolean = false>(
    options: Options<UpdateMarketplaceData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).patch<
        UpdateMarketplaceResponses,
        UpdateMarketplaceErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateMarketplaceData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateMarketplaceResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/marketplace/{pk}",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Get Products
 */
export const getProducts = <ThrowOnError extends boolean = false>(
    options?: Options<GetProductsData, ThrowOnError>
) => {
    return (options?.client ?? _heyApiClient).get<
        GetProductsResponses,
        GetProductsErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetProductsData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetProductsResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/product/",
        ...options,
    });
};

/**
 * Create Product
 */
export const createProduct = <ThrowOnError extends boolean = false>(
    options: Options<CreateProductData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        CreateProductResponses,
        CreateProductErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zCreateProductData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zCreateProductResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/product/",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Delete Product
 */
export const deleteProduct = <ThrowOnError extends boolean = false>(
    options: Options<DeleteProductData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).delete<
        DeleteProductResponses,
        DeleteProductErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zDeleteProductData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zDeleteProductResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/product/{pk}",
        ...options,
    });
};

/**
 * Update Product
 */
export const updateProduct = <ThrowOnError extends boolean = false>(
    options: Options<UpdateProductData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).patch<
        UpdateProductResponses,
        UpdateProductErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateProductData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateProductResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/product/{pk}",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Upload Product Image
 */
export const uploadProductImage = <ThrowOnError extends boolean = false>(
    options: Options<UploadProductImageData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        UploadProductImageResponses,
        UploadProductImageErrors,
        ThrowOnError
    >({
        ...formDataBodySerializer,
        requestValidator: async data => {
            return await zUploadProductImageData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUploadProductImageResponse.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/product{pk}/images/upload",
        ...options,
        headers: {
            "Content-Type": null,
            ...options.headers,
        },
    });
};

/**
 * Get Product Barcode Pdf
 */
export const getProductBarcodePdf = <ThrowOnError extends boolean = false>(
    options: Options<GetProductBarcodePdfData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        GetProductBarcodePdfResponses,
        GetProductBarcodePdfErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetProductBarcodePdfData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetProductBarcodePdfResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/product/barcode/get-pdf",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Get Deal Barcodes Pdf
 */
export const getDealBarcodesPdf = <ThrowOnError extends boolean = false>(
    options: Options<GetDealBarcodesPdfData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        GetDealBarcodesPdfResponses,
        GetDealBarcodesPdfErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetDealBarcodesPdfData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetDealBarcodesPdfResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/product/barcode/for-deal/get-pdf",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Upload Product Barcode Image
 */
export const uploadProductBarcodeImage = <ThrowOnError extends boolean = false>(
    options: Options<UploadProductBarcodeImageData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        UploadProductBarcodeImageResponses,
        UploadProductBarcodeImageErrors,
        ThrowOnError
    >({
        ...formDataBodySerializer,
        requestValidator: async data => {
            return await zUploadProductBarcodeImageData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUploadProductBarcodeImageResponse.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/product{pk}/barcode/image/upload",
        ...options,
        headers: {
            "Content-Type": null,
            ...options.headers,
        },
    });
};

/**
 * Delete Product Barcode Image
 */
export const deleteProductBarcodeImage = <ThrowOnError extends boolean = false>(
    options: Options<DeleteProductBarcodeImageData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).delete<
        DeleteProductBarcodeImageResponses,
        DeleteProductBarcodeImageErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zDeleteProductBarcodeImageData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zDeleteProductBarcodeImageResponse.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/product{pk}/barcode/image",
        ...options,
    });
};

/**
 * Get Services
 */
export const getServices = <ThrowOnError extends boolean = false>(
    options?: Options<GetServicesData, ThrowOnError>
) => {
    return (options?.client ?? _heyApiClient).get<
        GetServicesResponses,
        unknown,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetServicesData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetServicesResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/service/",
        ...options,
    });
};

/**
 * Create Service
 */
export const createService = <ThrowOnError extends boolean = false>(
    options: Options<CreateServiceData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        CreateServiceResponses,
        CreateServiceErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zCreateServiceData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zCreateServiceResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/service/",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Delete Service
 */
export const deleteService = <ThrowOnError extends boolean = false>(
    options: Options<DeleteServiceData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).delete<
        DeleteServiceResponses,
        DeleteServiceErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zDeleteServiceData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zDeleteServiceResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/service/{pk}",
        ...options,
    });
};

/**
 * Update Service
 */
export const updateService = <ThrowOnError extends boolean = false>(
    options: Options<UpdateServiceData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).patch<
        UpdateServiceResponses,
        UpdateServiceErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateServiceData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateServiceResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/service/{pk}",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Get Services Categories
 */
export const getServiceCategories = <ThrowOnError extends boolean = false>(
    options?: Options<GetServiceCategoriesData, ThrowOnError>
) => {
    return (options?.client ?? _heyApiClient).get<
        GetServiceCategoriesResponses,
        unknown,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetServiceCategoriesData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetServiceCategoriesResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/service-category/",
        ...options,
    });
};

/**
 * Create Service Category
 */
export const createServiceCategory = <ThrowOnError extends boolean = false>(
    options: Options<CreateServiceCategoryData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        CreateServiceCategoryResponses,
        CreateServiceCategoryErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zCreateServiceCategoryData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zCreateServiceCategoryResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/service-category/",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Delete Service Category
 */
export const deleteServiceCategory = <ThrowOnError extends boolean = false>(
    options: Options<DeleteServiceCategoryData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).delete<
        DeleteServiceCategoryResponses,
        DeleteServiceCategoryErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zDeleteServiceCategoryData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zDeleteServiceCategoryResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/service-category/{pk}",
        ...options,
    });
};

/**
 * Update Service Category
 */
export const updateServiceCategory = <ThrowOnError extends boolean = false>(
    options: Options<UpdateServiceCategoryData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).patch<
        UpdateServiceCategoryResponses,
        UpdateServiceCategoryErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateServiceCategoryData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateServiceCategoryResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/service-category/{pk}",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Get Services Kits
 */
export const getServicesKits = <ThrowOnError extends boolean = false>(
    options?: Options<GetServicesKitsData, ThrowOnError>
) => {
    return (options?.client ?? _heyApiClient).get<
        GetServicesKitsResponses,
        unknown,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetServicesKitsData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetServicesKitsResponse.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/services-kit/",
        ...options,
    });
};

/**
 * Create Services Kit
 */
export const createServicesKit = <ThrowOnError extends boolean = false>(
    options: Options<CreateServicesKitData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        CreateServicesKitResponses,
        CreateServicesKitErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zCreateServicesKitData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zCreateServicesKitResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/services-kit/",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Delete Services Kit
 */
export const deleteServicesKit = <ThrowOnError extends boolean = false>(
    options: Options<DeleteServicesKitData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).delete<
        DeleteServicesKitResponses,
        DeleteServicesKitErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zDeleteServicesKitData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zDeleteServicesKitResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/services-kit/{pk}",
        ...options,
    });
};

/**
 * Update Services Kit
 */
export const updateServicesKit = <ThrowOnError extends boolean = false>(
    options: Options<UpdateServicesKitData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).patch<
        UpdateServicesKitResponses,
        UpdateServicesKitErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateServicesKitData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateServicesKitResponse2.parseAsync(data);
        },
        url: "/crm/v1/fulfillment-base/services-kit/{pk}",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Get Projects
 */
export const getProjects = <ThrowOnError extends boolean = false>(
    options?: Options<GetProjectsData, ThrowOnError>
) => {
    return (options?.client ?? _heyApiClient).get<
        GetProjectsResponses,
        unknown,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetProjectsData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetProjectsResponse2.parseAsync(data);
        },
        url: "/crm/v1/project/",
        ...options,
    });
};

/**
 * Create Project
 */
export const createProject = <ThrowOnError extends boolean = false>(
    options: Options<CreateProjectData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        CreateProjectResponses,
        CreateProjectErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zCreateProjectData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zCreateProjectResponse2.parseAsync(data);
        },
        url: "/crm/v1/project/",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Delete Project
 */
export const deleteProject = <ThrowOnError extends boolean = false>(
    options: Options<DeleteProjectData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).delete<
        DeleteProjectResponses,
        DeleteProjectErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zDeleteProjectData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zDeleteProjectResponse2.parseAsync(data);
        },
        url: "/crm/v1/project/{pk}",
        ...options,
    });
};

/**
 * Update Project
 */
export const updateProject = <ThrowOnError extends boolean = false>(
    options: Options<UpdateProjectData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).patch<
        UpdateProjectResponses,
        UpdateProjectErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateProjectData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateProjectResponse2.parseAsync(data);
        },
        url: "/crm/v1/project/{pk}",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Get Statuses
 */
export const getStatuses = <ThrowOnError extends boolean = false>(
    options: Options<GetStatusesData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).get<
        GetStatusesResponses,
        GetStatusesErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetStatusesData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetStatusesResponse2.parseAsync(data);
        },
        url: "/crm/v1/status/{boardId}",
        ...options,
    });
};

/**
 * Create Status
 */
export const createStatus = <ThrowOnError extends boolean = false>(
    options: Options<CreateStatusData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).post<
        CreateStatusResponses,
        CreateStatusErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zCreateStatusData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zCreateStatusResponse2.parseAsync(data);
        },
        url: "/crm/v1/status/",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Delete Status
 */
export const deleteStatus = <ThrowOnError extends boolean = false>(
    options: Options<DeleteStatusData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).delete<
        DeleteStatusResponses,
        DeleteStatusErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zDeleteStatusData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zDeleteStatusResponse2.parseAsync(data);
        },
        url: "/crm/v1/status/{pk}",
        ...options,
    });
};

/**
 * Update Status
 */
export const updateStatus = <ThrowOnError extends boolean = false>(
    options: Options<UpdateStatusData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).patch<
        UpdateStatusResponses,
        UpdateStatusErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zUpdateStatusData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zUpdateStatusResponse2.parseAsync(data);
        },
        url: "/crm/v1/status/{pk}",
        ...options,
        headers: {
            "Content-Type": "application/json",
            ...options.headers,
        },
    });
};

/**
 * Get Status History
 */
export const getStatusHistory = <ThrowOnError extends boolean = false>(
    options: Options<GetStatusHistoryData, ThrowOnError>
) => {
    return (options.client ?? _heyApiClient).get<
        GetStatusHistoryResponses,
        GetStatusHistoryErrors,
        ThrowOnError
    >({
        requestValidator: async data => {
            return await zGetStatusHistoryData.parseAsync(data);
        },
        responseType: "json",
        responseValidator: async data => {
            return await zGetStatusHistoryResponse2.parseAsync(data);
        },
        url: "/crm/v1/status/history/{dealId}",
        ...options,
    });
};
