// NewProperties creates an object of type Properties if possible, returning an error if not.
167585
func NewProperties(in interface{}, context *compiler.Context) (*Properties, error) {
	errors := make([]error, 0)
	x := &Properties{}
	m, ok := compiler.UnpackMap(in)
	if !ok {
		message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
		errors = append(errors, compiler.NewError(context, message))
	} else {
		// repeated NamedSchemaOrReference additional_properties = 1;
		// MAP: SchemaOrReference
		x.AdditionalProperties = make([]*NamedSchemaOrReference, 0)
		for _, item := range m {
			k, ok := compiler.StringValue(item.Key)
			if ok {
				v := item.Value
				pair := &NamedSchemaOrReference{}
				pair.Name = k
				var err error
				pair.Value, err = NewSchemaOrReference(v, compiler.NewContext(k, context))
				if err != nil {
					errors = append(errors, err)
				}
				x.AdditionalProperties = append(x.AdditionalProperties, pair)
			}
		}
	}
	return x, compiler.NewErrorGroupOrNil(errors)
}
266102
func (c *Conn) getProperties(path dbus.ObjectPath, dbusInterface string) (map[string]interface{}, error) {
	var err error
	var props map[string]dbus.Variant

	if !path.IsValid() {
		return nil, fmt.Errorf("invalid unit name: %v", path)
	}

	obj := c.sysconn.Object("org.freedesktop.systemd1", path)
	err = obj.Call("org.freedesktop.DBus.Properties.GetAll", 0, dbusInterface).Store(&props)
	if err != nil {
		return nil, err
	}

	out := make(map[string]interface{}, len(props))
	for k, v := range props {
		out[k] = v.Value()
	}

	return out, nil
}
870293
func NewPropertyGroupTemplate(Name string, Description string, Fields []*PropertyFieldTemplate) *PropertyGroupTemplate {
	s := new(PropertyGroupTemplate)
	s.Name = Name
	s.Description = Description
	s.Fields = Fields
	return s
}
967607
func NewPropertiesSearchResult(Matches []*PropertiesSearchMatch) *PropertiesSearchResult {
	s := new(PropertiesSearchResult)
	s.Matches = Matches
	return s
}
408945
func (db *AgendaDB) countProperties() error {
	numAgendas, err := db.sdb.Count(&AgendaTagged{})
	if err != nil {
		log.Errorf("Agendas count failed: %v\n", err)
		return err
	}

	db.NumAgendas = numAgendas
	return nil
}
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
}
1280402
func GetProperties(contract *Contract, group *Group) (*Properties, error) {
	properties := NewProperties()
	if err := properties.GetProperties(contract, group); err != nil {
		return nil, err
	}

	return properties, nil
}
1075650
func (group *Group) GetProperties(contract *Contract) (*Properties, error) {
	return GetProperties(contract, group)
}
419833
func (c *edgeCollection) Properties(ctx context.Context) (CollectionProperties, error) {
	result, err := c.rawCollection().Properties(ctx)
	if err != nil {
		return CollectionProperties{}, WithStack(err)
	}
	return result, nil
}
910947
func NewJSONSchemaFromProps(t *Type, properties map[string]interface{}, typ, name string) JSONSchema {
	var required []string

	if isTypeArray(typ) {
		return newArraySchema(t, typ, name)
	}

	props := make(map[string]property, len(properties))
	for name := range properties {
		rp := t.GetProperty(name)
		if !isPropTypeSupported(rp) {
			continue
		}

		p := newProperty(rp)
		props[p.Name] = p
		if p.Required {
			required = append(required, p.Name)
		}
	}

	// we need it to be sorted for testing purpose
	sort.Strings(required)
	js := JSONSchema{
		Schema:     schemaVer,
		Name:       name,
		Type:       typ,
		T:          t,
		Properties: props,
		Required:   required,
	}
	if js.T == nil {
		js.T = &Type{
			Type:       typ,
			Properties: properties,
		}
	}
	return js
}
524722
func (s *JobDefinition) SetNodeProperties(v *NodeProperties) *JobDefinition {
	s.NodeProperties = v
	return s
}
541831
func combineProperties(a, b *Properties) *Properties {
	r := &Properties{values: make(map[key]attr)}
	for k, v := range a.values {
		r.values[k] = v
	}
	r.updateMissing(b)
	return r
}
368392
func AppendProperties(propertiesFile string, properties ...*Property) error {
	file, err := os.OpenFile(propertiesFile, os.O_RDWR|os.O_APPEND, NewFilePermissions)
	if err != nil {
		return err
	}
	for _, property := range properties {
		file.WriteString(fmt.Sprintf("\n%s\n", property.String()))
	}
	return file.Close()
}
946618
func properties(b *buildbot.Build) (result []*ui.PropertyGroup) {
	groups := map[string]*ui.PropertyGroup{}
	allProps := map[string]Prop{}
	for _, prop := range b.Properties {
		allProps[prop.Name] = Prop{
			Value: prop.Value,
			Group: prop.Source,
		}
	}
	for key, prop := range allProps {
		value := prop.Value
		groupName := prop.Group
		if _, ok := groups[groupName]; !ok {
			groups[groupName] = &ui.PropertyGroup{GroupName: groupName}
		}
		vs := parseProp(value)
		groups[groupName].Property = append(groups[groupName].Property, &ui.Property{
			Key:   key,
			Value: vs,
		})
	}
	// Insert the groups into a list in alphabetical order.
	// You have to make a separate sorting data structure because Go doesn't like
	// sorting things for you.
	groupNames := make([]string, 0, len(groups))
	for n := range groups {
		groupNames = append(groupNames, n)
	}
	sort.Strings(groupNames)
	for _, k := range groupNames {
		group := groups[k]
		// Also take this oppertunity to sort the properties within the groups.
		sort.Sort(group)
		result = append(result, group)
	}
	return
}
1095734
func (b *SampleJSONBuilder) Properties() []*SamplePropertyInfo {
	return []*SamplePropertyInfo{
		b.A,
		b.B,
		b.C,
	}
}
191919
func (o *ObjectConstraint) MaxProperties(n int) *ObjectConstraint {
	o.maxProperties = n
	return o
}
517579
func (s *RegisterJobDefinitionInput) SetNodeProperties(v *NodeProperties) *RegisterJobDefinitionInput {
	s.NodeProperties = v
	return s
}