omnisend-node-sdk
Version:
🔹 Typesafe Omnisend API SDK for Node.js
61 lines (60 loc) • 2.78 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Categories = void 0;
const http_client_1 = require("../http-client");
class Categories {
constructor(http) {
/**
* No description
*
* @tags Products
* @name GetCategoriesCategoryId
* @summary Get category
* @request GET:/categories/{categoryID}
* @secure
*/
this.getCategoriesCategoryId = (categoryId, params = {}) => this.http.request(Object.assign({ path: `/categories/${categoryId}`, method: "GET", secure: true, format: "json" }, params));
/**
* @description Replace category. Pass all category info. Not passed fields will be deleted. For example if `createdAt` won't be passed, it will be overwritten with current date.
*
* @tags Products
* @name PutCategories
* @summary Replace category
* @request PUT:/categories/{categoryID}
* @secure
*/
this.putCategories = (categoryId, data, params = {}) => this.http.request(Object.assign({ path: `/categories/${categoryId}`, method: "PUT", body: data, secure: true, type: http_client_1.ContentType.Json, format: "json" }, params));
/**
* @description Delete category
*
* @tags Products
* @name DeleteCategory
* @summary Delete category
* @request DELETE:/categories/{categoryID}
* @secure
*/
this.deleteCategory = (categoryId, params = {}) => this.http.request(Object.assign({ path: `/categories/${categoryId}`, method: "DELETE", secure: true }, params));
/**
* @description **Sorting:** | **Parameter** | **Sort order** | **Description** | | --- | ---| --- | |title|ASC|Category title| | createdAt | DESC | Category creation date - recent first | | updatedAt | DESC | Category update date - recent first |
*
* @tags Products
* @name GetCategories
* @summary List categories
* @request GET:/categories
* @secure
*/
this.getCategories = (query, params = {}) => this.http.request(Object.assign({ path: `/categories`, method: "GET", query, secure: true, format: "json" }, params));
/**
* @description Create new category.
*
* @tags Products
* @name PostCategories
* @summary Create category
* @request POST:/categories
* @secure
*/
this.postCategories = (data, params = {}) => this.http.request(Object.assign({ path: `/categories`, method: "POST", body: data, secure: true, type: http_client_1.ContentType.Json, format: "json" }, params));
this.http = http;
}
}
exports.Categories = Categories;