adminUpdateAuthEventFeedback method

Future<void> adminUpdateAuthEventFeedback({
  1. required String eventId,
  2. required FeedbackValueType feedbackValue,
  3. required String userPoolId,
  4. required String username,
})

Provides feedback for an authentication event as to whether it was from a valid user. This feedback is used for improving the risk evaluation decision for the user pool as part of Amazon Cognito advanced security.

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

Parameter eventId : The authentication event ID.

Parameter feedbackValue : The authentication event feedback value.

Parameter userPoolId : The user pool ID.

Parameter username : The user pool username.

Implementation

Future<void> adminUpdateAuthEventFeedback({
  required String eventId,
  required FeedbackValueType feedbackValue,
  required String userPoolId,
  required String username,
}) async {
  ArgumentError.checkNotNull(eventId, 'eventId');
  _s.validateStringLength(
    'eventId',
    eventId,
    1,
    50,
    isRequired: true,
  );
  ArgumentError.checkNotNull(feedbackValue, 'feedbackValue');
  ArgumentError.checkNotNull(userPoolId, 'userPoolId');
  _s.validateStringLength(
    'userPoolId',
    userPoolId,
    1,
    55,
    isRequired: true,
  );
  ArgumentError.checkNotNull(username, 'username');
  _s.validateStringLength(
    'username',
    username,
    1,
    128,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'AWSCognitoIdentityProviderService.AdminUpdateAuthEventFeedback'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'EventId': eventId,
      'FeedbackValue': feedbackValue.toValue(),
      'UserPoolId': userPoolId,
      'Username': username,
    },
  );
}