export type DeleteApiV20ProjectsProjectIdSnippetsSnippetIdArgs = {Accept?: ('application/json' | 'application/hal+json' | 'application/xml' | 'text/xml' | 'text/csv') | undefined, projectId: string, snippetId: string}; export type DeleteApiV20ProjectsProjectIdSnippetsSnippetIdOptions = {baseUrl?: string | undefined, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a Token * * DELETE /v2.0/projects/{projectId}/snippets/{snippetId} * * Also accepts auth: APIKeyQueryParam, CXoneTokenHeader, OAuth2 */ export const deleteApiV20ProjectsProjectIdSnippetsSnippetId = async (args: DeleteApiV20ProjectsProjectIdSnippetsSnippetIdArgs, options?: DeleteApiV20ProjectsProjectIdSnippetsSnippetIdOptions) => { 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/projects/${encodeURIComponent(String(args.projectId))}/snippets/${encodeURIComponent(String(args.snippetId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };