// YesOrNoField modifies the field so that it corresponds to YesOrNo value.
//
// It sets 'Type', 'ChoiceVariants' and 'Validator' properties.
358357
func YesOrNoField(f Field) Field {
	f.Type = FieldChoice
	f.ChoiceVariants = []string{"yes", "no"}
	f.Validator = func(v string) error {
		var x YesOrNo
		return x.Set(v)
	}
	return f
}
1072709
func Field(fieldPtr interface{}, rules ...Rule) *FieldRules {
	return &FieldRules{
		fieldPtr: fieldPtr,
		rules:    rules,
	}
}
461929
func (s *SearchSource) DocvalueFieldsWithFormat(docvalueFields ...DocvalueField) *SearchSource {
	s.docvalueFields = append(s.docvalueFields, docvalueFields...)
	return s
}
640749
func (s *DeleteByQueryService) DocvalueFields(docvalueFields ...string) *DeleteByQueryService {
	s.docvalueFields = docvalueFields
	return s
}
792815
func headerField(headerType string, value []byte) string {
	return fmt.Sprintf(`%s=%s`, headerType, base64.URLEncoding.EncodeToString(value))
}
1006764
func (r *Response) Field(key string, value interface{}) JResponseWriter {
	r.fields[key] = value
	return r
}
206239
func (a *CompositeAggregationHistogramValuesSource) Field(field string) *CompositeAggregationHistogramValuesSource {
	a.field = field
	return a
}
102585
func (f *JSONFlattener) FullFlattenJSON(
	fieldname string,
	v interface{},
	convertString bool,
	convertBool bool,
) error {
	if f.Fields == nil {
		f.Fields = make(map[string]interface{})
	}
	fieldname = strings.Trim(fieldname, "_")
	switch t := v.(type) {
	case map[string]interface{}:
		for k, v := range t {
			err := f.FullFlattenJSON(fieldname+"_"+k+"_", v, convertString, convertBool)
			if err != nil {
				return err
			}
		}
	case []interface{}:
		for i, v := range t {
			k := strconv.Itoa(i)
			err := f.FullFlattenJSON(fieldname+"_"+k+"_", v, convertString, convertBool)
			if err != nil {
				return nil
			}
		}
	case float64:
		f.Fields[fieldname] = t
	case string:
		if convertString {
			f.Fields[fieldname] = v.(string)
		} else {
			return nil
		}
	case bool:
		if convertBool {
			f.Fields[fieldname] = v.(bool)
		} else {
			return nil
		}
	case nil:
		return nil
	default:
		return fmt.Errorf("JSON Flattener: got unexpected type %T with value %v (%s)",
			t, t, fieldname)
	}
	return nil
}
159493
func (b binding) FieldMaskField() string {
	var fieldMaskField *descriptor.Field
	for _, f := range b.Method.RequestType.Fields {
		if f.GetTypeName() == ".google.protobuf.FieldMask" {
			// if there is more than 1 FieldMask for this request, then return none
			if fieldMaskField != nil {
				return ""
			}
			fieldMaskField = f
		}
	}
	if fieldMaskField != nil {
		return generator2.CamelCase(fieldMaskField.GetName())
	}
	return ""
}
846321
func (s *SearchService) DocvalueFieldsWithFormat(docvalueFields ...DocvalueField) *SearchService {
	s.searchSource = s.searchSource.DocvalueFieldsWithFormat(docvalueFields...)
	return s
}
446449
func OptFieldTypeDefault() FieldOption {
	return func(fo *FieldOptions) error {
		if fo.Type != "" {
			return errors.Errorf("field type is already set to: %s", fo.Type)
		}
		fo.Type = FieldTypeSet
		fo.CacheType = DefaultCacheType
		fo.CacheSize = DefaultCacheSize
		return nil
	}
}
1086004
func DatetimeField(name string) *Field {
	ret := FieldWithType(name, formcommon.DATETIME)
	return ret
}
1116885
func IntField(name string, value int) FieldOpt {
	switch unsafe.Sizeof(value) {
	case 4:
		return Int32Field(name, int32(value))
	case 8:
		return Int64Field(name, int64(value))
	default:
		panic("Unsupported int size")
	}
}
1244923
func convertTemplateRequestField(fieldName string, iface interface{}) (interface{}, error) {
	switch val := iface.(type) {
	case nil:
		return nil, nil
	case bool:
		return val, nil
	case float64:
		if val == float64(int64(val)) {
			return int64(val), nil
		}
	}

	str := fmt.Sprintf("the %s field must be unspecified, a boolean, or "+
		"a 64-bit integer", fieldName)
	return nil, makeError(ErrInvalidType, str)
}
902185
func (s *SearchSource) DocvalueFields(docvalueFields ...string) *SearchSource {
	for _, f := range docvalueFields {
		s.docvalueFields = append(s.docvalueFields, DocvalueField{Field: f})
	}
	return s
}
549106
func (s *logger) SetStaticField(name string, value interface{}) {
	s.staticArgs[name] = fmt.Sprintf("%v", value)
}
24473
func (s *IndicesGetFieldMappingService) Field(fields ...string) *IndicesGetFieldMappingService {
	s.field = append(s.field, fields...)
	return s
}