parameters: (self, printer)
docstring: Write the services in this registry to out.
docstring_summary: Write the services in this registry to out.
docstring_tokens: Write the services in this registry to out .
function: def WriteFile(self, printer):
          """Write the services in this registry to out."""
          self.Validate()
          client_info = self.__client_info
          printer('"""Generated client library for %s version %s."""',
                  client_info.package, client_info.version)
          printer('# NOTE: This file is autogenerated and should not be edited '
                  'by hand.')
          printer('from %s import base_api', self.__base_files_package)
          import_prefix = ''
          printer('%simport %s as messages', import_prefix,
                  client_info.messages_rule_name)
          printer()
          printer()
          printer('class %s(base_api.BaseApiClient):',
                  client_info.client_class_name)
          with printer.Indent():
              printer(
                  '"""Generated client library for service %s version %s."""',
                  client_info.package, client_info.version)
              printer()
              printer('MESSAGES_MODULE = messages')
              printer()
              client_info_items = client_info._asdict(
              ).items()  # pylint:disable=protected-access
              for attr, val in client_info_items:
                  if attr == 'scopes' and not val:
                      val = ['https://www.googleapis.com/auth/userinfo.email']
                  printer('_%s = %r' % (attr.upper(), val))
              printer()
              printer("def __init__(self, url='', credentials=None,")
              with printer.Indent(indent='             '):
                  printer('get_credentials=True, http=None, model=None,')
                  printer('log_request=False, log_response=False,')
                  printer('credentials_args=None, default_global_params=None,')
                  printer('additional_http_headers=None):')
              with printer.Indent():
                  printer('"""Create a new %s handle."""', client_info.package)
                  printer('url = url or %r', self.__base_url)
                  printer(
                      'super(%s, self).__init__(', client_info.client_class_name)
                  printer('    url, credentials=credentials,')
                  printer('    get_credentials=get_credentials, http=http, '
                          'model=model,')
                  printer('    log_request=log_request, '
                          'log_response=log_response,')
                  printer('    credentials_args=credentials_args,')
                  printer('    default_global_params=default_global_params,')
                  printer('    additional_http_headers=additional_http_headers)')
                  for name in self.__service_method_info_map.keys():
                      printer('self.%s = self.%s(self)',
                              name, self.__GetServiceClassName(name))
              for name, method_info in self.__service_method_info_map.items():
                  self.__WriteSingleService(
                      printer, name, method_info, client_info.client_class_name)
function_tokens: def WriteFile ( self , printer ) : self . Validate ( ) client_info = self . __client_info printer ( '"""Generated client library for %s version %s."""' , client_info . package , client_info . version ) printer ( '# NOTE: This file is autogenerated and should not be edited ' 'by hand.' ) printer ( 'from %s import base_api' , self . __base_files_package ) import_prefix = '' printer ( '%simport %s as messages' , import_prefix , client_info . messages_rule_name ) printer ( ) printer ( ) printer ( 'class %s(base_api.BaseApiClient):' , client_info . client_class_name ) with printer . Indent ( ) : printer ( '"""Generated client library for service %s version %s."""' , client_info . package , client_info . version ) printer ( ) printer ( 'MESSAGES_MODULE = messages' ) printer ( ) client_info_items = client_info . _asdict ( ) . items ( ) # pylint:disable=protected-access for attr , val in client_info_items : if attr == 'scopes' and not val : val = [ 'https://www.googleapis.com/auth/userinfo.email' ] printer ( '_%s = %r' % ( attr . upper ( ) , val ) ) printer ( ) printer ( "def __init__(self, url='', credentials=None," ) with printer . Indent ( indent = '             ' ) : printer ( 'get_credentials=True, http=None, model=None,' ) printer ( 'log_request=False, log_response=False,' ) printer ( 'credentials_args=None, default_global_params=None,' ) printer ( 'additional_http_headers=None):' ) with printer . Indent ( ) : printer ( '"""Create a new %s handle."""' , client_info . package ) printer ( 'url = url or %r' , self . __base_url ) printer ( 'super(%s, self).__init__(' , client_info . client_class_name ) printer ( '    url, credentials=credentials,' ) printer ( '    get_credentials=get_credentials, http=http, ' 'model=model,' ) printer ( '    log_request=log_request, ' 'log_response=log_response,' ) printer ( '    credentials_args=credentials_args,' ) printer ( '    default_global_params=default_global_params,' ) printer ( '    additional_http_headers=additional_http_headers)' ) for name in self . __service_method_info_map . keys ( ) : printer ( 'self.%s = self.%s(self)' , name , self . __GetServiceClassName ( name ) ) for name , method_info in self . __service_method_info_map . items ( ) : self . __WriteSingleService ( printer , name , method_info , client_info . client_class_name )