/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { categoriesCreateCategory } from "../funcs/categoriesCreateCategory.js"; import { categoriesGetCategory } from "../funcs/categoriesGetCategory.js"; import { categoriesGetSite } from "../funcs/categoriesGetSite.js"; import { categoriesListCategories } from "../funcs/categoriesListCategories.js"; import { categoriesListCategoryTopics } from "../funcs/categoriesListCategoryTopics.js"; import { categoriesUpdateCategory } from "../funcs/categoriesUpdateCategory.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "./models/operations/index.js"; import { unwrapAsync } from "./types/fp.js"; export class Categories extends ClientSDK { /** * Creates a category */ async createCategory( request?: operations.CreateCategoryRequestBody | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(categoriesCreateCategory( this, request, options, )); } /** * Show category */ async getCategory( id: number, options?: RequestOptions, ): Promise { return unwrapAsync(categoriesGetCategory( this, id, options, )); } /** * Get site info * * @remarks * Can be used to fetch all categories and subcategories */ async getSite( options?: RequestOptions, ): Promise { return unwrapAsync(categoriesGetSite( this, options, )); } /** * Retrieves a list of categories */ async listCategories( includeSubcategories?: boolean | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(categoriesListCategories( this, includeSubcategories, options, )); } /** * List topics */ async listCategoryTopics( id: number, slug: string, options?: RequestOptions, ): Promise { return unwrapAsync(categoriesListCategoryTopics( this, id, slug, options, )); } /** * Updates a category */ async updateCategory( id: number, requestBody?: operations.UpdateCategoryRequestBody | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(categoriesUpdateCategory( this, id, requestBody, options, )); } }