// ToProperty implements datastore.PropertyConverter.
336449
func (v *VM) ToProperty() (datastore.Property, error) {
	p := datastore.Property{}
	// noindex is not respected in the tags in the model.
	return p, p.SetValue(proto.MarshalTextString(v), datastore.NoIndex)
}
1356753
func (c Common) Properties(ctx context.Context, r types.ManagedObjectReference, ps []string, dst interface{}) error {
	return property.DefaultCollector(c.c).RetrieveOne(ctx, r, ps, dst)
}
657746
func (bf *BitField) ToProperty() (datastore.Property, error) {
	bs, err := bf.MarshalBinary()
	return datastore.MkPropertyNI(bs), err
}
819438
func (dp *Datapoint) RemoveProperty(key string) {
	if dp.Meta[tsProperty] != nil {
		delete(dp.GetProperties(), key)
		if len(dp.GetProperties()) == 0 {
			delete(dp.Meta, tsProperty)
		}
	}
}
271512
func (group *Group) NewProperty(contract *Contract) (*Property, error) {
	property := NewProperty(NewProperties())
	property.Contract = contract
	property.Group = group
	return property, nil
}
194647
func (cfg *Config) FromProperty(p datastore.Property) error {
	return proto.UnmarshalText(p.Value().(string), cfg)
}
660751
func (bp BodiesProperty) GetProperty(name string) Property {
	p, ok := bp.Properties[name]
	if !ok {
		panic(fmt.Errorf("can't find property name %v", name))
	}
	return toProperty(name, p)
}
1120299
func (property *Property) GetProperty() error {
	req, err := client.NewRequest(
		Config,
		"GET",
		fmt.Sprintf(
			"/papi/v1/properties/%s",
			property.PropertyID,
		),
		nil,
	)
	if err != nil {
		return err
	}

	res, err := client.Do(Config, req)
	if err != nil {
		return err
	}

	if client.IsError(res) {
		return client.NewAPIError(res)
	}

	newProperties := NewProperties()
	if err := client.BodyJSON(res, newProperties); err != nil {
		return err
	}

	property.AccountID = newProperties.Properties.Items[0].AccountID
	property.Contract = newProperties.Properties.Items[0].Contract
	property.Group = newProperties.Properties.Items[0].Group
	property.ContractID = newProperties.Properties.Items[0].ContractID
	property.GroupID = newProperties.Properties.Items[0].GroupID
	property.PropertyID = newProperties.Properties.Items[0].PropertyID
	property.PropertyName = newProperties.Properties.Items[0].PropertyName
	property.LatestVersion = newProperties.Properties.Items[0].LatestVersion
	property.StagingVersion = newProperties.Properties.Items[0].StagingVersion
	property.ProductionVersion = newProperties.Properties.Items[0].ProductionVersion
	property.Note = newProperties.Properties.Items[0].Note
	property.ProductID = newProperties.Properties.Items[0].ProductID
	property.RuleFormat = newProperties.Properties.Items[0].RuleFormat
	property.CloneFrom = newProperties.Properties.Items[0].CloneFrom

	return nil
}
1131895
func (b *SampleJSONBuilder) Properties() []*SamplePropertyInfo {
	return []*SamplePropertyInfo{
		b.A,
		b.B,
		b.C,
		b.D,
		b.F,
		b.G,
	}
}
484526
func (s *HadoopStepConfig) SetProperties(v map[string]*string) *HadoopStepConfig {
	s.Properties = v
	return s
}
354851
func (b *FooJSONBuilder) Properties() []*FooPropertyInfo {
	return []*FooPropertyInfo{
		b.Tmp,
		b.Bar,
		b.Buzz,
		b.Hoge,
		b.Fuga,
	}
}
63482
func (m *GenericParser) getProperty(mapKey reflect.Value) (Property, error) {
	properteerType := reflect.TypeOf(new(Properteer)).Elem()
	stringerType := reflect.TypeOf(new(fmt.Stringer)).Elem()

	// if mapKey implements the pdk.Properteer interface, use that.
	if k2, ok := anyImplements(mapKey, properteerType); ok {
		return k2.Interface().(Properteer).Property(), nil
	}
	// if mapKey implements fmt.Stringer, use that.
	if k2, ok := anyImplements(mapKey, stringerType); ok {
		return Property(k2.Interface().(fmt.Stringer).String()), nil
	}

	// Otherwise, handle all comparable types (see https://golang.org/ref/spec#Comparison_operators):
	mapKey = deref(mapKey)
	switch k := mapKey.Kind(); k {
	case reflect.Bool, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64, reflect.String:
		return Property(fmt.Sprintf("%v", mapKey)), nil
	case reflect.Chan:
		m.Stats.Count("parser.getProperty.Chan", 1, 1)
		return "", errors.New("channel cannot be converted to property")
	case reflect.Array:
		m.Stats.Count("parser.getProperty."+k.String(), 1, 1)
		return "", errors.New("array cannot be converted to property")
	case reflect.Struct:
		m.Stats.Count("parser.getProperty."+k.String(), 1, 1)
		return "", errors.New("struct cannot be converted to property")
	case reflect.Complex128, reflect.Complex64:
		m.Stats.Count("parser.getProperty."+k.String(), 1, 1)
		return "", errors.New("complex value cannot be converted to property")
	default:
		m.Stats.Count("parser.getProperty."+k.String(), 1, 1)
		return "", errors.Errorf("unexpected kind: %v mapKey: %v", mapKey.Kind(), mapKey)
	}
}
424344
func (this *SchemaField) Prop(key string) (interface{}, bool) {
	if this.Properties != nil {
		if prop, ok := this.Properties[key]; ok {
			return prop, true
		}
	}
	return nil, false
}
845460
func (s *StackResourceDrift) SetPropertyDifferences(v []*PropertyDifference) *StackResourceDrift {
	s.PropertyDifferences = v
	return s
}
973245
func (f *Feature) PropertyString(key string) (string, error) {
	if s, ok := (f.Properties[key]).(string); ok {
		return s, nil
	}
	return "", fmt.Errorf("type assertion of `%s` to string failed", key)
}
412789
func PropType(t string) Property {
	return Property{
		Name:  "Type",
		Value: dbus.MakeVariant(t),
	}
}
346256
func (s *PerformanceMetrics) SetProperties(v map[string]*string) *PerformanceMetrics {
	s.Properties = v
	return s
}