createGroupMembership method

Future<CreateGroupMembershipResponse> createGroupMembership({
  1. required String groupId,
  2. required String identityStoreId,
  3. required MemberId memberId,
})

Creates a relationship between a member and a group. The following identifiers must be specified: GroupId, IdentityStoreId, and MemberId.

May throw ConflictException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ValidationException.

Parameter groupId : The identifier for a group in the identity store.

Parameter identityStoreId : The globally unique identifier for the identity store.

Parameter memberId : An object that contains the identifier of a group member. Setting the UserID field to the specific identifier for a user indicates that the user is a member of the group.

Implementation

Future<CreateGroupMembershipResponse> createGroupMembership({
  required String groupId,
  required String identityStoreId,
  required MemberId memberId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSIdentityStore.CreateGroupMembership'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'GroupId': groupId,
      'IdentityStoreId': identityStoreId,
      'MemberId': memberId,
    },
  );

  return CreateGroupMembershipResponse.fromJson(jsonResponse.body);
}