code: func newClass(apiDef *raml.APIDefinition, T raml.Type, name string, description string, properties map[string]interface{}, capnp bool) class {
  	pc := class{
  		name:        name,
  		Description: commons.ParseDescription(description),
  		Fields:      map[string]field{},
  		T:           T,
  		Capnp:       capnp,
  		imports:     make(map[string]struct{}),
  	}
  
  	if pc.T.IsAlias() {
  		return pc
  	}
  
  	// initialize the fields
  
  	types := globAPIDef.Types
  
  	typeHierarchy := getTypeHierarchy(name, T, types)
  	ramlTypes := make([]raml.Type, 0)
  	for _, v := range typeHierarchy {
  		for _, iv := range v {
  			ramlTypes = append(ramlTypes, iv)
  		}
  	}
  	mergedProps := getTypeProperties(ramlTypes)
  	for k, v := range properties {
  		prop := raml.ToProperty(k, v)
  		mergedProps[k] = prop
  	}
  
  	for propName, propInterface := range mergedProps {
  		op := objectProperties(propName, propInterface)
  		field, err := newField(name, apiDef, T, propName, propInterface, types, op, typeHierarchy)
  		if err != nil {
  			continue
  		}
  
  		pc.Fields[field.Name] = field
  	}
  
  	return pc
  }
docs: // create a python class representations