export type GetApiV1GroupsIdUsersArgs = {id: number, updated_after?: string | undefined, 'X-Time-Zone'?: string | undefined, 'X-Metric-Units'?: boolean | undefined, 'X-User-Id'?: number | undefined}; export type GetApiV1GroupsIdUsersOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * List all the users of a group * * GET /v1/groups/{id}/users */ export const getApiV1GroupsIdUsers = async (args: GetApiV1GroupsIdUsersArgs, options?: GetApiV1GroupsIdUsersOptions) => { const {baseUrl = "https://api.gomotive.com", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.updated_after != null) query.append("updated_after", String(args.updated_after)) if (args['X-Time-Zone'] != null) headers.set("X-Time-Zone", String(args['X-Time-Zone'])) if (args['X-Metric-Units'] != null) headers.set("X-Metric-Units", String(args['X-Metric-Units'])) if (args['X-User-Id'] != null) headers.set("X-User-Id", String(args['X-User-Id'])) if (sec0 !== undefined) headers.set("x-api-key", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/v1/groups/${encodeURIComponent(String(args.id))}/users${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 (await res.json()) as unknown };