export type UpdateTeamMembersRequest = {userIds: Array, title?: (string | null) | undefined, permissionLevel?: ('Level1' | 'Level2' | 'Level3' | 'Level4' | 'Level5' | null) | undefined, isActive?: (boolean | null) | undefined, roleIds?: (Array | null) | undefined}; export type PatchApiV4OrganizationsTeamArgs = {body: UpdateTeamMembersRequest}; export type PatchApiV4OrganizationsTeamOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates Team Members * * PATCH /v4/organizations/team */ export const patchApiV4OrganizationsTeam = async (args: PatchApiV4OrganizationsTeamArgs, options?: PatchApiV4OrganizationsTeamOptions) => { const {baseUrl = "https://submittable-api.submittable.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v4/organizations/team${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 };