// pretty print the input value (to specified writer)
480242
func PrettyPrintTo(out io.Writer, i interface{}, nl bool) {
	p := &Pretty{Indent: DEFAULT_INDENT, Out: out, NilString: DEFAULT_NIL}
	if nl {
		p.Println(i)
	} else {
		p.Print(i)
	}
}
1173760
func (s *IndicesGetService) Pretty(pretty bool) *IndicesGetService {
	s.pretty = pretty
	return s
}
1310221
func (s *PutScriptService) Pretty(pretty bool) *PutScriptService {
	s.pretty = pretty
	return s
}
791664
func PrettyPrint(v interface{}) string {
	value := reflect.ValueOf(v)
	switch value.Kind() {
	case reflect.Struct:
		str := fullName(value.Type()) + "{\n"
		for i := 0; i < value.NumField(); i++ {
			l := string(value.Type().Field(i).Name[0])
			if strings.ToUpper(l) == l {
				str += value.Type().Field(i).Name + ": "
				str += PrettyPrint(value.Field(i).Interface())
				str += ",\n"
			}
		}
		str += "}"
		return str
	case reflect.Map:
		str := "map[" + fullName(value.Type().Key()) + "]" + fullName(value.Type().Elem()) + "{\n"
		for _, k := range value.MapKeys() {
			str += "\"" + k.String() + "\": "
			str += PrettyPrint(value.MapIndex(k).Interface())
			str += ",\n"
		}
		str += "}"
		return str
	case reflect.Ptr:
		if e := value.Elem(); e.IsValid() {
			return "&" + PrettyPrint(e.Interface())
		}
		return "nil"
	case reflect.Slice:
		str := "[]" + fullName(value.Type().Elem()) + "{\n"
		for i := 0; i < value.Len(); i++ {
			str += PrettyPrint(value.Index(i).Interface())
			str += ",\n"
		}
		str += "}"
		return str
	default:
		return fmt.Sprintf("%#v", v)
	}
}
208372
func (p *Pretty) Println(i interface{}) {
	p.PrintValue(r.ValueOf(i), 0)
	io.WriteString(p.Out, "\n")
}
322552
func (s *IndicesFreezeService) Pretty(pretty bool) *IndicesFreezeService {
	s.pretty = pretty
	return s
}
59930
func (s *ScanService) Pretty(pretty bool) *ScanService {
	s.pretty = pretty
	return s
}
202977
func (s *UpdateByQueryService) Pretty(pretty bool) *UpdateByQueryService {
	s.pretty = pretty
	return s
}
1015891
func PrettyPrint(i interface{}) string {
	switch t := i.(type) {
	case nil:
		return "None"
	case string:
		return capitalizeFirst(t)
	default:
		return capitalizeFirst(fmt.Sprintf("%s", t))
	}
}
64184
func (s *TasksGetTaskService) Pretty(pretty bool) *TasksGetTaskService {
	s.pretty = pretty
	return s
}
843687
func (o DepAnalysisOutput) Pretty(w io.Writer) error {

	var headers []string
	var rows [][]string

	// Fill two columns if results have base and virtual docs. Else fill one column.
	if len(o.Base) > 0 && len(o.Virtual) > 0 {
		maxLen := len(o.Base)
		if len(o.Virtual) > maxLen {
			maxLen = len(o.Virtual)
		}
		headers = []string{"Base Documents", "Virtual Documents"}
		rows = make([][]string, maxLen)
		for i := range rows {
			rows[i] = make([]string, 2)
			if i < len(o.Base) {
				rows[i][0] = o.Base[i].String()
			}
			if i < len(o.Virtual) {
				rows[i][1] = o.Virtual[i].String()
			}
		}
	} else if len(o.Base) > 0 {
		headers = []string{"Base Documents"}
		rows = make([][]string, len(o.Base))
		for i := range rows {
			rows[i] = []string{o.Base[i].String()}
		}
	} else if len(o.Virtual) > 0 {
		headers = []string{"Virtual Documents"}
		rows = make([][]string, len(o.Base))
		for i := range rows {
			rows[i] = []string{o.Virtual[i].String()}
		}
	}

	if len(rows) == 0 {
		return nil
	}

	table := tablewriter.NewWriter(w)
	table.SetHeader(headers)
	table.SetAutoWrapText(false)
	for i := range rows {
		table.Append(rows[i])
	}

	table.Render()

	return nil
}
407255
func (s *IndicesExistsTemplateService) Pretty(pretty bool) *IndicesExistsTemplateService {
	s.pretty = pretty
	return s
}
325796
func (s *FieldCapsService) Pretty(pretty bool) *FieldCapsService {
	s.pretty = pretty
	return s
}
591525
func (s *CatIndicesService) Pretty(pretty bool) *CatIndicesService {
	s.pretty = pretty
	return s
}
1019809
func (s *DeleteMappingService) Pretty(pretty bool) *DeleteMappingService {
	s.pretty = pretty
	return s
}
906100
func (s *IndicesDeleteTemplateService) Pretty(pretty bool) *IndicesDeleteTemplateService {
	s.pretty = pretty
	return s
}
718290
func (s *ClusterRerouteService) Pretty(pretty bool) *ClusterRerouteService {
	s.pretty = pretty
	return s
}