(orig_props)
return props
Scrubs fields in API object properties for use in DM properties.

  Scrubbed fields include:

  - output-only fields common for most resources
  - output-only fields specific to a particular resource type

  Args:
    orig_props: the resource properties that need to be scrubbed

  Returns:
    The final scrubbed resource properties.
Scrubs fields in API object properties for use in DM properties.
Scrubs fields in API object properties for use in DM properties .
def scrub_properties(orig_props):
  """Scrubs fields in API object properties for use in DM properties.

  Scrubbed fields include:

  - output-only fields common for most resources
  - output-only fields specific to a particular resource type

  Args:
    orig_props: the resource properties that need to be scrubbed

  Returns:
    The final scrubbed resource properties.
  """

  props = deepcopy(orig_props)

  # Scrub output-only and unnecessary fields that we know about.
  props.pop('name', None)
  props.pop('id', None)
  props.pop('creationTimestamp', None)
  props.pop('status', None)
  props.pop('selfLink', None)

  # Some fields are at multiple layers and need to be scrubbed recursively.
  scrub_sub_properties(props)

  # Scrub fields that some types return.
  scrub_type_specific_properties(props)

  # Location is always returned as a full resource URL, but only the name is
  # used on input.
  if 'zone' in props:
    props['zone'] = props['zone'].rsplit('/', 1)[1]
  if 'region' in props:
    props['region'] = props['region'].rsplit('/', 1)[1]

  return props
def scrub_properties ( orig_props ) : props = deepcopy ( orig_props ) # Scrub output-only and unnecessary fields that we know about. props . pop ( 'name' , None ) props . pop ( 'id' , None ) props . pop ( 'creationTimestamp' , None ) props . pop ( 'status' , None ) props . pop ( 'selfLink' , None ) # Some fields are at multiple layers and need to be scrubbed recursively. scrub_sub_properties ( props ) # Scrub fields that some types return. scrub_type_specific_properties ( props ) # Location is always returned as a full resource URL, but only the name is # used on input. if 'zone' in props : props [ 'zone' ] = props [ 'zone' ] . rsplit ( '/' , 1 ) [ 1 ] if 'region' in props : props [ 'region' ] = props [ 'region' ] . rsplit ( '/' , 1 ) [ 1 ] return props