UNPKG

@datenkraft/bb-fulfillment-api-ts-client

Version:

The fulfillment API TS Client enables you to work with the fulfillment API

585 lines (584 loc) 41 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Fulfillment API * - alpha: Currently developed API version. Subject to major changes. - beta: A semi-stable early access version. New features can be added. Breaking changes are possible. - stable: The API is recommended for use in production. [Changelog](https://fulfillment-api.steve.niceshops.com/v2/docs/changelog.html) All data is transferred in UTF-8 encoding.\\ The API uses stateless HTTP. No cookies have to be kept.\\ Authentication via OAuth2 client credentials flow. [Privacy Policy](https://www.niceshops.com/en/dienstleistungen/data-privacy-policy) [Fulfillment API PHP client @Packagist](https://packagist.org/packages/datenkraft/bb-fulfillment-api-php-client) * * The version of the OpenAPI document: v2.beta * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ProductDraftApi = exports.ProductDraftApiFactory = exports.ProductDraftApiFp = exports.ProductDraftApiAxiosParamCreator = void 0; const axios_1 = __importDefault(require("axios")); // URLSearchParams not necessarily used // @ts-ignore const url_1 = require("url"); // Some imports not used depending on template conditions // @ts-ignore const common_1 = require("../common"); // @ts-ignore const base_1 = require("../base"); /** * ProductDraftApi - axios parameter creator * @export */ const ProductDraftApiAxiosParamCreator = function (configuration) { return { /** * Delete a product draft.\\ **The product draft may only be deleted while it is still in pending state.** * @summary Delete a product draft. * @param {string} productDraftId ID of the product draft * @param {string} shopCode The shopCode used internally to distinguish between clients. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteProductDraft: (productDraftId, shopCode, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'productDraftId' is not null or undefined (0, common_1.assertParamExists)('deleteProductDraft', 'productDraftId', productDraftId); // verify required parameter 'shopCode' is not null or undefined (0, common_1.assertParamExists)('deleteProductDraft', 'shopCode', shopCode); const localVarPath = `/product-draft/{productDraftId}` .replace(`{${"productDraftId"}}`, encodeURIComponent(String(productDraftId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (shopCode !== undefined) { localVarQueryParameter['shopCode'] = shopCode; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Read the product draft specified by the given product draft ID. * @summary Read the product draft specified by the given product draft ID. * @param {string} productDraftId ID of the product draft * @param {string} shopCode The shopCode used internally to distinguish between clients. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProductDraft: (productDraftId, shopCode, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'productDraftId' is not null or undefined (0, common_1.assertParamExists)('getProductDraft', 'productDraftId', productDraftId); // verify required parameter 'shopCode' is not null or undefined (0, common_1.assertParamExists)('getProductDraft', 'shopCode', shopCode); const localVarPath = `/product-draft/{productDraftId}` .replace(`{${"productDraftId"}}`, encodeURIComponent(String(productDraftId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (shopCode !== undefined) { localVarQueryParameter['shopCode'] = shopCode; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Get a spreadsheet template for performing POST queries to the respective endpoint. The file type is controlled by the accept header. The fill-in help in the second line can be removed or remain. * @summary Get a spreadsheet template for performing POST queries to the respective endpoint. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProductDraftBulkImportTemplate: (options = {}) => __awaiter(this, void 0, void 0, function* () { const localVarPath = `/bulk-import/template/product-draft`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Read a product draft collection. These are read in multiple pages with a defined page size. * @summary Read a product draft collection. * @param {string} filterShopCode The shopCode used internally to distinguish between clients. * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [filterProductNumber] Filter by a productNumber * @param {'pending' | 'accepted' | 'declined'} [filterProductDraftStatus] Filter by a product draft status * @param {string} [filterSearch] Filter for product draft search. \\ Usage: - Provide one or multiple search terms (min. 2 characters) to filter results. - Multiple search terms are separated by spaces. - The search is not case sensitive. - The search is only enabled for the productNumber. - Each search term filters the response for products where the productNumber contains the search term. - For example, filter[search]=\'term1 term2\' will filter the result for products where \'term1\' is found in the productNumber and \'term2\' is also found in the productNumber. If only \'term1\' or \'term2\' is found in the productNumber, the product is not included in the results. * @param {string} [filterProductDraftDateFrom] Filter for productDraftDate Format Y-m-d * @param {string} [filterProductDraftDateTo] Filter for productDraftDate Format Y-m-d * @param {string} [sortBy] Sort the results by one or more comma-separated sort criteria, with the criterion specified first having priority. Available sort orders: - asc: ascending order - desc: descending order Available fields for sorting: - productDraftDate The default sort order is productDraftDate:desc. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProductDraftCollection: (filterShopCode, page, pageSize, paginationMode, filterProductNumber, filterProductDraftStatus, filterSearch, filterProductDraftDateFrom, filterProductDraftDateTo, sortBy, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'filterShopCode' is not null or undefined (0, common_1.assertParamExists)('getProductDraftCollection', 'filterShopCode', filterShopCode); const localVarPath = `/product-draft`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (page !== undefined) { localVarQueryParameter['page'] = page; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (paginationMode !== undefined) { localVarQueryParameter['paginationMode'] = paginationMode; } if (filterShopCode !== undefined) { localVarQueryParameter['filter[shopCode]'] = filterShopCode; } if (filterProductNumber !== undefined) { localVarQueryParameter['filter[productNumber]'] = filterProductNumber; } if (filterProductDraftStatus !== undefined) { localVarQueryParameter['filter[productDraftStatus]'] = filterProductDraftStatus; } if (filterSearch !== undefined) { localVarQueryParameter['filter[search]'] = filterSearch; } if (filterProductDraftDateFrom !== undefined) { localVarQueryParameter['filter[productDraftDateFrom]'] = (filterProductDraftDateFrom instanceof Date) ? filterProductDraftDateFrom.toISOString().substr(0, 10) : filterProductDraftDateFrom; } if (filterProductDraftDateTo !== undefined) { localVarQueryParameter['filter[productDraftDateTo]'] = (filterProductDraftDateTo instanceof Date) ? filterProductDraftDateTo.toISOString().substr(0, 10) : filterProductDraftDateTo; } if (sortBy !== undefined) { localVarQueryParameter['sortBy'] = sortBy; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Create a new product draft to initiate the creation new products.Product drafts will be put into a queue for manual approval. * @summary Create a new product draft to initiate the creation new products. * @param {string} shopCode The shopCode used internally to distinguish between clients. * @param {NewProductDraft} newProductDraft * @param {*} [options] Override http request option. * @throws {RequiredError} */ postProductDraft: (shopCode, newProductDraft, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'shopCode' is not null or undefined (0, common_1.assertParamExists)('postProductDraft', 'shopCode', shopCode); // verify required parameter 'newProductDraft' is not null or undefined (0, common_1.assertParamExists)('postProductDraft', 'newProductDraft', newProductDraft); const localVarPath = `/product-draft`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (shopCode !== undefined) { localVarQueryParameter['shopCode'] = shopCode; } localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(newProductDraft, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Import one or more new product draft(s). The file type is controlled by the content type attribute of the uploaded file * @summary Import one or more new product drafts. * @param {File} file File to upload * @param {*} [options] Override http request option. * @throws {RequiredError} */ productDraftBulkImport: (file, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'file' is not null or undefined (0, common_1.assertParamExists)('productDraftBulkImport', 'file', file); const localVarPath = `/bulk-import/product-draft`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)(); // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (file !== undefined) { localVarFormParams.append('file', file); } localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = localVarFormParams; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; exports.ProductDraftApiAxiosParamCreator = ProductDraftApiAxiosParamCreator; /** * ProductDraftApi - functional programming interface * @export */ const ProductDraftApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.ProductDraftApiAxiosParamCreator)(configuration); return { /** * Delete a product draft.\\ **The product draft may only be deleted while it is still in pending state.** * @summary Delete a product draft. * @param {string} productDraftId ID of the product draft * @param {string} shopCode The shopCode used internally to distinguish between clients. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteProductDraft(productDraftId, shopCode, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteProductDraft(productDraftId, shopCode, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Read the product draft specified by the given product draft ID. * @summary Read the product draft specified by the given product draft ID. * @param {string} productDraftId ID of the product draft * @param {string} shopCode The shopCode used internally to distinguish between clients. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProductDraft(productDraftId, shopCode, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.getProductDraft(productDraftId, shopCode, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Get a spreadsheet template for performing POST queries to the respective endpoint. The file type is controlled by the accept header. The fill-in help in the second line can be removed or remain. * @summary Get a spreadsheet template for performing POST queries to the respective endpoint. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProductDraftBulkImportTemplate(options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.getProductDraftBulkImportTemplate(options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Read a product draft collection. These are read in multiple pages with a defined page size. * @summary Read a product draft collection. * @param {string} filterShopCode The shopCode used internally to distinguish between clients. * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [filterProductNumber] Filter by a productNumber * @param {'pending' | 'accepted' | 'declined'} [filterProductDraftStatus] Filter by a product draft status * @param {string} [filterSearch] Filter for product draft search. \\ Usage: - Provide one or multiple search terms (min. 2 characters) to filter results. - Multiple search terms are separated by spaces. - The search is not case sensitive. - The search is only enabled for the productNumber. - Each search term filters the response for products where the productNumber contains the search term. - For example, filter[search]=\'term1 term2\' will filter the result for products where \'term1\' is found in the productNumber and \'term2\' is also found in the productNumber. If only \'term1\' or \'term2\' is found in the productNumber, the product is not included in the results. * @param {string} [filterProductDraftDateFrom] Filter for productDraftDate Format Y-m-d * @param {string} [filterProductDraftDateTo] Filter for productDraftDate Format Y-m-d * @param {string} [sortBy] Sort the results by one or more comma-separated sort criteria, with the criterion specified first having priority. Available sort orders: - asc: ascending order - desc: descending order Available fields for sorting: - productDraftDate The default sort order is productDraftDate:desc. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProductDraftCollection(filterShopCode, page, pageSize, paginationMode, filterProductNumber, filterProductDraftStatus, filterSearch, filterProductDraftDateFrom, filterProductDraftDateTo, sortBy, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.getProductDraftCollection(filterShopCode, page, pageSize, paginationMode, filterProductNumber, filterProductDraftStatus, filterSearch, filterProductDraftDateFrom, filterProductDraftDateTo, sortBy, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Create a new product draft to initiate the creation new products.Product drafts will be put into a queue for manual approval. * @summary Create a new product draft to initiate the creation new products. * @param {string} shopCode The shopCode used internally to distinguish between clients. * @param {NewProductDraft} newProductDraft * @param {*} [options] Override http request option. * @throws {RequiredError} */ postProductDraft(shopCode, newProductDraft, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.postProductDraft(shopCode, newProductDraft, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Import one or more new product draft(s). The file type is controlled by the content type attribute of the uploaded file * @summary Import one or more new product drafts. * @param {File} file File to upload * @param {*} [options] Override http request option. * @throws {RequiredError} */ productDraftBulkImport(file, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.productDraftBulkImport(file, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, }; }; exports.ProductDraftApiFp = ProductDraftApiFp; /** * ProductDraftApi - factory interface * @export */ const ProductDraftApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.ProductDraftApiFp)(configuration); return { /** * Delete a product draft.\\ **The product draft may only be deleted while it is still in pending state.** * @summary Delete a product draft. * @param {string} productDraftId ID of the product draft * @param {string} shopCode The shopCode used internally to distinguish between clients. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteProductDraft(productDraftId, shopCode, options) { return localVarFp.deleteProductDraft(productDraftId, shopCode, options).then((request) => request(axios, basePath)); }, /** * Read the product draft specified by the given product draft ID. * @summary Read the product draft specified by the given product draft ID. * @param {string} productDraftId ID of the product draft * @param {string} shopCode The shopCode used internally to distinguish between clients. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProductDraft(productDraftId, shopCode, options) { return localVarFp.getProductDraft(productDraftId, shopCode, options).then((request) => request(axios, basePath)); }, /** * Get a spreadsheet template for performing POST queries to the respective endpoint. The file type is controlled by the accept header. The fill-in help in the second line can be removed or remain. * @summary Get a spreadsheet template for performing POST queries to the respective endpoint. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProductDraftBulkImportTemplate(options) { return localVarFp.getProductDraftBulkImportTemplate(options).then((request) => request(axios, basePath)); }, /** * Read a product draft collection. These are read in multiple pages with a defined page size. * @summary Read a product draft collection. * @param {string} filterShopCode The shopCode used internally to distinguish between clients. * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [filterProductNumber] Filter by a productNumber * @param {'pending' | 'accepted' | 'declined'} [filterProductDraftStatus] Filter by a product draft status * @param {string} [filterSearch] Filter for product draft search. \\ Usage: - Provide one or multiple search terms (min. 2 characters) to filter results. - Multiple search terms are separated by spaces. - The search is not case sensitive. - The search is only enabled for the productNumber. - Each search term filters the response for products where the productNumber contains the search term. - For example, filter[search]=\'term1 term2\' will filter the result for products where \'term1\' is found in the productNumber and \'term2\' is also found in the productNumber. If only \'term1\' or \'term2\' is found in the productNumber, the product is not included in the results. * @param {string} [filterProductDraftDateFrom] Filter for productDraftDate Format Y-m-d * @param {string} [filterProductDraftDateTo] Filter for productDraftDate Format Y-m-d * @param {string} [sortBy] Sort the results by one or more comma-separated sort criteria, with the criterion specified first having priority. Available sort orders: - asc: ascending order - desc: descending order Available fields for sorting: - productDraftDate The default sort order is productDraftDate:desc. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProductDraftCollection(filterShopCode, page, pageSize, paginationMode, filterProductNumber, filterProductDraftStatus, filterSearch, filterProductDraftDateFrom, filterProductDraftDateTo, sortBy, options) { return localVarFp.getProductDraftCollection(filterShopCode, page, pageSize, paginationMode, filterProductNumber, filterProductDraftStatus, filterSearch, filterProductDraftDateFrom, filterProductDraftDateTo, sortBy, options).then((request) => request(axios, basePath)); }, /** * Create a new product draft to initiate the creation new products.Product drafts will be put into a queue for manual approval. * @summary Create a new product draft to initiate the creation new products. * @param {string} shopCode The shopCode used internally to distinguish between clients. * @param {NewProductDraft} newProductDraft * @param {*} [options] Override http request option. * @throws {RequiredError} */ postProductDraft(shopCode, newProductDraft, options) { return localVarFp.postProductDraft(shopCode, newProductDraft, options).then((request) => request(axios, basePath)); }, /** * Import one or more new product draft(s). The file type is controlled by the content type attribute of the uploaded file * @summary Import one or more new product drafts. * @param {File} file File to upload * @param {*} [options] Override http request option. * @throws {RequiredError} */ productDraftBulkImport(file, options) { return localVarFp.productDraftBulkImport(file, options).then((request) => request(axios, basePath)); }, }; }; exports.ProductDraftApiFactory = ProductDraftApiFactory; /** * ProductDraftApi - object-oriented interface * @export * @class ProductDraftApi * @extends {BaseAPI} */ class ProductDraftApi extends base_1.BaseAPI { /** * Delete a product draft.\\ **The product draft may only be deleted while it is still in pending state.** * @summary Delete a product draft. * @param {string} productDraftId ID of the product draft * @param {string} shopCode The shopCode used internally to distinguish between clients. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProductDraftApi */ deleteProductDraft(productDraftId, shopCode, options) { return (0, exports.ProductDraftApiFp)(this.configuration).deleteProductDraft(productDraftId, shopCode, options).then((request) => request(this.axios, this.basePath)); } /** * Read the product draft specified by the given product draft ID. * @summary Read the product draft specified by the given product draft ID. * @param {string} productDraftId ID of the product draft * @param {string} shopCode The shopCode used internally to distinguish between clients. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProductDraftApi */ getProductDraft(productDraftId, shopCode, options) { return (0, exports.ProductDraftApiFp)(this.configuration).getProductDraft(productDraftId, shopCode, options).then((request) => request(this.axios, this.basePath)); } /** * Get a spreadsheet template for performing POST queries to the respective endpoint. The file type is controlled by the accept header. The fill-in help in the second line can be removed or remain. * @summary Get a spreadsheet template for performing POST queries to the respective endpoint. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProductDraftApi */ getProductDraftBulkImportTemplate(options) { return (0, exports.ProductDraftApiFp)(this.configuration).getProductDraftBulkImportTemplate(options).then((request) => request(this.axios, this.basePath)); } /** * Read a product draft collection. These are read in multiple pages with a defined page size. * @summary Read a product draft collection. * @param {string} filterShopCode The shopCode used internally to distinguish between clients. * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [filterProductNumber] Filter by a productNumber * @param {'pending' | 'accepted' | 'declined'} [filterProductDraftStatus] Filter by a product draft status * @param {string} [filterSearch] Filter for product draft search. \\ Usage: - Provide one or multiple search terms (min. 2 characters) to filter results. - Multiple search terms are separated by spaces. - The search is not case sensitive. - The search is only enabled for the productNumber. - Each search term filters the response for products where the productNumber contains the search term. - For example, filter[search]=\'term1 term2\' will filter the result for products where \'term1\' is found in the productNumber and \'term2\' is also found in the productNumber. If only \'term1\' or \'term2\' is found in the productNumber, the product is not included in the results. * @param {string} [filterProductDraftDateFrom] Filter for productDraftDate Format Y-m-d * @param {string} [filterProductDraftDateTo] Filter for productDraftDate Format Y-m-d * @param {string} [sortBy] Sort the results by one or more comma-separated sort criteria, with the criterion specified first having priority. Available sort orders: - asc: ascending order - desc: descending order Available fields for sorting: - productDraftDate The default sort order is productDraftDate:desc. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProductDraftApi */ getProductDraftCollection(filterShopCode, page, pageSize, paginationMode, filterProductNumber, filterProductDraftStatus, filterSearch, filterProductDraftDateFrom, filterProductDraftDateTo, sortBy, options) { return (0, exports.ProductDraftApiFp)(this.configuration).getProductDraftCollection(filterShopCode, page, pageSize, paginationMode, filterProductNumber, filterProductDraftStatus, filterSearch, filterProductDraftDateFrom, filterProductDraftDateTo, sortBy, options).then((request) => request(this.axios, this.basePath)); } /** * Create a new product draft to initiate the creation new products.Product drafts will be put into a queue for manual approval. * @summary Create a new product draft to initiate the creation new products. * @param {string} shopCode The shopCode used internally to distinguish between clients. * @param {NewProductDraft} newProductDraft * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProductDraftApi */ postProductDraft(shopCode, newProductDraft, options) { return (0, exports.ProductDraftApiFp)(this.configuration).postProductDraft(shopCode, newProductDraft, options).then((request) => request(this.axios, this.basePath)); } /** * Import one or more new product draft(s). The file type is controlled by the content type attribute of the uploaded file * @summary Import one or more new product drafts. * @param {File} file File to upload * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProductDraftApi */ productDraftBulkImport(file, options) { return (0, exports.ProductDraftApiFp)(this.configuration).productDraftBulkImport(file, options).then((request) => request(this.axios, this.basePath)); } } exports.ProductDraftApi = ProductDraftApi;