export type GetApiAvxLightingsystemV1LightingsystemsLightingSystemIdentifierPackedArgs = {lightingSystemIdentifier: string, fileName?: (string | null) | undefined}; export type GetApiAvxLightingsystemV1LightingsystemsLightingSystemIdentifierPackedOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Download a packed lighting system to a file with the specified name or as json string. * * GET /avx-lightingsystem/v1/lightingsystems/{lightingSystemIdentifier}/packed */ export const getApiAvxLightingsystemV1LightingsystemsLightingSystemIdentifierPacked = async (args: GetApiAvxLightingsystemV1LightingsystemsLightingSystemIdentifierPackedArgs, options: GetApiAvxLightingsystemV1LightingsystemsLightingSystemIdentifierPackedOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.fileName != null) query.append("fileName", String(args.fileName)) const url = `${baseUrl.replace(/\/+$/, '')}/avx-lightingsystem/v1/lightingsystems/${encodeURIComponent(String(args.lightingSystemIdentifier))}/packed${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };