// SetUnit sets the Unit field's value.
550966
func (s *MetricValue) SetUnit(v string) *MetricValue {
	s.Unit = &v
	return s
}
581415
func (s *Profile) SetDistanceUnit(v string) *Profile {
	s.DistanceUnit = &v
	return s
}
905308
func (s *UpdateOrganizationalUnitOutput) SetOrganizationalUnit(v *OrganizationalUnit) *UpdateOrganizationalUnitOutput {
	s.OrganizationalUnit = v
	return s
}
219654
func (s *Capacity) SetCapacityUnits(v float64) *Capacity {
	s.CapacityUnits = &v
	return s
}
1210220
func (s *AutoScalingSettingsDescription) SetMaximumUnits(v int64) *AutoScalingSettingsDescription {
	s.MaximumUnits = &v
	return s
}
319125
func (s *HistoricalMetric) SetUnit(v string) *HistoricalMetric {
	s.Unit = &v
	return s
}
1169790
func (s *CurrentMetric) SetUnit(v string) *CurrentMetric {
	s.Unit = &v
	return s
}
736165
func (s *ProfileData) SetDistanceUnit(v string) *ProfileData {
	s.DistanceUnit = &v
	return s
}
1279883
func NewUnit(m map[string]int64) (*Unit, error) {
	var found bool
	for _, mult := range m {
		if mult == 1 {
			found = true
			break
		}
	}
	if !found {
		return nil, fmt.Errorf("could not find unit that maps to multiplier 1 for %v", m)
	}
	return &Unit{m}, nil
}
419757
func (s *ProfileData) SetTemperatureUnit(v string) *ProfileData {
	s.TemperatureUnit = &v
	return s
}
1255485
func (s *Spend) SetUnit(v string) *Spend {
	s.Unit = &v
	return s
}
257074
func (s *StatusAPI) SetUnitStatus(args params.SetStatus) (params.ErrorResults, error) {
	return s.unitSetter.SetStatus(args)
}
849110
func (s *Budget) SetTimeUnit(v string) *Budget {
	s.TimeUnit = &v
	return s
}
831078
func (s *AutoScalingSettingsUpdate) SetMinimumUnits(v int64) *AutoScalingSettingsUpdate {
	s.MinimumUnits = &v
	return s
}
996579
func (w *MachineLXDProfileWatcher) addUnit(topic string, value interface{}) {
	// We don't want to respond to any events until we have been fully initialized.
	select {
	case <-w.initialized:
	case <-w.tomb.Dying():
		return
	}
	var notify bool
	defer func(notify *bool) {
		if *notify {
			logger.Tracef("notifying due to add unit requires lxd profile change machine-%s", w.machineId)
			w.notify()
			w.metrics.LXDProfileChangeHit.Inc()
		} else {
			w.metrics.LXDProfileChangeMiss.Inc()
		}
	}(&notify)

	unit, okUnit := value.(*Unit)
	if !okUnit {
		w.logError("programming error, value not of type *Unit")
		return
	}
	isSubordinate := unit.Subordinate()
	unitMachineId := unit.MachineId()
	unitName := unit.Name()

	switch {
	case unitMachineId == "" && !isSubordinate:
		logger.Tracef("%s has no machineId and not a sub", unitName)
		return
	case isSubordinate:
		principal, err := w.modeler.Unit(unit.Principal())
		if err != nil {
			logger.Tracef("unit %s is subordinate, principal %s not found", unitName, unit.Principal())
			return
		}
		if w.machineId != principal.MachineId() {
			logger.Tracef("watching unit changes on machine-%s not machine-%s", w.machineId, unitMachineId)
			return
		}
	case w.machineId != unitMachineId:
		logger.Tracef("watching unit changes on machine-%s not machine-%s", w.machineId, unitMachineId)
		return
	}
	logger.Tracef("start watching %q on machine-%s", unitName, w.machineId)
	notify = w.add(unit)

	logger.Debugf("end of unit change %#v", w.applications)
}
808229
func (s *PutMetricAlarmInput) SetUnit(v string) *PutMetricAlarmInput {
	s.Unit = &v
	return s
}
1368740
func (s *CustomizedScalingMetricSpecification) SetUnit(v string) *CustomizedScalingMetricSpecification {
	s.Unit = &v
	return s
}