/* tslint:disable */ /* eslint-disable */ /** * Geins Management API * Geins Management API is a RESTful api that powers your applications and helps you manage your Geins services. Geins provides an easy-to-use and scalable solution for managing all aspects of an online store, from product listings and customer information to order processing and payment transactions. :::tip Tip With this API, you can build custom applications and integrate with third-party systems, feeds, dashboards and other bussiness logic apps. ::: ## Getting started Once you have created an account, you can start using the Management API by creating an `API User`. You can create as many API users as you need. Each `API user` is connected to a specific account so you can keep track of operations and manage keys. You can find all your API credentials in `Geins Merchant Center`. ### Fast track Use one of our [SDKs](https://docs.geins.io/docs/sdk/introduction) to get started quickly. The SDKs are available for the most popular programming languages and frameworks. Or, if you prefer to just take it for a test run: [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25895885-aaf6598f-1a7c-4949-85d7-ba846c42d553?action=collection%2Ffork&collection-url=entityId%3D25895885-aaf6598f-1a7c-4949-85d7-ba846c42d553%26entityType%3Dcollection%26workspaceId%3Da2a179ce-158e-46b0-8d06-e9640f45112c) ### Authentication Two authentication methods are required: - `Basic Auth` - `API Key` All API credentials can be found in `Geins Merchant Center`. #### Basic Auth A Basic auth `Authorization` header needs to be included in every request. The value should be `Basic ` where `` is the Base64 encoding of your `API username` and `API password` joined by a single colon `:`. See [Wikipedia](https://en.wikipedia.org/wiki/Basic_access_authentication) for more information on Basic auth. #### API Key An `X-ApiKey` header needs to be included in every request. This header should contain the value of your `API key`. #### Example ```bash curl -X GET \"https://mgmtapi.geins.io/API/Market/List\" \\ -H \"Authorization: Basic [USER-CREDENTIALS-BASE64-ENCODED]\" \\ -H \"X-ApiKey: [API-KEY]\" ``` * * The version of the OpenAPI document: v1.10.1 * * * 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 { BaseEnvelope, EnvelopeListSystemString, EnvelopeListVariantModelsReadVariant, EnvelopeVariantModelsReadVariantGroup, VariantModelsWriteVariant, VariantModelsWriteVariantGroup, } from '../models'; import { BaseEnvelopeFromJSON, BaseEnvelopeToJSON, EnvelopeListSystemStringFromJSON, EnvelopeListSystemStringToJSON, EnvelopeListVariantModelsReadVariantFromJSON, EnvelopeListVariantModelsReadVariantToJSON, EnvelopeVariantModelsReadVariantGroupFromJSON, EnvelopeVariantModelsReadVariantGroupToJSON, VariantModelsWriteVariantFromJSON, VariantModelsWriteVariantToJSON, VariantModelsWriteVariantGroupFromJSON, VariantModelsWriteVariantGroupToJSON, } from '../models'; export interface AddProductToVariantGroupRequest { groupId: number; productId: string; variant: Array; productIdType?: AddProductToVariantGroupProductIdTypeEnum; include?: string; } export interface AddProductToVariantGroupProductRequest { productId1: string; productId2: string; productIdType?: AddProductToVariantGroupProductProductIdTypeEnum; include?: string; } export interface CreateVariantGroupRequest { variantGroup: VariantModelsWriteVariantGroup; include?: string; } export interface CreateVariantGroupProductRequest { productId: string; variantGroup: VariantModelsWriteVariantGroup; productIdType?: CreateVariantGroupProductProductIdTypeEnum; include?: string; } export interface DeleteVariantGroupGroupIdRequest { groupId: number; } export interface DeleteVariantGroupProductIdRequest { productId: string; productIdType?: DeleteVariantGroupProductIdProductIdTypeEnum; } export interface GetVariantGroupGroupIdRequest { groupId: number; include?: string; } export interface GetVariantGroupProductIdRequest { productId: string; productIdType?: GetVariantGroupProductIdProductIdTypeEnum; include?: string; } export interface RemoveProductFromVariantGroupRequest { productId: string; productIdType?: RemoveProductFromVariantGroupProductIdTypeEnum; include?: string; } export interface UpdateVariantRequest { productId: string; variant: Array; productIdType?: UpdateVariantProductIdTypeEnum; } export interface UpdateVariantGroupRequest { groupId: number; variantGroup: VariantModelsWriteVariantGroup; include?: string; } /** * */ export class VariantApi extends runtime.BaseAPI { /** * Adds a product to an existing variant group. * Add product to variant group */ async addProductToVariantGroupRaw(requestParameters: AddProductToVariantGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.groupId === null || requestParameters.groupId === undefined) { throw new runtime.RequiredError('groupId','Required parameter requestParameters.groupId was null or undefined when calling addProductToVariantGroup.'); } if (requestParameters.productId === null || requestParameters.productId === undefined) { throw new runtime.RequiredError('productId','Required parameter requestParameters.productId was null or undefined when calling addProductToVariantGroup.'); } if (requestParameters.variant === null || requestParameters.variant === undefined) { throw new runtime.RequiredError('variant','Required parameter requestParameters.variant was null or undefined when calling addProductToVariantGroup.'); } const queryParameters: any = {}; if (requestParameters.productIdType !== undefined) { queryParameters['productIdType'] = requestParameters.productIdType; } if (requestParameters.include !== undefined) { queryParameters['include'] = requestParameters.include; } const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["X-ApiKey"] = this.configuration.apiKey("X-ApiKey"); // apiKey authentication } 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/VariantGroup/{groupId}/{productId}`.replace(`{${"groupId"}}`, encodeURIComponent(String(requestParameters.groupId))).replace(`{${"productId"}}`, encodeURIComponent(String(requestParameters.productId))), method: 'PUT', headers: headerParameters, query: queryParameters, body: requestParameters.variant.map(VariantModelsWriteVariantToJSON), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => EnvelopeVariantModelsReadVariantGroupFromJSON(jsonValue)); } /** * Adds a product to an existing variant group. * Add product to variant group */ async addProductToVariantGroup(requestParameters: AddProductToVariantGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.addProductToVariantGroupRaw(requestParameters, initOverrides); return await response.value(); } /** * Adds a product to an existing variant group from another product. * Add product to variant group (product) */ async addProductToVariantGroupProductRaw(requestParameters: AddProductToVariantGroupProductRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.productId1 === null || requestParameters.productId1 === undefined) { throw new runtime.RequiredError('productId1','Required parameter requestParameters.productId1 was null or undefined when calling addProductToVariantGroupProduct.'); } if (requestParameters.productId2 === null || requestParameters.productId2 === undefined) { throw new runtime.RequiredError('productId2','Required parameter requestParameters.productId2 was null or undefined when calling addProductToVariantGroupProduct.'); } const queryParameters: any = {}; if (requestParameters.productIdType !== undefined) { queryParameters['productIdType'] = requestParameters.productIdType; } if (requestParameters.include !== undefined) { queryParameters['include'] = requestParameters.include; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["X-ApiKey"] = this.configuration.apiKey("X-ApiKey"); // apiKey authentication } 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/Variant/{productId1}/{productId2}`.replace(`{${"productId1"}}`, encodeURIComponent(String(requestParameters.productId1))).replace(`{${"productId2"}}`, encodeURIComponent(String(requestParameters.productId2))), method: 'PUT', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => EnvelopeVariantModelsReadVariantGroupFromJSON(jsonValue)); } /** * Adds a product to an existing variant group from another product. * Add product to variant group (product) */ async addProductToVariantGroupProduct(requestParameters: AddProductToVariantGroupProductRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.addProductToVariantGroupProductRaw(requestParameters, initOverrides); return await response.value(); } /** * Creates a new variant group. * Create variant group */ async createVariantGroupRaw(requestParameters: CreateVariantGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.variantGroup === null || requestParameters.variantGroup === undefined) { throw new runtime.RequiredError('variantGroup','Required parameter requestParameters.variantGroup was null or undefined when calling createVariantGroup.'); } const queryParameters: any = {}; if (requestParameters.include !== undefined) { queryParameters['include'] = requestParameters.include; } const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["X-ApiKey"] = this.configuration.apiKey("X-ApiKey"); // apiKey authentication } 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/VariantGroup`, method: 'POST', headers: headerParameters, query: queryParameters, body: VariantModelsWriteVariantGroupToJSON(requestParameters.variantGroup), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => EnvelopeVariantModelsReadVariantGroupFromJSON(jsonValue)); } /** * Creates a new variant group. * Create variant group */ async createVariantGroup(requestParameters: CreateVariantGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.createVariantGroupRaw(requestParameters, initOverrides); return await response.value(); } /** * Create a new variant group for the provided product id. * Create variant group (product) */ async createVariantGroupProductRaw(requestParameters: CreateVariantGroupProductRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.productId === null || requestParameters.productId === undefined) { throw new runtime.RequiredError('productId','Required parameter requestParameters.productId was null or undefined when calling createVariantGroupProduct.'); } if (requestParameters.variantGroup === null || requestParameters.variantGroup === undefined) { throw new runtime.RequiredError('variantGroup','Required parameter requestParameters.variantGroup was null or undefined when calling createVariantGroupProduct.'); } const queryParameters: any = {}; if (requestParameters.productIdType !== undefined) { queryParameters['productIdType'] = requestParameters.productIdType; } if (requestParameters.include !== undefined) { queryParameters['include'] = requestParameters.include; } const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["X-ApiKey"] = this.configuration.apiKey("X-ApiKey"); // apiKey authentication } 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/Variant/{productId}/VariantGroup`.replace(`{${"productId"}}`, encodeURIComponent(String(requestParameters.productId))), method: 'POST', headers: headerParameters, query: queryParameters, body: VariantModelsWriteVariantGroupToJSON(requestParameters.variantGroup), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => EnvelopeVariantModelsReadVariantGroupFromJSON(jsonValue)); } /** * Create a new variant group for the provided product id. * Create variant group (product) */ async createVariantGroupProduct(requestParameters: CreateVariantGroupProductRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.createVariantGroupProductRaw(requestParameters, initOverrides); return await response.value(); } /** * Deletes an entire variant group. * Delete variant group (group id) */ async deleteVariantGroupGroupIdRaw(requestParameters: DeleteVariantGroupGroupIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.groupId === null || requestParameters.groupId === undefined) { throw new runtime.RequiredError('groupId','Required parameter requestParameters.groupId was null or undefined when calling deleteVariantGroupGroupId.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["X-ApiKey"] = this.configuration.apiKey("X-ApiKey"); // apiKey authentication } 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/VariantGroup/{groupId}`.replace(`{${"groupId"}}`, encodeURIComponent(String(requestParameters.groupId))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => BaseEnvelopeFromJSON(jsonValue)); } /** * Deletes an entire variant group. * Delete variant group (group id) */ async deleteVariantGroupGroupId(requestParameters: DeleteVariantGroupGroupIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.deleteVariantGroupGroupIdRaw(requestParameters, initOverrides); return await response.value(); } /** * Deletes an entire variant group based on product id. * Delete variant group (product id) */ async deleteVariantGroupProductIdRaw(requestParameters: DeleteVariantGroupProductIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.productId === null || requestParameters.productId === undefined) { throw new runtime.RequiredError('productId','Required parameter requestParameters.productId was null or undefined when calling deleteVariantGroupProductId.'); } const queryParameters: any = {}; if (requestParameters.productIdType !== undefined) { queryParameters['productIdType'] = requestParameters.productIdType; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["X-ApiKey"] = this.configuration.apiKey("X-ApiKey"); // apiKey authentication } 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/Variant/{productId}/VariantGroup`.replace(`{${"productId"}}`, encodeURIComponent(String(requestParameters.productId))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => BaseEnvelopeFromJSON(jsonValue)); } /** * Deletes an entire variant group based on product id. * Delete variant group (product id) */ async deleteVariantGroupProductId(requestParameters: DeleteVariantGroupProductIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.deleteVariantGroupProductIdRaw(requestParameters, initOverrides); return await response.value(); } /** * Gets a specific variant group. * Get variant group (group id) */ async getVariantGroupGroupIdRaw(requestParameters: GetVariantGroupGroupIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.groupId === null || requestParameters.groupId === undefined) { throw new runtime.RequiredError('groupId','Required parameter requestParameters.groupId was null or undefined when calling getVariantGroupGroupId.'); } const queryParameters: any = {}; if (requestParameters.include !== undefined) { queryParameters['include'] = requestParameters.include; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["X-ApiKey"] = this.configuration.apiKey("X-ApiKey"); // apiKey authentication } 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/VariantGroup/{groupId}`.replace(`{${"groupId"}}`, encodeURIComponent(String(requestParameters.groupId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => EnvelopeVariantModelsReadVariantGroupFromJSON(jsonValue)); } /** * Gets a specific variant group. * Get variant group (group id) */ async getVariantGroupGroupId(requestParameters: GetVariantGroupGroupIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getVariantGroupGroupIdRaw(requestParameters, initOverrides); return await response.value(); } /** * Gets the variant group for the provided product id. * Get variant group (product id) */ async getVariantGroupProductIdRaw(requestParameters: GetVariantGroupProductIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.productId === null || requestParameters.productId === undefined) { throw new runtime.RequiredError('productId','Required parameter requestParameters.productId was null or undefined when calling getVariantGroupProductId.'); } const queryParameters: any = {}; if (requestParameters.productIdType !== undefined) { queryParameters['productIdType'] = requestParameters.productIdType; } if (requestParameters.include !== undefined) { queryParameters['include'] = requestParameters.include; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["X-ApiKey"] = this.configuration.apiKey("X-ApiKey"); // apiKey authentication } 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/Variant/{productId}/VariantGroup`.replace(`{${"productId"}}`, encodeURIComponent(String(requestParameters.productId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => EnvelopeVariantModelsReadVariantGroupFromJSON(jsonValue)); } /** * Gets the variant group for the provided product id. * Get variant group (product id) */ async getVariantGroupProductId(requestParameters: GetVariantGroupProductIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getVariantGroupProductIdRaw(requestParameters, initOverrides); return await response.value(); } /** * Gets all valid variant labels. * Get variant labels */ async getVariantLabelsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["X-ApiKey"] = this.configuration.apiKey("X-ApiKey"); // apiKey authentication } 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/Variant/Labels`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => EnvelopeListSystemStringFromJSON(jsonValue)); } /** * Gets all valid variant labels. * Get variant labels */ async getVariantLabels(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getVariantLabelsRaw(initOverrides); return await response.value(); } /** * Removes a product from its variant group. * Remove product from variant group */ async removeProductFromVariantGroupRaw(requestParameters: RemoveProductFromVariantGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.productId === null || requestParameters.productId === undefined) { throw new runtime.RequiredError('productId','Required parameter requestParameters.productId was null or undefined when calling removeProductFromVariantGroup.'); } const queryParameters: any = {}; if (requestParameters.productIdType !== undefined) { queryParameters['productIdType'] = requestParameters.productIdType; } if (requestParameters.include !== undefined) { queryParameters['include'] = requestParameters.include; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["X-ApiKey"] = this.configuration.apiKey("X-ApiKey"); // apiKey authentication } 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/Variant/{productId}`.replace(`{${"productId"}}`, encodeURIComponent(String(requestParameters.productId))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => EnvelopeVariantModelsReadVariantGroupFromJSON(jsonValue)); } /** * Removes a product from its variant group. * Remove product from variant group */ async removeProductFromVariantGroup(requestParameters: RemoveProductFromVariantGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.removeProductFromVariantGroupRaw(requestParameters, initOverrides); return await response.value(); } /** * Updates the variant details for the product with the provided id. * Update variant */ async updateVariantRaw(requestParameters: UpdateVariantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.productId === null || requestParameters.productId === undefined) { throw new runtime.RequiredError('productId','Required parameter requestParameters.productId was null or undefined when calling updateVariant.'); } if (requestParameters.variant === null || requestParameters.variant === undefined) { throw new runtime.RequiredError('variant','Required parameter requestParameters.variant was null or undefined when calling updateVariant.'); } const queryParameters: any = {}; if (requestParameters.productIdType !== undefined) { queryParameters['productIdType'] = requestParameters.productIdType; } const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["X-ApiKey"] = this.configuration.apiKey("X-ApiKey"); // apiKey authentication } 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/Variant/{productId}`.replace(`{${"productId"}}`, encodeURIComponent(String(requestParameters.productId))), method: 'PUT', headers: headerParameters, query: queryParameters, body: requestParameters.variant.map(VariantModelsWriteVariantToJSON), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => EnvelopeListVariantModelsReadVariantFromJSON(jsonValue)); } /** * Updates the variant details for the product with the provided id. * Update variant */ async updateVariant(requestParameters: UpdateVariantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.updateVariantRaw(requestParameters, initOverrides); return await response.value(); } /** * Updates the settings of a variant group. * Update variant group */ async updateVariantGroupRaw(requestParameters: UpdateVariantGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.groupId === null || requestParameters.groupId === undefined) { throw new runtime.RequiredError('groupId','Required parameter requestParameters.groupId was null or undefined when calling updateVariantGroup.'); } if (requestParameters.variantGroup === null || requestParameters.variantGroup === undefined) { throw new runtime.RequiredError('variantGroup','Required parameter requestParameters.variantGroup was null or undefined when calling updateVariantGroup.'); } const queryParameters: any = {}; if (requestParameters.include !== undefined) { queryParameters['include'] = requestParameters.include; } const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["X-ApiKey"] = this.configuration.apiKey("X-ApiKey"); // apiKey authentication } 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/VariantGroup/{groupId}`.replace(`{${"groupId"}}`, encodeURIComponent(String(requestParameters.groupId))), method: 'PUT', headers: headerParameters, query: queryParameters, body: VariantModelsWriteVariantGroupToJSON(requestParameters.variantGroup), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => EnvelopeVariantModelsReadVariantGroupFromJSON(jsonValue)); } /** * Updates the settings of a variant group. * Update variant group */ async updateVariantGroup(requestParameters: UpdateVariantGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.updateVariantGroupRaw(requestParameters, initOverrides); return await response.value(); } } /** * @export */ export const AddProductToVariantGroupProductIdTypeEnum = { NUMBER_0: 0, NUMBER_1: 1, NUMBER_2: 2, NUMBER_3: 3 } as const; export type AddProductToVariantGroupProductIdTypeEnum = typeof AddProductToVariantGroupProductIdTypeEnum[keyof typeof AddProductToVariantGroupProductIdTypeEnum]; /** * @export */ export const AddProductToVariantGroupProductProductIdTypeEnum = { NUMBER_0: 0, NUMBER_1: 1, NUMBER_2: 2, NUMBER_3: 3 } as const; export type AddProductToVariantGroupProductProductIdTypeEnum = typeof AddProductToVariantGroupProductProductIdTypeEnum[keyof typeof AddProductToVariantGroupProductProductIdTypeEnum]; /** * @export */ export const CreateVariantGroupProductProductIdTypeEnum = { NUMBER_0: 0, NUMBER_1: 1, NUMBER_2: 2, NUMBER_3: 3 } as const; export type CreateVariantGroupProductProductIdTypeEnum = typeof CreateVariantGroupProductProductIdTypeEnum[keyof typeof CreateVariantGroupProductProductIdTypeEnum]; /** * @export */ export const DeleteVariantGroupProductIdProductIdTypeEnum = { NUMBER_0: 0, NUMBER_1: 1, NUMBER_2: 2, NUMBER_3: 3 } as const; export type DeleteVariantGroupProductIdProductIdTypeEnum = typeof DeleteVariantGroupProductIdProductIdTypeEnum[keyof typeof DeleteVariantGroupProductIdProductIdTypeEnum]; /** * @export */ export const GetVariantGroupProductIdProductIdTypeEnum = { NUMBER_0: 0, NUMBER_1: 1, NUMBER_2: 2, NUMBER_3: 3 } as const; export type GetVariantGroupProductIdProductIdTypeEnum = typeof GetVariantGroupProductIdProductIdTypeEnum[keyof typeof GetVariantGroupProductIdProductIdTypeEnum]; /** * @export */ export const RemoveProductFromVariantGroupProductIdTypeEnum = { NUMBER_0: 0, NUMBER_1: 1, NUMBER_2: 2, NUMBER_3: 3 } as const; export type RemoveProductFromVariantGroupProductIdTypeEnum = typeof RemoveProductFromVariantGroupProductIdTypeEnum[keyof typeof RemoveProductFromVariantGroupProductIdTypeEnum]; /** * @export */ export const UpdateVariantProductIdTypeEnum = { NUMBER_0: 0, NUMBER_1: 1, NUMBER_2: 2, NUMBER_3: 3 } as const; export type UpdateVariantProductIdTypeEnum = typeof UpdateVariantProductIdTypeEnum[keyof typeof UpdateVariantProductIdTypeEnum];