// AddDynamicField takes a field name and a function that will generate values
// for that metric. The function is called once every time a NewEvent() is
// created and added as a field (with name as the key) to the newly created
// event.
420649
func (c *Client) AddDynamicField(name string, fn func() interface{}) error {
	c.ensureTransmission()
	c.ensureBuilder()
	return c.builder.AddDynamicField(name, fn)
}
805296
func (s *SearchSource) FieldDataField(fieldDataField string) *SearchSource {
	s.fieldDataFields = append(s.fieldDataFields, fieldDataField)
	return s
}
174994
func (s *IndicesStatsService) FielddataFields(fielddataFields ...string) *IndicesStatsService {
	s.fielddataFields = append(s.fielddataFields, fielddataFields...)
	return s
}
704426
func NewDynamicSharedInformerFactory(client dynamic.Interface, defaultResync time.Duration) DynamicSharedInformerFactory {
	return NewFilteredDynamicSharedInformerFactory(client, defaultResync, metav1.NamespaceAll, nil)
}
395383
func (dt *DbfTable) AddNumberField(fieldName string, length uint8, prec uint8) error {
	return dt.addField(fieldName, 'N', length, prec)
}
660652
func (b *SearchRequestBuilder) AddDocValueField(field string) *SearchRequestBuilder {
	// fields field not supported on version >= 5
	if b.version < 5 {
		b.customProps["fields"] = []string{"*", "_source"}
	}

	b.customProps["script_fields"] = make(map[string]interface{})

	if b.version < 5 {
		b.customProps["fielddata_fields"] = []string{field}
	} else {
		b.customProps["docvalue_fields"] = []string{field}
	}

	return b
}
31489
func (c *Client) UpdateDynamicSnippet(i *UpdateDynamicSnippetInput) (*DynamicSnippet, error) {
	if i.Service == "" {
		return nil, ErrMissingService
	}

	if i.ID == "" {
		return nil, ErrMissingID
	}

	path := fmt.Sprintf("/service/%s/snippet/%s", i.Service, i.ID)
	resp, err := c.PutForm(path, i, nil)
	if err != nil {
		return nil, err
	}

	var updateSnippet *DynamicSnippet
	if err := decodeJSON(&updateSnippet, resp.Body); err != nil {
		return nil, err
	}
	return updateSnippet, err
}
31102
func (c *EC2Metadata) GetDynamicData(p string) (string, error) {
	op := &request.Operation{
		Name:       "GetDynamicData",
		HTTPMethod: "GET",
		HTTPPath:   sdkuri.PathJoin("/dynamic", p),
	}

	output := &metadataOutput{}
	req := c.NewRequest(op, nil, output)
	err := req.Send()

	return output.Content, err
}
266601
func (b *UpdateBuilder) AddFunc(column string, fn *Func) *UpdateBuilder {
	return b.addValue(column, fn)
}
681468
func (f *Form) NewField(label string, name string, value interface{}, showas string, fn FieldProcessor) (*Field, error) {
	tmpField := Field{
		Label:     label,
		Name:      name,
		ShowAs:    showas,
		Value:     value,
		Processor: fn,
		Hidden:    false,
	}
	f.Fields = append(f.Fields, &tmpField)
	return &tmpField, nil
}
495614
func (t *Object) DynamicValue() Type {
	if t.dynamic == nil {
		return nil
	}
	return t.dynamic.Value
}
25475
func (c *Client) GetDynamicSnippet(i *GetDynamicSnippetInput) (*DynamicSnippet, error) {
	if i.Service == "" {
		return nil, ErrMissingService
	}

	if i.ID == "" {
		return nil, ErrMissingID
	}

	path := fmt.Sprintf("/service/%s/snippet/%s", i.Service, i.ID)
	resp, err := c.Get(path, nil)
	if err != nil {
		return nil, err
	}

	var snippet *DynamicSnippet
	if err := decodeJSON(&snippet, resp.Body); err != nil {
		return nil, err
	}
	return snippet, nil
}
1342307
func (n Namespace) AddDynamicElement(name, description string) Namespace {
	nse := NamespaceElement{Name: name, Description: description, Value: "*"}
	return append(n, nse)
}
595845
func (s *ScalingInstruction) SetDisableDynamicScaling(v bool) *ScalingInstruction {
	s.DisableDynamicScaling = &v
	return s
}
1113041
func newField(path, index, name string, opts FieldOption) (*Field, error) {
	// Apply functional option.
	fo := FieldOptions{}
	err := opts(&fo)
	if err != nil {
		return nil, errors.Wrap(err, "applying option")
	}

	f := &Field{
		path:  path,
		index: index,
		name:  name,

		viewMap: make(map[string]*view),

		rowAttrStore: nopStore,

		broadcaster: NopBroadcaster,
		Stats:       stats.NopStatsClient,

		options: applyDefaultOptions(fo),

		remoteAvailableShards: roaring.NewBitmap(),

		logger: logger.NopLogger,
	}
	return f, nil
}
1056111
func (m *Table) AddField(fld *Field) {
	found := false
	for i, curFld := range m.Fields {
		if curFld.Name == fld.Name {
			found = true
			m.Fields[i] = fld
			break
		}
	}
	if !found {
		fld.idx = uint64(len(m.Fields))
		m.Fields = append(m.Fields, fld)
	}
	m.FieldMap[fld.Name] = fld
}
633882
func (c *Client) AddEvent(e contract.Event) (id string, err error) {
	conn := c.Pool.Get()
	defer conn.Close()

	if e.ID != "" {
		_, err = uuid.Parse(e.ID)
		if err != nil {
			return "", db.ErrInvalidObjectId
		}
	}
	return addEvent(conn, e)
}