// SetThreshold sets the Threshold field's value.
765468
func (s *CloudWatchAlarmDefinition) SetThreshold(v float64) *CloudWatchAlarmDefinition {
	s.Threshold = &v
	return s
}
1162983
func (s *ReplicationGroupPendingModifiedValues) SetResharding(v *ReshardingStatus) *ReplicationGroupPendingModifiedValues {
	s.Resharding = v
	return s
}
322681
func (s *ScalingPolicy) SetThreshold(v float64) *ScalingPolicy {
	s.Threshold = &v
	return s
}
1120416
func (s *HistoricalMetric) SetThreshold(v *Threshold) *HistoricalMetric {
	s.Threshold = v
	return s
}
1104044
func (s *BehaviorCriteria) SetStatisticalThreshold(v *StatisticalThreshold) *BehaviorCriteria {
	s.StatisticalThreshold = v
	return s
}
39076
func (l *Logger) SetThreshold(level int) {
	atomic.StoreInt32(&l.threshold, int32(level))
}
388209
func (s *DescribeInstancesHealthOutput) SetRefreshedAt(v time.Time) *DescribeInstancesHealthOutput {
	s.RefreshedAt = &v
	return s
}
247228
func (s *ApprovalThresholdPolicy) SetThresholdPercentage(v int64) *ApprovalThresholdPolicy {
	s.ThresholdPercentage = &v
	return s
}
700741
func (v1 Vec3) ApproxEqualThreshold(v2 Vec3, threshold float32) bool {
	for i := range v1 {
		if !FloatEqualThreshold(v1[i], v2[i], threshold) {
			return false
		}
	}
	return true
}
1278714
func (s *GetReservationUtilizationOutput) SetTotal(v *ReservationAggregates) *GetReservationUtilizationOutput {
	s.Total = v
	return s
}
144783
func (lgr *logger) SetLevel(level LogPriority) {
	lgr.mutex.Lock()
	defer lgr.mutex.Unlock()

	lgr.level = level
}
1323149
func (s *Hdr10Metadata) SetMaxContentLightLevel(v int64) *Hdr10Metadata {
	s.MaxContentLightLevel = &v
	return s
}
472457
func (s *AutoScalingThresholds) SetCpuThreshold(v float64) *AutoScalingThresholds {
	s.CpuThreshold = &v
	return s
}
432157
func parseThreshold(threshold string) (min float64, max float64, err error) {
	thresh := strings.Split(threshold, ":")
	switch len(thresh) {
	case 1:
		max, err = strconv.ParseFloat(string(thresh[0]), 64)
		if err != nil {
			return 0, 0, ErrBadThresholdFormat
		}

		return 0, max, nil
	case 2:
		if thresh[0] == "~" {
			min = MinFloat64
		} else {
			min, err = strconv.ParseFloat(string(thresh[0]), 64)
			if err != nil {
				min = 0
			}
		}

		if thresh[1] == "" {
			max = MaxFloat64
		} else {
			max, err = strconv.ParseFloat(string(thresh[1]), 64)
			if err != nil {
				return 0, 0, ErrBadThresholdFormat
			}
		}
	default:
		return 0, 0, ErrBadThresholdFormat
	}

	return
}
57606
func (s *UtilizationByTime) SetTotal(v *ReservationAggregates) *UtilizationByTime {
	s.Total = v
	return s
}
519975
func (s *Counters) SetTotal(v int64) *Counters {
	s.Total = &v
	return s
}
1153273
func (rlp *RateLimitPolicy) GetThreshold(key string, regID int64) int {
	regOverride, regOverrideExists := rlp.RegistrationOverrides[regID]
	keyOverride, keyOverrideExists := rlp.Overrides[key]

	if regOverrideExists && !keyOverrideExists {
		// If there is a regOverride and no keyOverride use the regOverride
		return regOverride
	} else if !regOverrideExists && keyOverrideExists {
		// If there is a keyOverride and no regOverride use the keyOverride
		return keyOverride
	} else if regOverrideExists && keyOverrideExists {
		// If there is both a regOverride and a keyOverride use whichever is larger.
		if regOverride > keyOverride {
			return regOverride
		} else {
			return keyOverride
		}
	}

	// Otherwise there was no regOverride and no keyOverride, use the base
	// Threshold
	return rlp.Threshold
}