def determine_version(api):
 discovery = make_service('discovery', 'v1')
 response = discovery.apis().list(name=api, preferred=True).execute()
 if (not response.get('items')):
  raise ValueError('Unknown API "{0}".'.format(api))
 return response['items'][0]['version']

def determine_version ( api ) : discovery = make_service ( 'discovery' , 'v1' ) response = discovery . apis ( ) . list ( name = api , preferred = True ) . execute ( ) if ( not response . get ( 'items' ) ) : raise ValueError ( 'Unknown API "{0}".' . format ( api ) ) return response [ 'items' ] [ 0 ] [ 'version' ]
determine current version of google api args: api: [string] google api name .