action property

ElicitationAction get action

The action taken by the user in response to an elicitation request.

Implementation

ElicitationAction get action {
  var action = _value[Keys.action] as String?;
  if (action == null) {
    throw ArgumentError('Missing required action field in $ElicitResult');
  }
  // There was a bug in the initial schema, where the `decline` action was
  // named `reject` instead. Handle using that as an alias for `decline` in
  // case some clients use the old name.
  if (action == 'reject') action = Keys.decline;

  return ElicitationAction.values.firstWhere((value) => value.name == action);
}