getGroup method

Future<GetGroupResponse> getGroup({
  1. required String groupName,
  2. required String userPoolId,
})

Gets a group.

Calling this action requires developer credentials.

May throw ResourceNotFoundException. May throw InvalidParameterException. May throw TooManyRequestsException. May throw NotAuthorizedException. May throw InternalErrorException.

Parameter groupName : The name of the group.

Parameter userPoolId : The user pool ID for the user pool.

Implementation

Future<GetGroupResponse> getGroup({
  required String groupName,
  required String userPoolId,
}) async {
  ArgumentError.checkNotNull(groupName, 'groupName');
  _s.validateStringLength(
    'groupName',
    groupName,
    1,
    128,
    isRequired: true,
  );
  ArgumentError.checkNotNull(userPoolId, 'userPoolId');
  _s.validateStringLength(
    'userPoolId',
    userPoolId,
    1,
    55,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSCognitoIdentityProviderService.GetGroup'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'GroupName': groupName,
      'UserPoolId': userPoolId,
    },
  );

  return GetGroupResponse.fromJson(jsonResponse.body);
}