// ToPagesGroup tries to convert seq into a PagesGroup.
483448
func ToPagesGroup(seq interface{}) (PagesGroup, error) {
	switch v := seq.(type) {
	case nil:
		return nil, nil
	case PagesGroup:
		return v, nil
	case []PageGroup:
		return PagesGroup(v), nil
	case []interface{}:
		l := len(v)
		if l == 0 {
			break
		}
		switch v[0].(type) {
		case PageGroup:
			pagesGroup := make(PagesGroup, l)
			for i, ipg := range v {
				if pg, ok := ipg.(PageGroup); ok {
					pagesGroup[i] = pg
				} else {
					return nil, fmt.Errorf("unsupported type in paginate from slice, got %T instead of PageGroup", ipg)
				}
			}
			return pagesGroup, nil
		}
	}

	return nil, nil
}
523663
func (r Billing_Invoice_Item) GetTopLevelProductGroupName() (resp string, err error) {
	err = r.Session.DoRequest("SoftLayer_Billing_Invoice_Item", "getTopLevelProductGroupName", nil, &r.Options, &resp)
	return
}
1100994
func (p *pageState) Group(key interface{}, in interface{}) (interface{}, error) {
	pages, err := page.ToPages(in)
	if err != nil {
		return nil, err
	}
	return page.PageGroup{Key: key, Pages: pages}, nil
}
385918
func RegisterGroups(r router.Party, notFoundHandler context.Handler, groups ...*Group) (actualRoutes []*router.Route) {
	var total []vroute
	for _, g := range groups {
	inner:
		for _, r := range g.routes {
			for i, tr := range total {
				if tr.method == r.method && tr.path == r.path {
					total[i].versions[g.version] = r.versions[g.version]
					continue inner
				}
			}

			total = append(total, r)
		}
	}

	for _, vr := range total {
		if notFoundHandler != nil {
			vr.versions[NotFound] = notFoundHandler
		}

		route := r.Handle(vr.method, vr.path, NewMatcher(vr.versions))
		actualRoutes = append(actualRoutes, route)
	}

	return
}
1163573
func (o *Me) AllRedundancyGroups(info *bambou.FetchingInfo) (AllRedundancyGroupsList, *bambou.Error) {

	var list AllRedundancyGroupsList
	err := bambou.CurrentSession().FetchChildren(o, AllRedundancyGroupIdentity, &list, info)
	return list, err
}
34268
func WrapGroup(router *gin.RouterGroup) {
	routers := []struct {
		Method  string
		Path    string
		Handler gin.HandlerFunc
	}{
		{"GET", "/debug/pprof/", IndexHandler()},
		{"GET", "/debug/pprof/heap", HeapHandler()},
		{"GET", "/debug/pprof/goroutine", GoroutineHandler()},
		{"GET", "/debug/pprof/allocs", AllocsHandler()},
		{"GET", "/debug/pprof/block", BlockHandler()},
		{"GET", "/debug/pprof/threadcreate", ThreadCreateHandler()},
		{"GET", "/debug/pprof/cmdline", CmdlineHandler()},
		{"GET", "/debug/pprof/profile", ProfileHandler()},
		{"GET", "/debug/pprof/symbol", SymbolHandler()},
		{"POST", "/debug/pprof/symbol", SymbolHandler()},
		{"GET", "/debug/pprof/trace", TraceHandler()},
		{"GET", "/debug/pprof/mutex", MutexHandler()},
	}

	basePath := strings.TrimSuffix(router.BasePath(), "/")
	var prefix string

	switch {
	case basePath == "":
		prefix = ""
	case strings.HasSuffix(basePath, "/debug"):
		prefix = "/debug"
	case strings.HasSuffix(basePath, "/debug/pprof"):
		prefix = "/debug/pprof"
	}

	for _, r := range routers {
		router.Handle(r.Method, strings.TrimPrefix(r.Path, prefix), r.Handler)
	}
}
960416
func (client *Client) AddDomainGroup(args *AddDomainGroupArgs) (response *AddDomainGroupResponse, err error) {
	action := "AddDomainGroup"
	response = &AddDomainGroupResponse{}
	err = client.Invoke(action, args, response)
	if err == nil {
		return response, nil
	} else {
		log.Printf("%s error, %v", action, err)
		return response, err
	}
}
929527
func (r *RoleBindingBuilder) Groups(groups ...string) *RoleBindingBuilder {
	for _, group := range groups {
		r.RoleBinding.Subjects = append(r.RoleBinding.Subjects, rbacv1.Subject{Kind: rbacv1.GroupKind, APIGroup: GroupName, Name: group})
	}
	return r
}
581432
func ParseGroupResource(gr string) GroupResource {
	if i := strings.Index(gr, "."); i >= 0 {
		return GroupResource{Group: gr[i+1:], Resource: gr[:i]}
	}
	return GroupResource{Resource: gr}
}
852895
func respBodyToSecGroup(body io.ReadCloser, c *Client) (*SecGroup, error) {
	//get the json from the response body
	bodyRaw, err := ioutil.ReadAll(body)
	if err != nil {
		return nil, errors.Wrap(err, "Could not read response body")
	}
	jStruct := SecGroupResource{}
	//make it a SecGroup
	err = json.Unmarshal(bodyRaw, &jStruct)
	if err != nil {
		return nil, errors.Wrap(err, "Could not unmarshal response body as json")
	}
	//pull a few extra fields from other places
	ret := jStruct.Entity
	ret.Guid = jStruct.Meta.Guid
	ret.CreatedAt = jStruct.Meta.CreatedAt
	ret.UpdatedAt = jStruct.Meta.UpdatedAt
	ret.c = c
	return &ret, nil
}
322689
func (o *Enterprise) SaaSApplicationGroups(info *bambou.FetchingInfo) (SaaSApplicationGroupsList, *bambou.Error) {

	var list SaaSApplicationGroupsList
	err := bambou.CurrentSession().FetchChildren(o, SaaSApplicationGroupIdentity, &list, info)
	return list, err
}
102243
func (cr *Context) PopGroup() *Pattern {
	ret := wrapPattern(C.cairo_pop_group(cr.Ptr))
	if err := cr.status(); err != nil {
		panic(err)
	}
	return ret
}
1123898
func (groups *Groups) AddGroup(newGroup *Group) {
	if newGroup.GroupID != "" {
		for key, group := range groups.Groups.Items {
			if group.GroupID == newGroup.GroupID {
				groups.Groups.Items[key] = newGroup
				return
			}
		}
	}

	newGroup.parent = groups

	groups.Groups.Items = append(groups.Groups.Items, newGroup)
}
344898
func (p PageGroup) Slice(in interface{}) (interface{}, error) {
	switch items := in.(type) {
	case PageGroup:
		return items, nil
	case []interface{}:
		groups := make(PagesGroup, len(items))
		for i, v := range items {
			g, ok := v.(PageGroup)
			if !ok {
				return nil, fmt.Errorf("type %T is not a PageGroup", v)
			}
			groups[i] = g
		}
		return groups, nil
	default:
		return nil, fmt.Errorf("invalid slice type %T", items)
	}
}
857512
func (p Pages) GroupByPublishDate(format string, order ...string) (PagesGroup, error) {
	sorter := func(p Pages) Pages {
		return p.ByPublishDate()
	}
	formatter := func(p Page) string {
		return p.PublishDate().Format(format)
	}
	return p.groupByDateField(sorter, formatter, order...)
}
816328
func (sd *StorageGroupDefinition) IterateSets(iterator dslengine.SetIterator) {
	// First run the top level StorageGroup

	iterator([]dslengine.Definition{sd})
	sd.IterateStores(func(store *RelationalStoreDefinition) error {
		iterator([]dslengine.Definition{store})
		store.IterateModels(func(model *RelationalModelDefinition) error {
			iterator([]dslengine.Definition{model})
			model.IterateFields(func(field *RelationalFieldDefinition) error {
				iterator([]dslengine.Definition{field})
				return nil
			})
			model.IterateBuildSources(func(bs *BuildSource) error {
				iterator([]dslengine.Definition{bs})
				return nil
			})

			return nil
		})
		return nil
	})
}
1268748
func (r *marathonClient) Groups() (*Groups, error) {
	groups := new(Groups)
	if err := r.apiGet(marathonAPIGroups, "", groups); err != nil {
		return nil, err
	}
	return groups, nil
}