/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { wordlistGetEmbeddingStatus } from "../funcs/wordlist-get-embedding-status.js"; import { wordlistList } from "../funcs/wordlist-list.js"; import { wordlistRetrieve } from "../funcs/wordlist-retrieve.js"; import { wordlistUpdate } from "../funcs/wordlist-update.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; import { PageIterator, unwrapResultIterator } from "../types/operations.js"; import { Words } from "./words.js"; export class Wordlist extends ClientSDK { private _words?: Words; get words(): Words { return (this._words ??= new Words(this._options)); } /** * List wordlists * * @remarks * List the wordlists of the organization. The list is paginated. */ async list( page?: number | undefined, pageSize?: number | undefined, projectId?: string | undefined, options?: RequestOptions, ): Promise> { return unwrapResultIterator(wordlistList( this, page, pageSize, projectId, options, )); } /** * Get wordlist * * @remarks * Get a specific wordlist by ID */ async retrieve( id: string, projectId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(wordlistRetrieve( this, id, projectId, options, )); } /** * Update wordlist * * @remarks * Update a wordlist */ async update( id: string, body: operations.UpdateWordlistRequestBody, projectId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(wordlistUpdate( this, id, body, projectId, options, )); } /** * Get embedding status * * @remarks * Get the current embedding progress status for a wordlist */ async getEmbeddingStatus( id: string, projectId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(wordlistGetEmbeddingStatus( this, id, projectId, options, )); } }