export type LightingSystemName = {name?: (string | null) | undefined}; export type PatchApiAvxLightingsystemV1LightingsystemsLightingSystemIdentifierArgs = {lightingSystemIdentifier: string, body: LightingSystemName}; export type PatchApiAvxLightingsystemV1LightingsystemsLightingSystemIdentifierOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Update the name of an existing lighting system. * * PATCH /avx-lightingsystem/v1/lightingsystems/{lightingSystemIdentifier} */ export const patchApiAvxLightingsystemV1LightingsystemsLightingSystemIdentifier = async (args: PatchApiAvxLightingsystemV1LightingsystemsLightingSystemIdentifierArgs, options: PatchApiAvxLightingsystemV1LightingsystemsLightingSystemIdentifierOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/avx-lightingsystem/v1/lightingsystems/${encodeURIComponent(String(args.lightingSystemIdentifier))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };