def _ClassToDict(resource):
  """Converts a resource class object to a dict.

  Private and callable attributes are omitted in the dict.

  Args:
    resource: The class object to convert.

  Returns:
    The dict representing the class object.
  """
  r = {}
  for attr in dir(resource):
    if attr.startswith('_'):
      # Omit private attributes.
      continue
    value = getattr(resource, attr)
    if hasattr(value, '__call__'):
      # Omit callable attributes.
      continue
    r[attr] = value
  return r