export type DeleteApiAddressLayoutsV2NameArgs = {'Reference-Id'?: string | undefined, name: string}; export type DeleteApiAddressLayoutsV2NameOptions = {baseUrl?: string | undefined, OAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an address layout. * * DELETE /address/layouts/v2/{name} * * Also accepts auth: Auth-Token, x-app-key */ export const deleteApiAddressLayoutsV2Name = async (args: DeleteApiAddressLayoutsV2NameArgs, options?: DeleteApiAddressLayoutsV2NameOptions) => { const {baseUrl = "https://api.experianaperture.io", fetch: fetchFn = fetch, OAuth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Reference-Id'] != null) headers.set("Reference-Id", String(args['Reference-Id'])) if (OAuth2 !== undefined) headers.set('authorization', `Bearer ${OAuth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/address/layouts/v2/${encodeURIComponent(String(args.name))}${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 };