createEnvironmentMembership method
Future<CreateEnvironmentMembershipResult>
createEnvironmentMembership({
- required String environmentId,
- required MemberPermissions permissions,
- required String userArn,
Adds an environment member to an AWS Cloud9 development environment.
May throw BadRequestException. May throw ConflictException. May throw NotFoundException. May throw ForbiddenException. May throw TooManyRequestsException. May throw LimitExceededException. May throw InternalServerErrorException.
Parameter environmentId :
The ID of the environment that contains the environment member you want to
add.
Parameter permissions :
The type of environment member permissions you want to associate with this
environment member. Available values include:
-
read-only: Has read-only access to the environment. -
read-write: Has read-write access to the environment.
Parameter userArn :
The Amazon Resource Name (ARN) of the environment member you want to add.
Implementation
Future<CreateEnvironmentMembershipResult> createEnvironmentMembership({
required String environmentId,
required MemberPermissions permissions,
required String userArn,
}) async {
ArgumentError.checkNotNull(environmentId, 'environmentId');
ArgumentError.checkNotNull(permissions, 'permissions');
ArgumentError.checkNotNull(userArn, 'userArn');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target':
'AWSCloud9WorkspaceManagementService.CreateEnvironmentMembership'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'environmentId': environmentId,
'permissions': permissions.toValue(),
'userArn': userArn,
},
);
return CreateEnvironmentMembershipResult.fromJson(jsonResponse.body);
}