export type DeleteApiV0EnterpriseEnterpriseIdGeofenceGeofenceIdArgs = {geofence_id: string, enterprise_id: string}; export type DeleteApiV0EnterpriseEnterpriseIdGeofenceGeofenceIdOptions = {baseUrl?: string | undefined, esperCloudApiApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a geofence * * DELETE /v0/enterprise/{enterprise_id}/geofence/{geofence_id}/ */ export const deleteApiV0EnterpriseEnterpriseIdGeofenceGeofenceId = async (args: DeleteApiV0EnterpriseEnterpriseIdGeofenceGeofenceIdArgs, options?: DeleteApiV0EnterpriseEnterpriseIdGeofenceGeofenceIdOptions) => { const {baseUrl = "https://develop-api.esper.cloud/api", fetch: fetchFn = fetch, esperCloudApiApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (esperCloudApiApiKey !== undefined) headers.set('authorization', `Bearer ${esperCloudApiApiKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/v0/enterprise/${encodeURIComponent(String(args.enterprise_id))}/geofence/${encodeURIComponent(String(args.geofence_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 };