// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import { APIPromise } from '../core/api-promise'; import { PageCursorURL, PagePromise } from '../core/pagination'; import { buildHeaders } from '../internal/headers'; import { RequestOptions } from '../internal/request-options'; import { path } from '../internal/utils/path'; /** * Object Categories defined by the company */ export class ObjectCategories extends APIResource { /** * A list of object categories. * * - Requires: `API Tier 1` */ list(options?: RequestOptions): PagePromise { return this._client.getAPIList('/object-categories/', PageCursorURL, options); } /** * Create a new object category. */ create( body: ObjectCategoryCreateParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.post('/object-categories/', { body, ...options }); } /** * Retrieve a specific object category. */ retrieve(id: string, options?: RequestOptions): APIPromise { return this._client.get(path`/object-categories/${id}/`, options); } /** * Update a specific object category. */ update( id: string, body: ObjectCategoryUpdateParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.patch(path`/object-categories/${id}/`, { body, ...options }); } /** * Delete an object category. */ delete(id: string, options?: RequestOptions): APIPromise { return this._client.delete(path`/object-categories/${id}/`, { ...options, headers: buildHeaders([{ Accept: '*/*' }, options?.headers]), }); } } export type ObjectCategoriesPageCursorURL = PageCursorURL; export interface ObjectCategory { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * The name of the Custom Category */ name: string; /** * Record update date */ updated_at: string; /** * The description of the Custom Category */ description?: string; } export interface ObjectCategoryCreateParams { /** * A description of the category. */ description?: string; /** * The name of the category. */ name?: string; } export interface ObjectCategoryUpdateParams { /** * A description of the category. */ description?: string; /** * The name of the category. */ name?: string; } export declare namespace ObjectCategories { export { type ObjectCategory as ObjectCategory, type ObjectCategoriesPageCursorURL as ObjectCategoriesPageCursorURL, type ObjectCategoryCreateParams as ObjectCategoryCreateParams, type ObjectCategoryUpdateParams as ObjectCategoryUpdateParams, }; }