export type MotionStreamConfiguration = {host: string, secure_connection?: boolean | undefined, cell: string, motion_group: string, controller?: string | undefined, response_rate?: number | undefined, use_external_joint_stream?: boolean | undefined}; export type UpdateApiManipulatorsMotionGroupsPrimPathArgs = {prim_path: string, body: MotionStreamConfiguration}; export type UpdateApiManipulatorsMotionGroupsPrimPathOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Update Motion Group Motion Stream * * PUT /manipulators/motion-groups/{prim_path} */ export const updateApiManipulatorsMotionGroupsPrimPath = async (args: UpdateApiManipulatorsMotionGroupsPrimPathArgs, options: UpdateApiManipulatorsMotionGroupsPrimPathOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/manipulators/motion-groups/${encodeURIComponent(String(args.prim_path))}${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 };