addTeamMembersWithHttpInfo method
Future<Response>
addTeamMembersWithHttpInfo(
- String teamId,
- List<
MmTeamMember> mmTeamMember, { - bool? graceful,
Add multiple users to team
Add a number of users to the team by user_id. ##### Permissions Must be authenticated. Authenticated user must have the add_user_to_team
permission.
Note: This method returns the HTTP Response
.
Parameters:
-
String teamId (required): Team GUID
-
List<MmTeamMember> mmTeamMember (required):
-
bool graceful: Instead of aborting the operation if a user cannot be added, return an arrray that will contain both the success and added members and the ones with error, in form of
[{\"member\": {...}, \"user_id\", \"...\", \"error\": {...}}]
Implementation
Future<Response> addTeamMembersWithHttpInfo(
String teamId,
List<MmTeamMember> mmTeamMember, {
bool? graceful,
}) async {
// ignore: prefer_const_declarations
final path = r'/teams/{team_id}/members/batch'.replaceAll('{team_id}', teamId);
// ignore: prefer_final_locals
Object? postBody = mmTeamMember;
final queryParams = <MmQueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (graceful != null) {
queryParams.addAll(_queryParams('', 'graceful', graceful));
}
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}