(self, api, default_name, def_dict, parent=None)
Construct a Schema object from a discovery dictionary.

    Schemas represent data models in the API.

    Args:
      api: (Api) the Api instance owning the Schema
      default_name: (str) the default name of the Schema. If there is an 'id'
        member in the definition, that is used for the name instead.
      def_dict: (dict) a discovery dictionary
      parent: (Schema) The containing schema. To be used to establish unique
        names for anonymous sub-schemas.
Construct a Schema object from a discovery dictionary.
Construct a Schema object from a discovery dictionary .
def __init__(self, api, default_name, def_dict, parent=None):
    """Construct a Schema object from a discovery dictionary.

    Schemas represent data models in the API.

    Args:
      api: (Api) the Api instance owning the Schema
      default_name: (str) the default name of the Schema. If there is an 'id'
        member in the definition, that is used for the name instead.
      def_dict: (dict) a discovery dictionary
      parent: (Schema) The containing schema. To be used to establish unique
        names for anonymous sub-schemas.
    """
    super(Schema, self).__init__(default_name, def_dict, api, parent=parent)

    name = def_dict.get('id', default_name)
    _LOGGER.debug('Schema(%s)', name)

    # Protect against malicious discovery
    template_objects.CodeObject.ValidateName(name)
    self.SetTemplateValue('wireName', name)
    class_name = api.ToClassName(name, self, element_type='schema')
    self.SetTemplateValue('className', class_name)
    self.SetTemplateValue('isSchema', True)
    self.SetTemplateValue('properties', [])
    self._module = (template_objects.Module.ModuleFromDictionary(self.values)
                    or api.model_module)
def __init__ ( self , api , default_name , def_dict , parent = None ) : super ( Schema , self ) . __init__ ( default_name , def_dict , api , parent = parent ) name = def_dict . get ( 'id' , default_name ) _LOGGER . debug ( 'Schema(%s)' , name ) # Protect against malicious discovery template_objects . CodeObject . ValidateName ( name ) self . SetTemplateValue ( 'wireName' , name ) class_name = api . ToClassName ( name , self , element_type = 'schema' ) self . SetTemplateValue ( 'className' , class_name ) self . SetTemplateValue ( 'isSchema' , True ) self . SetTemplateValue ( 'properties' , [ ] ) self . _module = ( template_objects . Module . ModuleFromDictionary ( self . values ) or api . model_module )