// ScriptField adds a single script field with the provided script.
436700
func (s *SearchSource) ScriptField(scriptField *ScriptField) *SearchSource {
	s.scriptFields = append(s.scriptFields, scriptField)
	return s
}
157389
func CopyField(from interface{}, to interface{}, name string) error {
	value, err := GetField(from, name)
	if err != nil {
		return err
	}
	return SetField(to, name, value)
}
135618
func NumberField(name string) *Field {
	ret := FieldWithType(name, formcommon.NUMBER)
	return ret
}
873857
func (m *SnapshotPrepare) Field(fieldpath []string) (string, bool) {
	if len(fieldpath) == 0 {
		return "", false
	}

	switch fieldpath[0] {
	case "key":
		return string(m.Key), len(m.Key) > 0
	case "parent":
		return string(m.Parent), len(m.Parent) > 0
	}
	return "", false
}
958738
func (s *SliceQuery) Field(field string) *SliceQuery {
	s.field = field
	return s
}
861847
func (c *Debugger) GetScriptSource(scriptId string) (string, error) {
	var v DebuggerGetScriptSourceParams
	v.ScriptId = scriptId
	return c.GetScriptSourceWithParams(&v)
}
1006748
func (q *WildcardQuery) Field(field string) *WildcardQuery {
	q.options["field"] = field
	return q
}
910439
func scriptError(c ErrorCode, desc string) Error {
	return Error{ErrorCode: c, Description: desc}
}
709588
func (a *CompositeAggregationTermsValuesSource) Field(field string) *CompositeAggregationTermsValuesSource {
	a.field = field
	return a
}
324406
func (m *TaskIO) Field(fieldpath []string) (string, bool) {
	if len(fieldpath) == 0 {
		return "", false
	}

	switch fieldpath[0] {
	case "stdin":
		return string(m.Stdin), len(m.Stdin) > 0
	case "stdout":
		return string(m.Stdout), len(m.Stdout) > 0
	case "stderr":
		return string(m.Stderr), len(m.Stderr) > 0
	case "terminal":
		return fmt.Sprint(m.Terminal), true
	}
	return "", false
}
651483
func TextField(name string, typ ...string) *Field {
	var t = formcommon.TEXT
	if len(typ) > 0 {
		t = typ[0]
	}
	return FieldWithType(name, t)
}
206239
func (a *CompositeAggregationHistogramValuesSource) Field(field string) *CompositeAggregationHistogramValuesSource {
	a.field = field
	return a
}
805296
func (s *SearchSource) FieldDataField(fieldDataField string) *SearchSource {
	s.fieldDataFields = append(s.fieldDataFields, fieldDataField)
	return s
}
408020
func (s *SearchSource) Field(fieldName string) *SearchSource {
	if s.fieldNames == nil {
		s.fieldNames = make([]string, 0)
	}
	s.fieldNames = append(s.fieldNames, fieldName)
	return s
}
889857
func (fn FieldValueFactorFunction) Field(field string) FieldValueFactorFunction {
	fn.field = field
	return fn
}
1155225
func (api *API) Field(ctx context.Context, indexName, fieldName string) (*Field, error) {
	span, _ := tracing.StartSpanFromContext(ctx, "API.Field")
	defer span.Finish()

	if err := api.validate(apiField); err != nil {
		return nil, errors.Wrap(err, "validating api method")
	}

	field := api.holder.Field(indexName, fieldName)
	if field == nil {
		return nil, newNotFoundError(ErrFieldNotFound)
	}
	return field, nil
}
1148943
func StaticField(name, content string) *Field {
	ret := FieldWithType(name, formcommon.STATIC)
	ret.SetText(content)
	return ret
}