export type LocationConsumptionType = 10 | 20; export type UpdateLocationDetailsRequest = {name?: (string | null) | undefined, shortName?: (string | null) | undefined, coordinates?: (string | null) | undefined, isCabinet?: boolean | undefined, isScale?: boolean | undefined, isLock?: boolean | undefined, hasDedicatedDevice?: boolean | undefined, ioid?: (string | null) | undefined, disableSubmitConfirmation?: boolean | undefined, anonymousDefaultOperationId?: number | undefined, defaultReceptionOperationId?: number | undefined, notificationsEnabled?: boolean | undefined, notificationReceivers?: (Array | null) | undefined, properties?: ({[key: string]: string} | null) | undefined, consumptionType?: LocationConsumptionType | undefined}; export type UpdateApiV1LocationsLocationIdArgs = {locationId: number, Account: unknown, body: UpdateLocationDetailsRequest}; export type UpdateApiV1LocationsLocationIdOptions = {baseUrl: string, OAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update location details * * PUT /v1/Locations/{locationId} */ export const updateApiV1LocationsLocationId = async (args: UpdateApiV1LocationsLocationIdArgs, options: UpdateApiV1LocationsLocationIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, OAuth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json-patch+json; x-api-version=1.0") if (args.Account != null) query.append("Account", String(args.Account)) if (OAuth2 !== undefined) headers.set('authorization', `Bearer ${OAuth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/Locations/${encodeURIComponent(String(args.locationId))}${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 };