export type DeleteApiDocumentDocumentSlugArgs = {document_slug: string, Accept: 'application/vnd.Creative Force.v2.3+json' | 'application/vnd.Creative Force.v2.3+xml', 'x-api-language'?: (Array<'all' | 'ar_AR' | 'bg_BG' | 'bn_IN' | 'ca_ES' | 'cs_CZ' | 'cy_GB' | 'da_DK' | 'de_DE' | 'en_GB' | 'en_US' | 'el_GR' | 'es_NN' | 'es_LA' | 'et_EE' | 'fa_NN' | 'fi_FI' | 'fr_FR' | 'fr_CA' | 'he_IL' | 'hi_IN' | 'hr_HR' | 'hu_HU' | 'hy_AM' | 'it_IT' | 'ja_JP' | 'ko_KR' | 'lt_LT' | 'ms_MY' | 'nl_NL' | 'nb_NO' | 'pl_PL' | 'pt_BR' | 'ro_RO' | 'ru_RU' | 'sk_SK' | 'sl_SI' | 'sq_AL' | 'sr_RS' | 'sv_SE' | 'sw_NN' | 'th_TH' | 'tr_TR' | 'uk_UA' | 'vi_VN' | 'zh_CN' | 'zh_HK'>) | undefined}; export type DeleteApiDocumentDocumentSlugOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a document * * DELETE /document/{document_slug} */ export const deleteApiDocumentDocumentSlug = async (args: DeleteApiDocumentDocumentSlugArgs, options?: DeleteApiDocumentDocumentSlugOptions) => { const {baseUrl = "https://api.us.cr4ce.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.Accept != null) headers.set("Accept", String(args.Accept)) if (args['x-api-language'] != null) headers.set("x-api-language", args['x-api-language'].join(',')) if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/document/${encodeURIComponent(String(args.document_slug))}${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 };