def resource_name_for_resource_type(resource_type, row):
  """Return the resource name for the resource type.

  Each returned row contains all possible changed fields. This function
  returns the resource name of the changed field based on the
  resource type. The changed field's parent is also populated but is not used.
  
  Args:
    resource_type: the string equivalent of the resource type
    row: a single row returned from the service

  Returns:
    The resource name of the field that changed.
  """
  resource_name = ''  # default for UNSPECIFIED or UNKNOWN
  if resource_type == 'AD_GROUP':
    resource_name = row.change_status.ad_group.value
  elif resource_type == 'AD_GROUP_AD':
    resource_name = row.change_status.ad_group_ad.value
  elif resource_type == 'AD_GROUP_CRITERION':
    resource_name = row.change_status.ad_group_criterion.value
  elif resource_type == 'CAMPAIGN':
    resource_name = row.change_status.campaign.value
  elif resource_type == 'CAMPAIGN_CRITERION':
    resource_name = row.change_status.campaign_criterion.value
  return resource_name