def v1_key_to_string(v1_key):
 path_element_strings = []
 for path_element in v1_key.path:
  field = path_element.WhichOneof('id_type')
  if (field == 'id'):
   id_or_name = str(path_element.id)
  elif (field == 'name'):
   id_or_name = path_element.name
  else:
   id_or_name = ''
  path_element_strings.append(('%s: %s' % (path_element.kind, id_or_name)))
 return ('[%s]' % ', '.join(path_element_strings))

def v1_key_to_string ( v1_key ) : path_element_strings = [ ] for path_element in v1_key . path : field = path_element . WhichOneof ( 'id_type' ) if ( field == 'id' ) : id_or_name = str ( path_element . id ) elif ( field == 'name' ) : id_or_name = path_element . name else : id_or_name = '' path_element_strings . append ( ( '%s: %s' % ( path_element . kind , id_or_name ) ) ) return ( '[%s]' % ', ' . join ( path_element_strings ) )
generates a string representing a keys path .