// Field returns the value for the given fieldpath as a string, if defined.
// If the value is not defined, the second value will be false.
504530
func (m *ContentDelete) Field(fieldpath []string) (string, bool) {
	if len(fieldpath) == 0 {
		return "", false
	}

	switch fieldpath[0] {
	case "digest":
		return string(m.Digest), len(m.Digest) > 0
	}
	return "", false
}
1118540
func (v *OneField) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.Field != nil {
		fields[i] = fmt.Sprintf("Field: %v", v.Field)
		i++
	}

	return fmt.Sprintf("OneField{%v}", strings.Join(fields[:i], ", "))
}
222361
func (m *Match) Field(mt XMType) *XM {
	for _, xm := range m.Fields {
		if xm.Type == mt {
			return &xm
		}
	}

	return nil
}
68854
func (v *ResultErrorFields) Field() string {
	return strings.TrimPrefix(v.context.String(), STRING_ROOT_SCHEMA_PROPERTY+".")
}
1072709
func Field(fieldPtr interface{}, rules ...Rule) *FieldRules {
	return &FieldRules{
		fieldPtr: fieldPtr,
		rules:    rules,
	}
}
943853
func (e *Envelope) Field(fieldpath []string) (string, bool) {
	if len(fieldpath) == 0 {
		return "", false
	}

	switch fieldpath[0] {
	// unhandled: timestamp
	case "namespace":
		return e.Namespace, len(e.Namespace) > 0
	case "topic":
		return e.Topic, len(e.Topic) > 0
	case "event":
		decoded, err := typeurl.UnmarshalAny(e.Event)
		if err != nil {
			return "", false
		}

		adaptor, ok := decoded.(interface {
			Field([]string) (string, bool)
		})
		if !ok {
			return "", false
		}
		return adaptor.Field(fieldpath[1:])
	}
	return "", false
}
879001
func (fs *UnstructAdapter) GetFieldValue(path string) (string, error) {
	fields, err := parseFields(path)
	if err != nil {
		return "", err
	}
	s, found, err := unstructured.NestedString(
		fs.UnstructuredContent(), fields...)
	if found || err != nil {
		return s, err
	}
	return "", fmt.Errorf("no field named '%s'", path)
}
100149
func (p *printer) Field(field *descriptor.FieldDescriptorProto) {
	p.MaybeLeadingComments(field)
	if descutil.Repeated(field) {
		p.Printf("repeated ")
	}

	typeName := fieldTypeName[field.GetType()]
	if typeName == "" {
		typeName = p.shorten(field.GetTypeName())
	}
	if typeName == "" {
		typeName = "<unsupported type>"
	}
	p.Printf("%s %s = %d;\n", typeName, field.GetName(), field.GetNumber())
}
86506
func (p *Packet) Field(typ byte) []byte {
	b := p.b
	for len(b) > 0 {
		if len(b) < 2 {
			return nil
		}
		l, t := b[0], b[1]
		if int(l) < 1 || len(b) < int(1+l) {
			return nil
		}
		if t == typ {
			return b[2 : 2+l-1]
		}
		b = b[1+l:]
	}
	return nil
}
853088
func (m *TaskExecAdded) Field(fieldpath []string) (string, bool) {
	if len(fieldpath) == 0 {
		return "", false
	}

	switch fieldpath[0] {
	case "container_id":
		return string(m.ContainerID), len(m.ContainerID) > 0
	case "exec_id":
		return string(m.ExecID), len(m.ExecID) > 0
	}
	return "", false
}
500767
func (a *DiversifiedSamplerAggregation) Field(field string) *DiversifiedSamplerAggregation {
	a.field = field
	return a
}
286672
func (m *ContainerUpdate) Field(fieldpath []string) (string, bool) {
	if len(fieldpath) == 0 {
		return "", false
	}

	switch fieldpath[0] {
	case "id":
		return string(m.ID), len(m.ID) > 0
	case "image":
		return string(m.Image), len(m.Image) > 0
	case "labels":
		// Labels fields have been special-cased by name. If this breaks,
		// add better special casing to fieldpath plugin.
		if len(m.Labels) == 0 {
			return "", false
		}
		value, ok := m.Labels[strings.Join(fieldpath[1:], ".")]
		return value, ok
	case "snapshot_key":
		return string(m.SnapshotKey), len(m.SnapshotKey) > 0
	}
	return "", false
}
868544
func (c *expressionCompiler) Field(f *criteria.FieldExpression) interface{} {
	if strings.Contains(f.FieldName, `"`) {
		c.err = append(c.err, errs.Errorf("field name must not contain double quotes: %s", f.FieldName))
		return nil
	}
	if strings.Contains(f.FieldName, `'`) {
		c.err = append(c.err, errs.Errorf("field name must not contain single quotes: %s", f.FieldName))
		return nil
	}

	mappedFieldName, isJSONField := c.getFieldName(f.FieldName)

	// Check if this field is referencing joinable data
	for _, j := range c.joins {
		if j.HandlesFieldName(mappedFieldName) {
			j.Active = true
			col, err := j.TranslateFieldName(mappedFieldName)
			if err != nil {
				c.err = append(c.err, errs.Wrapf(err, `failed to translate field "%s"`, mappedFieldName))
			}
			return col // e.g. "iter.name"
		}
	}

	if !isJSONField {
		return mappedFieldName
	}
	if strings.Contains(mappedFieldName, "'") {
		// beware of injection, it's a reasonable restriction for field names,
		// make sure it's not allowed when creating wi types
		c.err = append(c.err, errs.Errorf("single quote not allowed in field name: %s", mappedFieldName))
		return nil
	}

	// default to plain json field (e.g. for ID comparisons)
	return Column(WorkItemStorage{}.TableName(), "fields") + ` @> '{"` + mappedFieldName + `"`
}
63848
func (m *SnapshotCommit) 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 "name":
		return string(m.Name), len(m.Name) > 0
	}
	return "", false
}
558270
func (m *TaskDelete) Field(fieldpath []string) (string, bool) {
	if len(fieldpath) == 0 {
		return "", false
	}

	switch fieldpath[0] {
	// unhandled: pid
	// unhandled: exit_status
	// unhandled: exited_at
	case "container_id":
		return string(m.ContainerID), len(m.ContainerID) > 0
	case "id":
		return string(m.ID), len(m.ID) > 0
	}
	return "", false
}
500741
func (a Fields) String() string {
	var str []string
	for _, f := range a {
		str = append(str, f.String())
	}
	return strings.Join(str, ", ")
}
910289
func (entry *Entry) Field(name string) (value string, err error) {
	value, ok := entry.fields[name]
	if !ok {
		err = fmt.Errorf("field '%v' does not found in record %+v", name, *entry)
	}
	return
}