// ConvertListOptionsToVersion converts converts a set of MetricListOptions
// to the provided GroupVersion.
964939
func (c *MetricConverter) ConvertListOptionsToVersion(opts *cmint.MetricListOptions, version schema.GroupVersion) (runtime.Object, error) {
	paramObj, err := c.UnsafeConvertToVersionVia(opts, version)
	if err != nil {
		return nil, err
	}
	return paramObj, nil
}
854963
func (s *TeamsService) ListDiscussions(ctx context.Context, teamID int64, options *DiscussionListOptions) ([]*TeamDiscussion, *Response, error) {
	u := fmt.Sprintf("teams/%v/discussions", teamID)
	u, err := addOptions(u, options)
	if err != nil {
		return nil, nil, err
	}

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	// TODO: remove custom Accept header when this API fully launches.
	req.Header.Set("Accept", mediaTypeTeamDiscussionsPreview)

	var teamDiscussions []*TeamDiscussion
	resp, err := s.client.Do(ctx, req, &teamDiscussions)
	if err != nil {
		return nil, resp, err
	}

	return teamDiscussions, resp, nil
}
1265833
func (mg *MailgunImpl) ListTemplateVersions(templateName string, opts *ListOptions) *TemplateVersionsIterator {
	r := newHTTPRequest(generateApiUrl(mg, templatesEndpoint) + "/" + templateName + "/versions")
	r.setClient(mg.Client())
	r.setBasicAuth(basicAuthUser, mg.APIKey())
	if opts != nil {
		if opts.Limit != 0 {
			r.addParameter("limit", strconv.Itoa(opts.Limit))
		}
	}
	url, err := r.generateUrlWithParameters()
	return &TemplateVersionsIterator{
		mg:                      mg,
		templateVersionListResp: templateVersionListResp{Paging: Paging{Next: url, First: url}},
		err:                     err,
	}
}
367135
func Convert_v1_PriorityClassList_To_scheduling_PriorityClassList(in *v1.PriorityClassList, out *scheduling.PriorityClassList, s conversion.Scope) error {
	return autoConvert_v1_PriorityClassList_To_scheduling_PriorityClassList(in, out, s)
}
97460
func (t ListType) ConvertToModel(value interface{}) (interface{}, error) {
	// the assumption is that work item types do not change over time...only new ones can be created
	return ConvertList(func(fieldType FieldType, value interface{}) (interface{}, error) {
		return fieldType.ConvertToModel(value)
	}, t.ComponentType, value)

}
1105034
func (s *OvsElementService) NewListOvsElementsParams() *ListOvsElementsParams {
	p := &ListOvsElementsParams{}
	p.p = make(map[string]interface{})
	return p
}
711447
func MetricsScrapingOption(path string) ServeOption {
	return func(n *core.IpfsNode, _ net.Listener, mux *http.ServeMux) (*http.ServeMux, error) {
		mux.Handle(path, promhttp.HandlerFor(prometheus.DefaultGatherer, promhttp.HandlerOpts{}))
		return mux, nil
	}
}
1177179
func (c *safeConverterWrapper) ConvertToVersion(in runtime.Object, target runtime.GroupVersioner) (runtime.Object, error) {
	return c.unsafe.ConvertToVersion(in.DeepCopyObject(), target)
}
455389
func ToListing(each EachListing) func(io.ReadCloser, error) error {
	return func(body io.ReadCloser, err error) error {
		if err != nil {
			return err
		}
		listing := Listing{}
		err = xml.NewDecoder(body).Decode(&listing)
		return each(listing, err)
	}
}
1329563
func (org *Organization) ConvertToView(usrMgr *user.Manager, valMgr *validation.Manager) (*OrganizationView, error) {
	view := &OrganizationView{}
	view.DNS = org.DNS
	view.Globalid = org.Globalid
	view.PublicKeys = org.PublicKeys
	view.SecondsValidity = org.SecondsValidity
	view.OrgOwners = org.OrgOwners
	view.OrgMembers = org.OrgMembers
	view.RequiredScopes = org.RequiredScopes
	view.IncludeSubOrgsOf = org.IncludeSubOrgsOf

	var err error
	view.Members, err = ConvertUsernamesToIdentifiers(org.Members, valMgr)
	if err != nil {
		return view, err
	}
	view.Owners, err = ConvertUsernamesToIdentifiers(org.Owners, valMgr)

	return view, err
}
784402
func convertToRuntimeSELinuxOption(opts *v1.SELinuxOptions) *runtimeapi.SELinuxOption {
	if opts == nil {
		return nil
	}

	return &runtimeapi.SELinuxOption{
		User:  opts.User,
		Role:  opts.Role,
		Type:  opts.Type,
		Level: opts.Level,
	}
}
675483
func Convert_custom_metrics_MetricListOptions_To_v1beta2_MetricListOptions(in *custommetrics.MetricListOptions, out *MetricListOptions, s conversion.Scope) error {
	return autoConvert_custom_metrics_MetricListOptions_To_v1beta2_MetricListOptions(in, out, s)
}
982020
func (e ShortcutExpander) ResourceSingularizer(resource string) (string, error) {
	return e.RESTMapper.ResourceSingularizer(expandResourceShortcut(unversioned.GroupVersionResource{Resource: resource}).Resource)
}
67734
func Convert_config_GroupResource_To_v1_GroupResource(in *config.GroupResource, out *v1.GroupResource, s conversion.Scope) error {
	return autoConvert_config_GroupResource_To_v1_GroupResource(in, out, s)
}
1031851
func sortListings(listings Listings, options ListOptions) {
	comparisonFunction := listings.lessByName
	if options.sortTime {
		comparisonFunction = listings.lessByTime
	} else if options.sortSize {
		comparisonFunction = listings.lessBySize
	}

	sort.Slice(listings, comparisonFunction)

	if options.sortReverse {
		middleIndex := (len(listings) / 2)
		if len(listings)%2 == 0 {
			middleIndex--
		}

		for i := 0; i <= middleIndex; i++ {
			frontIndex := i
			rearIndex := len(listings) - 1 - i

			if frontIndex == rearIndex {
				break
			}

			tmp := listings[frontIndex]
			listings[frontIndex] = listings[rearIndex]
			listings[rearIndex] = tmp
		}
	}
}
971063
func Convert_v1_GroupResource_To_config_GroupResource(in *v1.GroupResource, out *config.GroupResource, s conversion.Scope) error {
	return autoConvert_v1_GroupResource_To_config_GroupResource(in, out, s)
}
599235
func (b *FooJSONBuilder) ConvertList(orig []*Foo) (FooJSONList, error) {
	if orig == nil {
		return nil, nil
	}

	list := make(FooJSONList, len(orig))
	for idx, or := range orig {
		json, err := b.Convert(or)
		if err != nil {
			return nil, err
		}
		list[idx] = json
	}

	return list, nil
}