export type DeleteApiApiV1LandingTranslationLandingIdLanguageCodeArgs = {landing_id: string, language_code: string}; export type DeleteApiApiV1LandingTranslationLandingIdLanguageCodeOptions = {baseUrl: string, OAuth2PasswordBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete landing translation * * DELETE /api/v1/landing/translation/{landing_id}/{language_code} */ export const deleteApiApiV1LandingTranslationLandingIdLanguageCode = async (args: DeleteApiApiV1LandingTranslationLandingIdLanguageCodeArgs, options: DeleteApiApiV1LandingTranslationLandingIdLanguageCodeOptions) => { const {baseUrl, fetch: fetchFn = fetch, OAuth2PasswordBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuth2PasswordBearer !== undefined) headers.set('authorization', `Bearer ${OAuth2PasswordBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/landing/translation/${encodeURIComponent(String(args.landing_id))}/${encodeURIComponent(String(args.language_code))}${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 };