export type DeleteApiFloorplansPropertyIdMediaMediaIdArgs = {property_id: string, media_id: string}; export type DeleteApiFloorplansPropertyIdMediaMediaIdOptions = {baseUrl?: string | undefined, yourApiToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a floorplan from a property * * DELETE /floorplans/{property_id}/media/{media_id} */ export const deleteApiFloorplansPropertyIdMediaMediaId = async (args: DeleteApiFloorplansPropertyIdMediaMediaIdArgs, options?: DeleteApiFloorplansPropertyIdMediaMediaIdOptions) => { const {baseUrl = "https://street.co.uk/open-api/v1", fetch: fetchFn = fetch, yourApiToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (yourApiToken !== undefined) headers.set('authorization', `Bearer ${yourApiToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/floorplans/${encodeURIComponent(String(args.property_id))}/media/${encodeURIComponent(String(args.media_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 };