/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { catalogTypesCreate } from "../funcs/catalogTypesCreate.js"; import { catalogTypesDelete } from "../funcs/catalogTypesDelete.js"; import { catalogTypesList } from "../funcs/catalogTypesList.js"; import { catalogTypesShow } from "../funcs/catalogTypesShow.js"; import { catalogTypesUpdate } from "../funcs/catalogTypesUpdate.js"; import { catalogTypesUpdateSchema } from "../funcs/catalogTypesUpdateSchema.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class CatalogTypes extends ClientSDK { /** * ListTypes Catalog V2 * * @remarks * List all catalog types for an organisation, including those synced from external resources. */ async list( options?: RequestOptions, ): Promise { return unwrapAsync(catalogTypesList( this, options, )); } /** * CreateType Catalog V2 * * @remarks * Create a catalog type. The schema must be updated using the UpdateTypeSchema endpoint. */ async create( request: components.CreateTypeRequestBody, options?: RequestOptions, ): Promise { return unwrapAsync(catalogTypesCreate( this, request, options, )); } /** * DestroyType Catalog V2 * * @remarks * Archives a catalog type and associated entries. */ async delete( request: operations.CatalogV2NumberDestroyTypeRequest, options?: RequestOptions, ): Promise { return unwrapAsync(catalogTypesDelete( this, request, options, )); } /** * ShowType Catalog V2 * * @remarks * Show a single catalog type. */ async show( request: operations.CatalogV2NumberShowTypeRequest, options?: RequestOptions, ): Promise { return unwrapAsync(catalogTypesShow( this, request, options, )); } /** * UpdateType Catalog V2 * * @remarks * Updates an existing catalog type. The schema must be updated using the UpdateTypeSchema endpoint. */ async update( request: operations.CatalogV2NumberUpdateTypeRequest, options?: RequestOptions, ): Promise { return unwrapAsync(catalogTypesUpdate( this, request, options, )); } /** * UpdateTypeSchema Catalog V2 * * @remarks * Update an existing catalog types schema, adding or removing attributes. * * Updating the schema is handled separately from creating and updating types, so that you don't * have to worry about dependencies between types. For example, if type A has an attribute that * relies on type B, you would have to create type B first. * * By allowing the creation of types without a schema, they can be created in any order, but it * means that you need to make a separate call to this endpoint to update the schema. */ async updateSchema( request: operations.CatalogV2NumberUpdateTypeSchemaRequest, options?: RequestOptions, ): Promise { return unwrapAsync(catalogTypesUpdateSchema( this, request, options, )); } }