// ArrayType returns the type of the array
199542
func (p Property) ArrayType() string {
	if p.Type == arrayType {
		return p.Items.Type
	}
	return strings.TrimSuffix(p.TypeString(), "[]")
}
892761
func (schema *Schema) schemaOrSchemaArrayValue(v interface{}) *SchemaOrSchemaArray {
	switch v := v.(type) {
	default:
		fmt.Printf("schemaOrSchemaArrayValue: unexpected type %T\n", v)
	case []interface{}:
		m := make([]*Schema, 0)
		for _, v2 := range v {
			switch v2 := v2.(type) {
			default:
				fmt.Printf("schemaOrSchemaArrayValue: unexpected type %T\n", v2)
			case map[string]interface{}:
				s := NewSchemaFromObject(v2)
				m = append(m, s)
			}
		}
		return &SchemaOrSchemaArray{SchemaArray: &m}
	case yaml.MapSlice:
		s := NewSchemaFromObject(v)
		return &SchemaOrSchemaArray{Schema: s}
	}
	return nil
}
700792
func (s *IndicesGetFieldMappingService) Type(types ...string) *IndicesGetFieldMappingService {
	s.typ = append(s.typ, types...)
	return s
}
434783
func (s *TermvectorsService) Type(typ string) *TermvectorsService {
	s.typ = typ
	return s
}
1134924
func (ua *Uint64Array) Uint64ArrayOr(or []uint64) []uint64 {
	switch {
	case ua == nil:
		return or
	case !ua.Valid:
		return or
	default:
		return ua.Uint64Array
	}
}
411293
func (t *TermsLookup) Type(typ string) *TermsLookup {
	t.typ = typ
	return t
}
134007
func (s *SearchDsl) Type(indexType string) *SearchDsl {
	if len(s.types) == 0 {
		s.types = make([]string, 0)
	}
	s.types = append(s.types, indexType)
	return s
}
280281
func (s *IndicesStatsService) Type(types ...string) *IndicesStatsService {
	s.types = append(s.types, types...)
	return s
}
687724
func (storage Storage) Type() string {
	var storageType []string

	// Return only key in this map
	for k := range storage {
		switch k {
		case "maintenance":
			// allow configuration of maintenance
		case "cache":
			// allow configuration of caching
		case "delete":
			// allow configuration of delete
		case "redirect":
			// allow configuration of redirect
		default:
			storageType = append(storageType, k)
		}
	}
	if len(storageType) > 1 {
		panic("multiple storage drivers specified in configuration or environment: " + strings.Join(storageType, ", "))
	}
	if len(storageType) == 1 {
		return storageType[0]
	}
	return ""
}
1339502
func (s *IndicesGetMappingService) Type(types ...string) *IndicesGetMappingService {
	s.typ = append(s.typ, types...)
	return s
}
87643
func (ia *Int32Array) Int32ArrayOr(or []int32) []int32 {
	switch {
	case ia == nil:
		return or
	case !ia.Valid:
		return or
	default:
		return ia.Int32Array
	}
}
1323852
func (reg *typeRegistry) IsArrayType(t *Type) bool {
	return reg.BaseType(t) == BaseTypeArray
}
1312537
func (s *DeleteTemplateService) VersionType(versionType string) *DeleteTemplateService {
	s.versionType = versionType
	return s
}
1279910
func (s *IndicesStatsService) Types(types ...string) *IndicesStatsService {
	s.types = append(s.types, types...)
	return s
}
649520
func jsonType(v interface{}) string {
	switch v.(type) {
	case nil:
		return "null"
	case bool:
		return "boolean"
	case json.Number, float64, int, int32, int64:
		return "number"
	case string:
		return "string"
	case []interface{}:
		return "array"
	case map[string]interface{}:
		return "object"
	}
	panic(InvalidJSONTypeError(fmt.Sprintf("%T", v)))
}
224836
func IsArray(s spec.Schema) bool {
	return len(s.Type) > 0 && s.Type[0] == "array"
}
295591
func (r *BulkUpdateRequest) Type(typ string) *BulkUpdateRequest {
	r.typ = typ
	r.source = nil
	return r
}