// LimitsSet sets an app's limits.
165656
func LimitsSet(appID string, limits []string, limitType string) error {
	c, appID, err := load(appID)

	if err != nil {
		return err
	}

	limitsMap := parseLimits(limits)

	fmt.Print("Applying limits... ")

	quit := progress()
	configObj := api.Config{}

	if limitType == "cpu" {
		configObj.CPU = limitsMap
	} else {
		configObj.Memory = limitsMap
	}

	_, err = config.Set(c, appID, configObj)

	quit <- true
	<-quit

	if err != nil {
		return err
	}

	fmt.Print("done\n\n")

	return LimitsList(appID)
}
1174376
func (s *DescribeGroupsInput) SetLimit(v int64) *DescribeGroupsInput {
	s.Limit = &v
	return s
}
164957
func (s *ListVirtualNodesInput) SetLimit(v int64) *ListVirtualNodesInput {
	s.Limit = &v
	return s
}
198048
func (me *Dataset) Limit(limit uint) *Dataset {
	ret := me.copy()
	if limit > 0 {
		ret.clauses.Limit = limit
	} else {
		ret.clauses.Limit = nil
	}
	return ret
}
1357686
func (s *GetLogEventsInput) SetLimit(v int64) *GetLogEventsInput {
	s.Limit = &v
	return s
}
440174
func (s *ListRulesInput) SetLimit(v int64) *ListRulesInput {
	s.Limit = &v
	return s
}
508676
func (s *ListIpRoutesInput) SetLimit(v int64) *ListIpRoutesInput {
	s.Limit = &v
	return s
}
837073
func (s *GetFolderPathInput) SetLimit(v int64) *GetFolderPathInput {
	s.Limit = &v
	return s
}
300040
func (s *ListLoggingConfigurationsInput) SetLimit(v int64) *ListLoggingConfigurationsInput {
	s.Limit = &v
	return s
}
565381
func (s *GetAccountLimitOutput) SetLimit(v *AccountLimit) *GetAccountLimitOutput {
	s.Limit = v
	return s
}
794958
func (s *ListVaultsInput) SetLimit(v string) *ListVaultsInput {
	s.Limit = &v
	return s
}
844164
func (s *SearchGameSessionsInput) SetLimit(v int64) *SearchGameSessionsInput {
	s.Limit = &v
	return s
}
1196917
func (s *ListKeysInput) SetLimit(v int64) *ListKeysInput {
	s.Limit = &v
	return s
}
1243464
func (s *ListRegexMatchSetsInput) SetLimit(v int64) *ListRegexMatchSetsInput {
	s.Limit = &v
	return s
}
769662
func (gs *genericStore) setLimits(limits *StoreLimits) error {
	// Make a copy.
	gs.limits = limits.Clone()
	// Build will validate and apply inheritance if no error.
	if err := gs.limits.Build(); err != nil {
		return err
	}
	// We don't need the PerChannel map and the sublist. So replace
	// the map with the sublist instead.
	gs.sublist = util.NewSublist()
	for key, val := range gs.limits.PerChannel {
		// val is already a copy of the original limits.PerChannel[key],
		// so don't need to make a copy again, we own this.
		gs.sublist.Insert(key, val)
	}
	// Get rid of the map now.
	gs.limits.PerChannel = nil
	return nil
}
438615
func (s *CampaignResponse) SetLimits(v *CampaignLimits) *CampaignResponse {
	s.Limits = v
	return s
}
1107953
func (s *DescribeLogGroupsInput) SetLimit(v int64) *DescribeLogGroupsInput {
	s.Limit = &v
	return s
}