// defineType enum value define the type (object and array unsupported)
765718
func defineType(schemaType string, value string) interface{} {
	schemaType = TransToValidSchemeType(schemaType)
	switch schemaType {
	case "string":
		return value
	case "number":
		v, err := strconv.ParseFloat(value, 64)
		if err != nil {
			panic(fmt.Errorf("enum value %s can't convert to %s err: %s", value, schemaType, err))
		}
		return v
	case "integer":
		v, err := strconv.Atoi(value)
		if err != nil {
			panic(fmt.Errorf("enum value %s can't convert to %s err: %s", value, schemaType, err))
		}
		return v
	case "boolean":
		v, err := strconv.ParseBool(value)
		if err != nil {
			panic(fmt.Errorf("enum value %s can't convert to %s err: %s", value, schemaType, err))
		}
		return v
	default:
		panic(fmt.Errorf("%s is unsupported type in enum value", schemaType))
	}
}
170069
func (s *Parameter) SetType(v string) *Parameter {
	s.Type = &v
	return s
}
1259444
func (s *Scheme) Type() (t Type, isMonoType bool) {
	if len(s.tvs) == 0 {
		return s.t, true
	}
	return s.t, false
}
314593
func (that *JSONNode) SetType(t JSONNodeType) *JSONNode {
	if that.t != TypeUndefined && that.t != t {
		panic(ErrorMultipleType)
	}
	if t >= typeError {
		panic(ErrorUnknowType)
	}
	that.t = t
	switch t {
	case TypeMap:
		that.m = make(map[string]*JSONNode, 0)
	case TypeArray:
		that.a = make([]JSONNode, 0)
	case TypeValue:
		that.Val(nil)
	}
	return that
}
147031
func GoTypeForEnum(typ cc.Type, name string, types ...map[string]bg.Template) string {
	if typ == nil {
		return "<nil>"
	}
	if typ.Kind() != cc.Enum {
		panic(fmt.Sprintf("invalid type: %v", typ))
	}
	tag := typ.Tag()
	if tag != 0 {
		n := string(xc.Dict.S(tag))
		for _, t := range types {
			if s, ok := t[n]; ok {
				var buf bytes.Buffer
				err := s.Execute(&buf, name)
				if err != nil {
					panic(err)
				}
				return buf.String()
			}
		}
	}
	log.Printf("%s", typ.Declarator())
	panic(fmt.Sprintf("unknown type: %+v", typ))
}
1215466
func (s *Preset) SetType(v string) *Preset {
	s.Type = &v
	return s
}
1043458
func (s *Job) SetType(v string) *Job {
	s.Type = &v
	return s
}
286302
func (s *BlockerDeclaration) SetType(v string) *BlockerDeclaration {
	s.Type = &v
	return s
}
191266
func (s *ColumnInfo) SetType(v string) *ColumnInfo {
	s.Type = &v
	return s
}
83350
func (e *Env) Define(k string, v interface{}) error {
	if v == nil {
		return e.defineValue(k, nilValue)
	}
	return e.defineValue(k, reflect.ValueOf(v))
}
755757
func (s *Limit) SetType(v string) *Limit {
	s.Type = &v
	return s
}
1153436
func (domain *Domain) BuildTypeForDefinition(
	typeName string,
	propertyName string,
	schema *jsonschema.Schema) *TypeModel {
	if (schema.Type == nil) || (*schema.Type.String == "object") {
		return domain.buildTypeForDefinitionObject(typeName, propertyName, schema)
	}
	return nil
}
40499
func (s *Sample) SetType(v string) *Sample {
	s.Type = &v
	return s
}
1096570
func (s *Instance) SetType(v string) *Instance {
	s.Type = &v
	return s
}
1155703
func (s *Rule) SetType(v string) *Rule {
	s.Type = &v
	return s
}
721857
func (s *DataSource) SetType(v string) *DataSource {
	s.Type = &v
	return s
}
1276384
func (s *ReusableDelegationSetLimit) SetType(v string) *ReusableDelegationSetLimit {
	s.Type = &v
	return s
}