parameters: (self)
return_statement: return c
docstring: Generates the main class for this file, which links to all functions
      and events.
  
      Returns a code object.
docstring_summary: Generates the main class for this file, which links to all functions
      and events.
docstring_tokens: Generates the main class for this file which links to all functions and events .
function: def _GenerateMainClass(self):
      """Generates the main class for this file, which links to all functions
      and events.
  
      Returns a code object.
      """
      c = Code()
      (c.Sblock('class API_%s {' % self._namespace.unix_name)
        .Append('/*')
        .Append(' * API connection')
        .Append(' */')
        .Append('Object _jsObject;')
      )
  
      # Add events.
      if self._namespace.events:
        (c.Append()
          .Append('/*')
          .Append(' * Events')
          .Append(' */')
        )
      for event_name in self._namespace.events:
        c.Append('Event_%s_%s %s;' % (self._namespace.unix_name, event_name,
                                      event_name))
  
      # Add functions.
      if self._namespace.functions:
        (c.Append()
          .Append('/*')
          .Append(' * Functions')
          .Append(' */')
        )
      for function in self._namespace.functions.values():
        # Check for custom dart for this whole property.
        override = self._GetOverride([function.name], document_with=function)
        c.Cblock(override if override is not None
                 else self._GenerateFunction(function))
  
      # Add the constructor.
      c.Sblock('API_%s(this._jsObject) {' % self._namespace.unix_name)
  
      # Add events to constructor.
      for event_name in self._namespace.events:
        c.Append("%s = new Event_%s_%s(JS('', '#.%s', this._jsObject));" %
          (event_name, self._namespace.unix_name, event_name, event_name))
  
      (c.Eblock('}')
        .Eblock('}')
      )
      return c
function_tokens: def _GenerateMainClass ( self ) : c = Code ( ) ( c . Sblock ( 'class API_%s {' % self . _namespace . unix_name ) . Append ( '/*' ) . Append ( ' * API connection' ) . Append ( ' */' ) . Append ( 'Object _jsObject;' ) ) # Add events. if self . _namespace . events : ( c . Append ( ) . Append ( '/*' ) . Append ( ' * Events' ) . Append ( ' */' ) ) for event_name in self . _namespace . events : c . Append ( 'Event_%s_%s %s;' % ( self . _namespace . unix_name , event_name , event_name ) ) # Add functions. if self . _namespace . functions : ( c . Append ( ) . Append ( '/*' ) . Append ( ' * Functions' ) . Append ( ' */' ) ) for function in self . _namespace . functions . values ( ) : # Check for custom dart for this whole property. override = self . _GetOverride ( [ function . name ] , document_with = function ) c . Cblock ( override if override is not None else self . _GenerateFunction ( function ) ) # Add the constructor. c . Sblock ( 'API_%s(this._jsObject) {' % self . _namespace . unix_name ) # Add events to constructor. for event_name in self . _namespace . events : c . Append ( "%s = new Event_%s_%s(JS('', '#.%s', this._jsObject));" % ( event_name , self . _namespace . unix_name , event_name , event_name ) ) ( c . Eblock ( '}' ) . Eblock ( '}' ) ) return c