// formatFilters converts user input into query parameters for filtering
// Fastly results for rules in a WAF.
166128
func (i *GetWAFRuleStatusesInput) formatFilters() map[string]string {
	input := i.Filters
	result := map[string]string{}
	pairings := map[string]interface{}{
		"filter[status]":           input.Status,
		"filter[rule][accuracy]":   input.Accuracy,
		"filter[rule][maturity]":   input.Maturity,
		"filter[rule][message]":    input.Message,
		"filter[rule][revision]":   input.Revision,
		"filter[rule][rule_id]":    input.RuleID,
		"filter[rule][tags]":       input.TagID,
		"filter[rule][tags][name]": input.TagName,
		"filter[rule][version]":    input.Version,
		"include":                  input.Tags,
		"page[size]":               input.MaxResults,
		"page[number]":             input.Page, // starts at 1, not 0
	}
	// NOTE: This setup means we will not be able to send the zero value
	// of any of these filters. It doesn't appear we would need to at present.
	for key, value := range pairings {
		switch t := reflect.TypeOf(value).String(); t {
		case "string":
			if value != "" {
				result[key] = value.(string)
			}
		case "int":
			if value != 0 {
				result[key] = strconv.Itoa(value.(int))
			}
		case "[]int":
			// convert ints to strings
			toStrings := []string{}
			values := value.([]int)
			for _, i := range values {
				toStrings = append(toStrings, strconv.Itoa(i))
			}
			// concat strings
			if len(values) > 0 {
				result[key] = strings.Join(toStrings, ",")
			}
		}
	}
	return result
}
1072508
func URLFilters(filters ...*regexp.Regexp) func(*Collector) {
	return func(c *Collector) {
		c.URLFilters = filters
	}
}
777685
func (s *DescribeAssociationExecutionsInput) SetFilters(v []*AssociationExecutionFilter) *DescribeAssociationExecutionsInput {
	s.Filters = v
	return s
}
944533
func (s *DescribeEngineDefaultParametersInput) SetFilters(v []*Filter) *DescribeEngineDefaultParametersInput {
	s.Filters = v
	return s
}
782841
func (s *ListCommandsInput) SetFilters(v []*CommandFilter) *ListCommandsInput {
	s.Filters = v
	return s
}
109923
func (s *DescribeAutomationStepExecutionsInput) SetFilters(v []*StepExecutionFilter) *DescribeAutomationStepExecutionsInput {
	s.Filters = v
	return s
}
1156479
func (a *FiltersAggregation) Filters(filters ...Query) *FiltersAggregation {
	if len(filters) > 0 {
		a.unnamedFilters = append(a.unnamedFilters, filters...)
	}
	return a
}
685593
func (s *ListRobotApplicationsInput) SetFilters(v []*Filter) *ListRobotApplicationsInput {
	s.Filters = v
	return s
}
282181
func FilterS(f func(string) bool, sl []string) (result []string) {
	result = make([]string, 0)
	for i := range sl {
		if f(sl[i]) {
			result = append(result, sl[i])
		}
	}
	return result
}
1222637
func Filters(values Values) func(*orm.Query) (*orm.Query, error) {
	return NewFilter(values).Filters
}
303261
func Formats() []Format {
	list := make([]Format, 0, len(formatsByName))
	for _, f := range formatsByName {
		list = append(list, *f)
	}
	return list
}
1227562
func (s *ListCommandInvocationsInput) SetFilters(v []*CommandFilter) *ListCommandInvocationsInput {
	s.Filters = v
	return s
}
490978
func (s *SearchDevicesInput) SetFilters(v []*Filter) *SearchDevicesInput {
	s.Filters = v
	return s
}
657215
func (s *SearchExpression) SetFilters(v []*Filter) *SearchExpression {
	s.Filters = v
	return s
}
796250
func ListByFilters(skip int, filters ...Filter) (callinfos []CallInfo) {
	filters = append(FilterCommons, filters...)
	for {
		var callinfo CallInfo
		var ok bool
		skip++

		if callinfo, ok = retrieveCallInfo(skip); !ok {
			return
		}

		valid, stop := filterAll(callinfo, filters...)
		if valid {
			callinfos = append(callinfos, callinfo)
		}
		if stop {
			return
		}
	}
}
737723
func (s *SearchProductsAsAdminInput) SetFilters(v map[string][]*string) *SearchProductsAsAdminInput {
	s.Filters = v
	return s
}
1117839
func ValidateFilters(filter filters.Args) error {
	return errdefs.InvalidParameter(filter.Validate(acceptedFilters))
}