// Type is a list of document types to check.
349128
func (s *IndicesExistsTypeService) Type(typ ...string) *IndicesExistsTypeService {
	s.typ = append(s.typ, typ...)
	return s
}
572027
func (n rootNode) Type() Type {

	switch {
	case n.err != nil:
		// for error, return TypeError
		return TypeError
	case n.buf == nil || len(n.buf) == 0:
		// for nil raw, return TypeUndefined
		return TypeUndefined
	case n.buf[0] == '"':
		// simply examine the first character
		// to determine the value type
		return TypeString
	case n.buf[0] == '{':
		// simply examine the first character
		// to determine the value type
		return TypeObject
	case n.buf[0] == '[':
		// simply examine the first character
		// to determine the value type
		return TypeArray
	case string(n.buf) == "true":
		fallthrough
	case string(n.buf) == "false":
		return TypeBool
	case string(n.buf) == "null":
		return TypeNull
	case isNumJSON(n.buf):
		return TypeNumber
	}

	// return TypeUnknown for all other cases
	return TypeError
}
1000416
func (e *Entry) Types() string {
	s := ""
	switch e.Type {
	case 'e', 'E':
		s = "error"
	case 0:
		if e.Nr > 0 {
			s = "error"
		}
	case 'w', 'W':
		s = "warning"
	case 'i', 'I':
		s = "info"
	default:
		s = string(e.Type)
	}
	if e.Nr > 0 {
		if s != "" {
			s += " "
		}
		s += strconv.Itoa(e.Nr)
	}
	return s
}
775224
func (q *MultiMatchQuery) Type(typ string) *MultiMatchQuery {
	var zero = float64(0.0)
	var one = float64(1.0)

	switch strings.ToLower(typ) {
	default: // best_fields / boolean
		q.typ = "best_fields"
		q.tieBreaker = &zero
	case "most_fields":
		q.typ = "most_fields"
		q.tieBreaker = &one
	case "cross_fields":
		q.typ = "cross_fields"
		q.tieBreaker = &zero
	case "phrase":
		q.typ = "phrase"
		q.tieBreaker = &zero
	case "phrase_prefix":
		q.typ = "phrase_prefix"
		q.tieBreaker = &zero
	}
	return q
}
563101
func (s *SnapshotCreateRepositoryService) Type(typ string) *SnapshotCreateRepositoryService {
	s.typ = typ
	return s
}
411293
func (t *TermsLookup) Type(typ string) *TermsLookup {
	t.typ = typ
	return t
}
618378
func (r *resourceRecordSet) Type() rrstype.RrsType {
	// TODO: Check if it is one of the well-known types?
	return rrstype.RrsType(r.data.RrsType)
}
1055477
func (s *DeleteByQueryService) Types(types ...string) *DeleteByQueryService {
	if s.types == nil {
		s.types = make([]string, 0)
	}
	s.types = append(s.types, types...)
	return s
}
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
}
158950
func (r *BulkDeleteRequest) Type(typ string) *BulkDeleteRequest {
	r.typ = typ
	r.source = nil
	return r
}
840503
func (s *GetMappingService) Type(typ ...string) *GetMappingService {
	s.typ = append(s.typ, typ...)
	return s
}
917018
func (r *Request) Type(name string) *Request {
	r.Use(bodytype.Set(name))
	return r
}
434783
func (s *TermvectorsService) Type(typ string) *TermvectorsService {
	s.typ = typ
	return s
}
1327420
func (d *RecordDecoder) Type(rec []byte) RecordType {
	if len(rec) < 1 {
		return RecordInvalid
	}
	switch t := RecordType(rec[0]); t {
	case RecordSeries, RecordSamples, RecordTombstones:
		return t
	}
	return RecordInvalid
}
500570
func (ftp *FTP) Type(t TypeCode) error {
	_, err := ftp.cmd(StatusOK, "TYPE %s", t)
	return err
}
996391
func (q *PercolatorQuery) DocumentType(typ string) *PercolatorQuery {
	q.documentType = typ
	return q
}
592295
func (q *GeoBoundingBoxQuery) Type(typ string) *GeoBoundingBoxQuery {
	q.typ = typ
	return q
}