// 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 { RequestOptions } from '../../internal/request-options'; import { path } from '../../internal/utils/path'; export class Collections extends APIResource { /** * Create a collection */ create( id: string, body: CollectionCreateParams, options?: RequestOptions, ): APIPromise { return this._client.post(path`/knowledge-bases/${id}/collections`, { body, ...options }); } /** * Get collections in a knowledge base */ list(id: string, options?: RequestOptions): APIPromise { return this._client.get(path`/knowledge-bases/${id}/collections`, options); } } export interface Collection { id?: string; created_at?: string; description?: string; parent_collection_id?: string; slug?: string; title?: string; } export interface CollectionCreateResponse { data?: Collection; request_id?: string; } export interface CollectionListResponse { data?: Array; request_id?: string; } export interface CollectionCreateParams { /** * The title of the collection */ title: string; /** * The description of the collection */ description?: string; /** * The ID of the parent collection */ parent_collection_id?: string; /** * The slug of the collection */ slug?: string; } export declare namespace Collections { export { type Collection as Collection, type CollectionCreateResponse as CollectionCreateResponse, type CollectionListResponse as CollectionListResponse, type CollectionCreateParams as CollectionCreateParams, }; }