channel3-sdk
Version:
The official TypeScript/JavaScript SDK for Channel3 AI Shopping API
188 lines • 7.98 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* FastAPI
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Channel3ApiApi = void 0;
const runtime = __importStar(require("../runtime"));
const index_1 = require("../models/index");
/**
*
*/
class Channel3ApiApi extends runtime.BaseAPI {
/**
* Get detailed information for a specific brand by its ID.
* Get Brand Detail
*/
async getBrandDetailV0BrandsBrandIdGetRaw(requestParameters, initOverrides) {
if (requestParameters['brandId'] == null) {
throw new runtime.RequiredError('brandId', 'Required parameter "brandId" was null or undefined when calling getBrandDetailV0BrandsBrandIdGet().');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // APIKeyHeader authentication
}
let urlPath = `/v0/brands/{brand_id}`;
urlPath = urlPath.replace(`{${"brand_id"}}`, encodeURIComponent(String(requestParameters['brandId'])));
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.BrandFromJSON)(jsonValue));
}
/**
* Get detailed information for a specific brand by its ID.
* Get Brand Detail
*/
async getBrandDetailV0BrandsBrandIdGet(requestParameters, initOverrides) {
const response = await this.getBrandDetailV0BrandsBrandIdGetRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get all brands that the vendor currently sells.
* Get Brands
*/
async getBrandsV0BrandsGetRaw(requestParameters, initOverrides) {
const queryParameters = {};
if (requestParameters['query'] != null) {
queryParameters['query'] = requestParameters['query'];
}
if (requestParameters['page'] != null) {
queryParameters['page'] = requestParameters['page'];
}
if (requestParameters['size'] != null) {
queryParameters['size'] = requestParameters['size'];
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // APIKeyHeader authentication
}
let urlPath = `/v0/brands`;
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedResponseBrandFromJSON)(jsonValue));
}
/**
* Get all brands that the vendor currently sells.
* Get Brands
*/
async getBrandsV0BrandsGet(requestParameters = {}, initOverrides) {
const response = await this.getBrandsV0BrandsGetRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get detailed information about a specific product by its ID.
* Get Product Detail
*/
async getProductDetailV0ProductsProductIdGetRaw(requestParameters, initOverrides) {
if (requestParameters['productId'] == null) {
throw new runtime.RequiredError('productId', 'Required parameter "productId" was null or undefined when calling getProductDetailV0ProductsProductIdGet().');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // APIKeyHeader authentication
}
let urlPath = `/v0/products/{product_id}`;
urlPath = urlPath.replace(`{${"product_id"}}`, encodeURIComponent(String(requestParameters['productId'])));
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ProductDetailFromJSON)(jsonValue));
}
/**
* Get detailed information about a specific product by its ID.
* Get Product Detail
*/
async getProductDetailV0ProductsProductIdGet(requestParameters, initOverrides) {
const response = await this.getProductDetailV0ProductsProductIdGetRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Search for products.
* Search
*/
async searchV0SearchPostRaw(requestParameters, initOverrides) {
if (requestParameters['searchRequest'] == null) {
throw new runtime.RequiredError('searchRequest', 'Required parameter "searchRequest" was null or undefined when calling searchV0SearchPost().');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // APIKeyHeader authentication
}
let urlPath = `/v0/search`;
const response = await this.request({
path: urlPath,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.SearchRequestToJSON)(requestParameters['searchRequest']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.ProductFromJSON));
}
/**
* Search for products.
* Search
*/
async searchV0SearchPost(requestParameters, initOverrides) {
const response = await this.searchV0SearchPostRaw(requestParameters, initOverrides);
return await response.value();
}
}
exports.Channel3ApiApi = Channel3ApiApi;
//# sourceMappingURL=Channel3ApiApi.js.map