def document_api(name, version):
 try:
  service = build(name, version)
 except UnknownApiNameOrVersion as e:
  print 'Warning: {} {} found but could not be built.'.format(name, version)
  return
 http = build_http()
 (response, content) = http.request(uritemplate.expand(FLAGS.discovery_uri_template, {'api': name, 'apiVersion': version}))
 discovery = json.loads(content)
 version = safe_version(version)
 document_collection_recursive(service, ('%s_%s.' % (name, version)), discovery, discovery)

def document_api ( name , version ) : try : service = build ( name , version ) except UnknownApiNameOrVersion as e : print 'Warning: {} {} found but could not be built.' . format ( name , version ) return http = build_http ( ) ( response , content ) = http . request ( uritemplate . expand ( FLAGS . discovery_uri_template , { 'api' : name , 'apiVersion' : version } ) ) discovery = json . loads ( content ) version = safe_version ( version ) document_collection_recursive ( service , ( '%s_%s.' % ( name , version ) ) , discovery , discovery )
document the given api .