export type DeleteApiV2PartitionPartitionIdAccountAccountIdDeviceMacAddressArgs = {accountId: string, macAddress: string, partitionId: string}; export type DeleteApiV2PartitionPartitionIdAccountAccountIdDeviceMacAddressOptions = {baseUrl?: string | undefined, XAuthToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete all devicelines (by mac) * * DELETE /v2/partition/{partitionId}/account/{accountId}/device/{macAddress} */ export const deleteApiV2PartitionPartitionIdAccountAccountIdDeviceMacAddress = async (args: DeleteApiV2PartitionPartitionIdAccountAccountIdDeviceMacAddressArgs, options?: DeleteApiV2PartitionPartitionIdAccountAccountIdDeviceMacAddressOptions) => { const {baseUrl = "https://api.alianza.com", fetch: fetchFn = fetch, XAuthToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (XAuthToken !== undefined) headers.set("X-AUTH-TOKEN", XAuthToken) const url = `${baseUrl.replace(/\/+$/, '')}/v2/partition/${encodeURIComponent(String(args.partitionId))}/account/${encodeURIComponent(String(args.accountId))}/device/${encodeURIComponent(String(args.macAddress))}${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 };