export type DeleteApiCustomsImportsOutcomesCorrelationIdArgs = {correlationId: string, Accept: 'application/vnd.hmrc.1.0+xml', Authorization: 'Bearer bb7fed3fe10dd235a2ccda3d50fb'}; export type DeleteApiCustomsImportsOutcomesCorrelationIdOptions = {baseUrl?: string | undefined, UserRestricted?: string | undefined, fetch?: typeof fetch | undefined}; /** * Acknowledge an outcome * * DELETE /customs/imports/outcomes/{correlationId} */ export const deleteApiCustomsImportsOutcomesCorrelationId = async (args: DeleteApiCustomsImportsOutcomesCorrelationIdArgs, options?: DeleteApiCustomsImportsOutcomesCorrelationIdOptions) => { const {baseUrl = "https://test-api.service.hmrc.gov.uk", fetch: fetchFn = fetch, UserRestricted} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.Accept != null) headers.set("Accept", String(args.Accept)) if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) if (UserRestricted !== undefined) headers.set('authorization', `Bearer ${UserRestricted}`) const url = `${baseUrl.replace(/\/+$/, '')}/customs/imports/outcomes/${encodeURIComponent(String(args.correlationId))}${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 };