updateTeamMember method

Future<UpdateTeamMemberResult> updateTeamMember({
  1. required String projectId,
  2. required String userArn,
  3. String? projectRole,
  4. bool? remoteAccessAllowed,
})

Updates a team member's attributes in an AWS CodeStar project. For example, you can change a team member's role in the project, or change whether they have remote access to project resources.

May throw LimitExceededException. May throw ProjectNotFoundException. May throw ValidationException. May throw InvalidServiceRoleException. May throw ProjectConfigurationException. May throw ConcurrentModificationException. May throw TeamMemberNotFoundException.

Parameter projectId : The ID of the project.

Parameter userArn : The Amazon Resource Name (ARN) of the user for whom you want to change team membership attributes.

Parameter projectRole : The role assigned to the user in the project. Project roles have different levels of access. For more information, see Working with Teams in the AWS CodeStar User Guide.

Parameter remoteAccessAllowed : Whether a team member is allowed to remotely access project resources using the SSH public key associated with the user's profile. Even if this is set to True, the user must associate a public key with their profile before the user can access resources.

Implementation

Future<UpdateTeamMemberResult> updateTeamMember({
  required String projectId,
  required String userArn,
  String? projectRole,
  bool? remoteAccessAllowed,
}) async {
  ArgumentError.checkNotNull(projectId, 'projectId');
  _s.validateStringLength(
    'projectId',
    projectId,
    2,
    15,
    isRequired: true,
  );
  ArgumentError.checkNotNull(userArn, 'userArn');
  _s.validateStringLength(
    'userArn',
    userArn,
    32,
    95,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeStar_20170419.UpdateTeamMember'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'projectId': projectId,
      'userArn': userArn,
      if (projectRole != null) 'projectRole': projectRole,
      if (remoteAccessAllowed != null)
        'remoteAccessAllowed': remoteAccessAllowed,
    },
  );

  return UpdateTeamMemberResult.fromJson(jsonResponse.body);
}