export type DeleteApiV1AdminMeterAdsIdArgs = {id: string}; export type DeleteApiV1AdminMeterAdsIdOptions = {baseUrl: string, accessToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a meter ad * * DELETE /v1/admin/meter-ads/{id} */ export const deleteApiV1AdminMeterAdsId = async (args: DeleteApiV1AdminMeterAdsIdArgs, options: DeleteApiV1AdminMeterAdsIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, accessToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (accessToken !== undefined) headers.set('authorization', `Bearer ${accessToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/admin/meter-ads/${encodeURIComponent(String(args.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 };