// Properties returns all properties on SampleJSONBuilder.
182869
func (b *SampleJSONBuilder) Properties() []*SamplePropertyInfo {
	return []*SamplePropertyInfo{
		b.B,
		b.C,
		b.D,
		b.E,
	}
}
1251632
func (s *MultiTermvectorService) Fields(fields []string) *MultiTermvectorService {
	s.fields = fields
	return s
}
1245494
func (b *SampleJSONBuilder) AddAll() *SampleJSONBuilder {
	b._properties["A1"] = b.A1
	b._properties["A2"] = b.A2
	b._properties["As1"] = b.As1
	b._properties["As2"] = b.As2
	b._properties["As3"] = b.As3
	b._properties["As4"] = b.As4
	return b
}
1280457
func (orig *SampleJSON) Convert() (*Sample, error) {
	ret := &Sample{}

	b := NewSampleJSONBuilder().AddAll()
	for _, info := range b._properties {
		if err := info.Decoder(orig, ret); err != nil {
			return nil, err
		}
	}

	return ret, nil
}
600078
func (s *FieldCapsService) Fields(fields ...string) *FieldCapsService {
	s.fields = append(s.fields, fields...)
	return s
}
839367
func (c Client) GetProperties(name string) (bool, map[string]string, error) {
	nameExists, err := c.nameExists(name)
	if err != nil {
		return false, nil, err
	}

	if !nameExists {
		return false, nil, nil
	}

	properties := make(map[string]string)

	var continueToken string
	for {
		res, err := c.getHTTP("Names/"+name+"/$/GetProperties", withContinue(continueToken), withParam("IncludeValues", "true"))
		if err != nil {
			return false, nil, err
		}

		var propertiesListPage PropertiesListPage
		err = json.Unmarshal(res, &propertiesListPage)
		if err != nil {
			return false, nil, fmt.Errorf("could not deserialise JSON response: %+v", err)
		}

		for _, property := range propertiesListPage.Properties {
			if property.Value.Kind != "String" {
				continue
			}
			properties[property.Name] = property.Value.Data
		}

		continueToken = propertiesListPage.ContinuationToken
		if continueToken == "" {
			break
		}
	}

	return true, properties, nil
}
880093
func NewSampleJSONBuilder() *SampleJSONBuilder {
	jb := &SampleJSONBuilder{
		_properties:        map[string]*SamplePropertyInfo{},
		_jsonPropertyMap:   map[string]*SamplePropertyInfo{},
		_structPropertyMap: map[string]*SamplePropertyInfo{},
		A: &SamplePropertyInfo{
			fieldName: "A",
			jsonName:  "foo!",
			Encoder: func(src *Sample, dest *SampleJSON) error {
				if src == nil {
					return nil
				}
				dest.A = src.A
				return nil
			},
			Decoder: func(src *SampleJSON, dest *Sample) error {
				if src == nil {
					return nil
				}
				dest.A = src.A
				return nil
			},
		},
		B: &SamplePropertyInfo{
			fieldName: "B",
			jsonName:  "b",
			Encoder: func(src *Sample, dest *SampleJSON) error {
				if src == nil {
					return nil
				}
				dest.B = src.B
				return nil
			},
			Decoder: func(src *SampleJSON, dest *Sample) error {
				if src == nil {
					return nil
				}
				dest.B = src.B
				return nil
			},
		},
	}
	jb._structPropertyMap["A"] = jb.A
	jb._jsonPropertyMap["foo!"] = jb.A
	jb._structPropertyMap["B"] = jb.B
	jb._jsonPropertyMap["b"] = jb.B
	return jb
}
16449
func ChildProperties(Properties map[string]interface{}) []raml.Property {
	props := make([]raml.Property, 0)

	for propName, propInterface := range Properties {
		props = append(props, raml.ToProperty(propName, propInterface))
	}

	return props
}
1242274
func (obj *GenericMeasure) SetProperties(ctx context.Context, prop *GenericMeasureProperties) error {
	err := obj.rpc(ctx, "SetProperties", nil, prop)
	return err 
}
468443
func (d *domainClient) GetProperties(ctx context.Context, args *GetPropertiesArgs) (reply *GetPropertiesReply, err error) {
	reply = new(GetPropertiesReply)
	if args != nil {
		err = rpcc.Invoke(ctx, "Runtime.getProperties", args, reply, d.conn)
	} else {
		err = rpcc.Invoke(ctx, "Runtime.getProperties", nil, reply, d.conn)
	}
	if err != nil {
		err = &internal.OpError{Domain: "Runtime", Op: "GetProperties", Err: err}
	}
	return
}
878811
func (b *SampleJSONBuilder) AddAll() *SampleJSONBuilder {
	b._properties["Str"] = b.Str
	b._properties["Foo"] = b.Foo
	return b
}
1053886
func NewSampleJSONBuilder() *SampleJSONBuilder {
	jb := &SampleJSONBuilder{
		_properties:        map[string]*SamplePropertyInfo{},
		_jsonPropertyMap:   map[string]*SamplePropertyInfo{},
		_structPropertyMap: map[string]*SamplePropertyInfo{},
		A1: &SamplePropertyInfo{
			fieldName: "A1",
			jsonName:  "a1",
			Encoder: func(src *Sample, dest *SampleJSON) error {
				if src == nil {
					return nil
				}
				d, err := NewInnerJSONBuilder().AddAll().Convert(&src.A1)
				if err != nil {
					return err
				}
				dest.A1 = *d
				return nil
			},
			Decoder: func(src *SampleJSON, dest *Sample) error {
				if src == nil {
					return nil
				}
				d, err := src.A1.Convert()
				if err != nil {
					return err
				}
				dest.A1 = *d
				return nil
			},
		},
		A2: &SamplePropertyInfo{
			fieldName: "A2",
			jsonName:  "a2",
			Encoder: func(src *Sample, dest *SampleJSON) error {
				if src == nil {
					return nil
				} else if src.A2 == nil {
					return nil
				}
				d, err := NewInnerJSONBuilder().AddAll().Convert(src.A2)
				if err != nil {
					return err
				}
				dest.A2 = d
				return nil
			},
			Decoder: func(src *SampleJSON, dest *Sample) error {
				if src == nil {
					return nil
				} else if src.A2 == nil {
					return nil
				}
				d, err := src.A2.Convert()
				if err != nil {
					return err
				}
				dest.A2 = d
				return nil
			},
		},
		As1: &SamplePropertyInfo{
			fieldName: "As1",
			jsonName:  "as1",
			Encoder: func(src *Sample, dest *SampleJSON) error {
				if src == nil {
					return nil
				}
				b := NewInnerJSONBuilder().AddAll()
				list := make([]InnerJSON, len(src.As1))
				for idx, obj := range src.As1 {
					d, err := b.Convert(&obj)
					if err != nil {
						return err
					}
					list[idx] = *d
				}
				dest.As1 = list
				return nil
			},
			Decoder: func(src *SampleJSON, dest *Sample) error {
				if src == nil {
					return nil
				}
				list := make([]Inner, len(src.As1))
				for idx, obj := range src.As1 {
					d, err := obj.Convert()
					if err != nil {
						return err
					}
					list[idx] = *d
				}
				dest.As1 = list
				return nil
			},
		},
		As2: &SamplePropertyInfo{
			fieldName: "As2",
			jsonName:  "as2",
			Encoder: func(src *Sample, dest *SampleJSON) error {
				if src == nil {
					return nil
				}
				list, err := NewInnerJSONBuilder().AddAll().ConvertList(src.As2)
				if err != nil {
					return err
				}
				dest.As2 = ([]*InnerJSON)(list)
				return nil
			},
			Decoder: func(src *SampleJSON, dest *Sample) error {
				if src == nil {
					return nil
				}
				list := make([]*Inner, len(src.As2))
				for idx, obj := range src.As2 {
					if obj == nil {
						continue
					}
					d, err := obj.Convert()
					if err != nil {
						return err
					}
					list[idx] = d
				}
				dest.As2 = list
				return nil
			},
		},
		As3: &SamplePropertyInfo{
			fieldName: "As3",
			jsonName:  "as3",
			Encoder: func(src *Sample, dest *SampleJSON) error {
				if src == nil {
					return nil
				} else if src.As3 == nil {
					return nil
				}
				b := NewInnerJSONBuilder().AddAll()
				list := make([]InnerJSON, len(*src.As3))
				for idx, obj := range *src.As3 {
					d, err := b.Convert(&obj)
					if err != nil {
						return err
					}
					list[idx] = *d
				}
				dest.As3 = &list
				return nil
			},
			Decoder: func(src *SampleJSON, dest *Sample) error {
				if src == nil {
					return nil
				} else if src.As3 == nil {
					return nil
				}
				list := make([]Inner, len(*src.As3))
				for idx, obj := range *src.As3 {
					d, err := obj.Convert()
					if err != nil {
						return err
					}
					list[idx] = *d
				}
				dest.As3 = &list
				return nil
			},
		},
		As4: &SamplePropertyInfo{
			fieldName: "As4",
			jsonName:  "as4",
			Encoder: func(src *Sample, dest *SampleJSON) error {
				if src == nil {
					return nil
				} else if src.As4 == nil {
					return nil
				}
				list, err := NewInnerJSONBuilder().AddAll().ConvertList(*src.As4)
				if err != nil {
					return err
				}
				dest.As4 = (*[]*InnerJSON)(&list)
				return nil
			},
			Decoder: func(src *SampleJSON, dest *Sample) error {
				if src == nil {
					return nil
				} else if src.As4 == nil {
					return nil
				}
				list := make([]*Inner, len(*src.As4))
				for idx, obj := range *src.As4 {
					if obj == nil {
						continue
					}
					d, err := obj.Convert()
					if err != nil {
						return err
					}
					list[idx] = d
				}
				dest.As4 = &list
				return nil
			},
		},
	}
	jb._structPropertyMap["A1"] = jb.A1
	jb._jsonPropertyMap["a1"] = jb.A1
	jb._structPropertyMap["A2"] = jb.A2
	jb._jsonPropertyMap["a2"] = jb.A2
	jb._structPropertyMap["As1"] = jb.As1
	jb._jsonPropertyMap["as1"] = jb.As1
	jb._structPropertyMap["As2"] = jb.As2
	jb._jsonPropertyMap["as2"] = jb.As2
	jb._structPropertyMap["As3"] = jb.As3
	jb._jsonPropertyMap["as3"] = jb.As3
	jb._structPropertyMap["As4"] = jb.As4
	jb._jsonPropertyMap["as4"] = jb.As4
	return jb
}
847416
func (v *Validator) Fields() []string {
	fields := []string{}
	for _, vr := range v.results {
		fields = append(fields, vr.field)
	}
	return fields
}
1333036
func (b *SampleJSONBuilder) Convert(orig *Sample) (*SampleJSON, error) {
	if orig == nil {
		return nil, nil
	}
	ret := &SampleJSON{}

	for _, info := range b._properties {
		if err := info.Encoder(orig, ret); err != nil {
			return nil, err
		}
	}

	return ret, nil
}
1294597
func jsonProperties(f reflect.StructField) *proto.Properties {
	var prop proto.Properties
	prop.Init(f.Type, f.Name, f.Tag.Get("protobuf"), &f)
	return &prop
}
377558
func (pr *Properties) MarshalJSON() ([]byte, error) {
	structures := make([]map[string]string, len(pr.DataFrame))

	for i, row := range pr.DataFrame {
		rowStructure := map[string]string{}
		for j, key := range pr.Header {
			value := row[j]
			rowStructure[key] = value
		}

		if pr.IsDatum {
			return json.Marshal(rowStructure)
		}

		structures[i] = rowStructure
	}

	return json.Marshal(structures)

}
1070260
func GetProperties(required bool) (*Properties, error) {
	filename := flag.String("props", "", "properties filename")
	flag.Parse()
	if *filename == "" {
		if required {
			return nil, NO_PROPS_FILE
		} else {
			return &Properties{make(map[string]string)}, nil
		}
	}
	return readPropertiesFile(*filename)
}