addOrInviteUsersToTeams

Function

addOrInviteUsersToTeams adds/invites N users to N teams Initial entry point function for add/invite members flow when dealing with multiple teams. Responses from each group are then consolidated into the final returned object.

  • addOrInviteUsersToTeams(groupIds: string[], users: IUserWithOrgType[], primaryRO: IAuthenticationManager, canAutoAddUser: boolean, addUserAsGroupAdmin: boolean, email: IAddOrInviteEmail) : Promise<{
    errors:
    ArcGISRequestError[]
    notAdded:
    string[]
    notEmailed:
    string[]
    notInvited:
    string[]
    responses:
    IAddOrInviteToTeamResult[]
    }>

Parameters

Parameter Type Default Notes
groupIds Required string[]

array of groups we are adding users to

users Required IUserWithOrgType[]

array of users to add to those teams

primaryRO Required IAuthenticationManager

primary requestOptions

canAutoAddUser Optional boolean false
addUserAsGroupAdmin Optional boolean false
email Optional IAddOrInviteEmail

Returns

{Promise<{ notAdded: string[]; notInvited: string[]; notEmailed: string[]; errors: ArcGISRequestError[]; responses: IAddOrInviteToTeamResult[]; }>} Results object

Promise<{
errors:
ArcGISRequestError[]
notAdded:
string[]
notEmailed:
string[]
notInvited:
string[]
responses:
IAddOrInviteToTeamResult[]
}>

Function defined in teams/src/add-or-invite-users-to-teams.ts:33