def ParseAction(messages, action):
  """Converts an action string to the corresponding enum value.

  Options are: 'allow' or 'deny', otherwise None will be returned.

  Args:
    messages: apitools.base.protorpclite.messages, the proto messages class for
      this API version for firewall.
    action: str, the action as a string
  Returns:
    ActionValueValuesEnum type
  """
  if not action:
    return None
  return messages.FirewallRule.ActionValueValuesEnum(action.upper())