def _GetClearedFieldsForDuration(duration, field_prefix):
  """Gets a list of fields cleared by the user for Duration."""
  cleared_fields = []
  if hasattr(duration, 'seconds'):
    cleared_fields.append(field_prefix + 'seconds')
  if hasattr(duration, 'nanos'):
    cleared_fields.append(field_prefix + 'nanos')
  return cleared_fields