def get_output_type(operation):
  """
  Find the name of the output type of the specified operation. This method first explores
  the responseMessages defined for the operation. If a successful responseMessage (i.e.
  response code in 200's range), has been declared with a responseModel, that will be
  considered output type of the operation. Otherwise, it will fallback to the 'type'
  attribute defined in the operation. If neither is defined, returns None.

  Args:
    operation - A Swagger operation description (dictionary)

  Returns:
    A string representing a data type name or None
  """
  if operation.get('responseMessages'):
    for rm in operation['responseMessages']:
      if 200 <= rm['code'] < 210 and rm.get('responseModel'):
        return rm['responseModel']
  if operation.get('type'):
    return operation['type']
  return None