export type DeleteApiApiV2BrandsBrandIdArgs = {brand_id: number}; export type DeleteApiApiV2BrandsBrandIdOptions = {baseUrl?: string | undefined, apiTokenAuth?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete a Brand * * DELETE /api/v2/brands/{brand_id} */ export const deleteApiApiV2BrandsBrandId = async (args: DeleteApiApiV2BrandsBrandIdArgs, options?: DeleteApiApiV2BrandsBrandIdOptions) => { const {baseUrl = "https://example.zendesk.com", fetch: fetchFn = fetch, apiTokenAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiTokenAuth !== undefined) headers.set('authorization', `Basic ${btoa(`${apiTokenAuth.username}:${apiTokenAuth.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/brands/${encodeURIComponent(String(args.brand_id))}${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 };