export type PositionPointModel = {Longitude?: number | undefined, Latitude?: number | undefined}; export type Place3EditModel = {Name: string, Radius: number, PositionPoint: PositionPointModel, Description?: string | undefined, TripType?: (0 | 1 | 2 | 3) | undefined, TripTypeTrigger?: (0 | 1 | 2 | 3) | undefined, OrganizationNodeId?: number | undefined, DrivesBetweenAnotherPlaceId?: number | undefined}; export type UpdateApiV1ResourceownerPlace3PlaceIdArgs = {placeId: number, body: Place3EditModel}; export type UpdateApiV1ResourceownerPlace3PlaceIdOptions = {baseUrl: string, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates the given place with new model * * PUT /v1/resourceowner/place3/{placeId} */ export const updateApiV1ResourceownerPlace3PlaceId = async (args: UpdateApiV1ResourceownerPlace3PlaceIdArgs, options: UpdateApiV1ResourceownerPlace3PlaceIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/resourceowner/place3/${encodeURIComponent(String(args.placeId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };