export type Vector3 = {x?: number | undefined, y?: number | undefined, z?: number | undefined}; export type Projector = {name?: (string | null) | undefined, translation?: Vector3 | undefined, rotation?: Vector3 | undefined}; export type PatchApiAvxLightingsystemV1LightingsystemsLightingSystemIdentifierProjectorsProjectorIdentifierArgs = {lightingSystemIdentifier: string, projectorIdentifier: number, body: Projector}; export type PatchApiAvxLightingsystemV1LightingsystemsLightingSystemIdentifierProjectorsProjectorIdentifierOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Update the properties of an existing projector. * * PATCH /avx-lightingsystem/v1/lightingsystems/{lightingSystemIdentifier}/projectors/{projectorIdentifier} */ export const patchApiAvxLightingsystemV1LightingsystemsLightingSystemIdentifierProjectorsProjectorIdentifier = async (args: PatchApiAvxLightingsystemV1LightingsystemsLightingSystemIdentifierProjectorsProjectorIdentifierArgs, options: PatchApiAvxLightingsystemV1LightingsystemsLightingSystemIdentifierProjectorsProjectorIdentifierOptions) => { 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))}/projectors/${encodeURIComponent(String(args.projectorIdentifier))}${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 };