/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: d99973e217b6 */ import { clientCollectionsAddItems } from "../funcs/clientCollectionsAddItems.js"; import { clientCollectionsCreate } from "../funcs/clientCollectionsCreate.js"; import { clientCollectionsDelete } from "../funcs/clientCollectionsDelete.js"; import { clientCollectionsDeleteItem } from "../funcs/clientCollectionsDeleteItem.js"; import { clientCollectionsList } from "../funcs/clientCollectionsList.js"; import { clientCollectionsRetrieve } from "../funcs/clientCollectionsRetrieve.js"; import { clientCollectionsUpdate } from "../funcs/clientCollectionsUpdate.js"; import { clientCollectionsUpdateItem } from "../funcs/clientCollectionsUpdateItem.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 Collections extends ClientSDK { /** * Add Collection item * * @remarks * Add items to a Collection. */ async addItems( addCollectionItemsRequest: components.AddCollectionItemsRequest, locale?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(clientCollectionsAddItems( this, addCollectionItemsRequest, locale, options, )); } /** * Create Collection * * @remarks * Create a publicly visible (empty) Collection of documents. */ async create( createCollectionRequest: components.CreateCollectionRequest, locale?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(clientCollectionsCreate( this, createCollectionRequest, locale, options, )); } /** * Delete Collection * * @remarks * Delete a Collection given the Collection's ID. */ async delete( deleteCollectionRequest: components.DeleteCollectionRequest, locale?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(clientCollectionsDelete( this, deleteCollectionRequest, locale, options, )); } /** * Delete Collection item * * @remarks * Delete a single item from a Collection. */ async deleteItem( deleteCollectionItemRequest: components.DeleteCollectionItemRequest, locale?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(clientCollectionsDeleteItem( this, deleteCollectionItemRequest, locale, options, )); } /** * Update Collection * * @remarks * Update the properties of an existing Collection. */ async update( editCollectionRequest: components.EditCollectionRequest, locale?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(clientCollectionsUpdate( this, editCollectionRequest, locale, options, )); } /** * Update Collection item * * @remarks * Update the URL, Glean Document ID, description of an item within a Collection given its ID. */ async updateItem( editCollectionItemRequest: components.EditCollectionItemRequest, locale?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(clientCollectionsUpdateItem( this, editCollectionItemRequest, locale, options, )); } /** * Read Collection * * @remarks * Read the details of a Collection given its ID. Does not fetch items in this Collection. */ async retrieve( getCollectionRequest: components.GetCollectionRequest, locale?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(clientCollectionsRetrieve( this, getCollectionRequest, locale, options, )); } /** * List Collections * * @remarks * List all existing Collections. */ async list( listCollectionsRequest: components.ListCollectionsRequest, locale?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(clientCollectionsList( this, listCollectionsRequest, locale, options, )); } }