export type CreateApiV20LexiconsLexiconIdEntriesEntryIdSlotsSlotIdArgs = {Accept?: ('application/json' | 'application/hal+json' | 'application/xml' | 'text/xml' | 'text/csv') | undefined, lexiconId: string, entryId: string, slotId: string}; export type CreateApiV20LexiconsLexiconIdEntriesEntryIdSlotsSlotIdOptions = {baseUrl?: string | undefined, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a Lexicon Slot * * POST /v2.0/lexicons/{lexiconId}/entries/{entryId}/slots/{slotId} * * Also accepts auth: APIKeyQueryParam, CXoneTokenHeader, OAuth2 */ export const createApiV20LexiconsLexiconIdEntriesEntryIdSlotsSlotId = async (args: CreateApiV20LexiconsLexiconIdEntriesEntryIdSlotsSlotIdArgs, options?: CreateApiV20LexiconsLexiconIdEntriesEntryIdSlotsSlotIdOptions) => { const {baseUrl = "https://api-trial.cognigy.ai/testing", fetch: fetchFn = fetch, APIKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.Accept != null) headers.set("Accept", String(args.Accept)) if (APIKeyHeader !== undefined) headers.set("X-API-Key", APIKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/v2.0/lexicons/${encodeURIComponent(String(args.lexiconId))}/entries/${encodeURIComponent(String(args.entryId))}/slots/${encodeURIComponent(String(args.slotId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };