export type Entrance = {entrance_id: string, pos_id: 3 | 6 | 9 | 11, name?: string | undefined, customer_id?: string | undefined, resort_name?: string | undefined, customer_category_name?: string | undefined, external_order_id?: string | undefined, external_entrance_id?: string | undefined, external_turnstile_permission_id?: string | undefined, entrance_type_id?: (0 | 1 | 2) | undefined, order_item_id?: string | undefined, card_id: string, created_at?: string | undefined, cancelled_at?: string | undefined, charged_price?: number | undefined, product_ids?: string | undefined, charge_date?: string | undefined, valid_from?: string | undefined, valid_to?: string | undefined, last_change?: string | undefined, state: 0 | 1}; export type UpdateApiEntrancesEntranceIdArgs = {'Accept-Language'?: string | undefined, entrance_id: string, body: {entrance: Entrance}}; export type UpdateApiEntrancesEntranceIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update an entrance * * PUT /entrances/{entrance_id} * * Also accepts auth: basicAuth */ export const updateApiEntrancesEntranceId = async (args: UpdateApiEntrancesEntranceIdArgs, options?: UpdateApiEntrancesEntranceIdOptions) => { const {baseUrl = "https://sandbox.crmcarecloud.com/webservice/rest-api/enterprise-interface/v1.0", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['Accept-Language'] != null) headers.set("Accept-Language", String(args['Accept-Language'])) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/entrances/${encodeURIComponent(String(args.entrance_id))}${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 };