headless/lib/browser/devtools_api/client_api_generator.py
def SynthesizeEventTypes(json_api):
  """Generate types for events and their properties.

  Note that parameter objects are also created for events without parameters to
  make it easier to introduce parameters later.
  """
  for domain in json_api['domains']:
    if not 'types' in domain:
      domain['types'] = []
    for event in domain.get('events', []):
      for parameter in event.get('parameters', []):
        if 'enum' in parameter and not '$ref' in parameter:
          SynthesizeEnumType(domain, event['name'], parameter)
      event_type = {
          'id': ToTitleCase(event['name']) + 'Params',
          'type': 'object',
          'description': 'Parameters for the %s event.' % ToTitleCase(
              event['name']),
          'properties': event.get('parameters', [])
      }
      domain['types'].append(event_type)
Generate types for events and their properties.

  Note that parameter objects are also created for events without parameters to
  make it easier to introduce parameters later.
  
Generate types for events and their properties.
Note that parameter objects are also created for events without parameters to
make it easier to introduce parameters later.
Generate types for events and their properties . Note that parameter objects are also created for events without parameters to make it easier to introduce parameters later .
def SynthesizeEventTypes(json_api):
  for domain in json_api['domains']:
    if not 'types' in domain:
      domain['types'] = []
    for event in domain.get('events', []):
      for parameter in event.get('parameters', []):
        if 'enum' in parameter and not '$ref' in parameter:
          SynthesizeEnumType(domain, event['name'], parameter)
      event_type = {
          'id': ToTitleCase(event['name']) + 'Params',
          'type': 'object',
          'description': 'Parameters for the %s event.' % ToTitleCase(
              event['name']),
          'properties': event.get('parameters', [])
      }
      domain['types'].append(event_type)
def SynthesizeEventTypes ( json_api ) : for domain in json_api [ 'domains' ] : if not 'types' in domain : domain [ 'types' ] = [ ] for event in domain . get ( 'events' , [ ] ) : for parameter in event . get ( 'parameters' , [ ] ) : if 'enum' in parameter and not '$ref' in parameter : SynthesizeEnumType ( domain , event [ 'name' ] , parameter ) event_type = { 'id' : ToTitleCase ( event [ 'name' ] ) + 'Params' , 'type' : 'object' , 'description' : 'Parameters for the %s event.' % ToTitleCase ( event [ 'name' ] ) , 'properties' : event . get ( 'parameters' , [ ] ) } domain [ 'types' ] . append ( event_type )
Generate types for events and their properties.
Generate types for events and their properties .
"""Generate types for events and their properties.

  Note that parameter objects are also created for events without parameters to
  make it easier to introduce parameters later.
  """
json_api