// GetCollaborators returns the collaborators in the ownership
351889
func (o *Ownership) GetCollaborators() map[string]Ownership_AccessType {
	if o.GetAcls() == nil {
		return nil
	}
	return o.GetAcls().GetCollaborators()
}
769805
func (o *VCenterCluster) VCenterHypervisors(info *bambou.FetchingInfo) (VCenterHypervisorsList, *bambou.Error) {

	var list VCenterHypervisorsList
	err := bambou.CurrentSession().FetchChildren(o, VCenterHypervisorIdentity, &list, info)
	return list, err
}
765127
func (a *Account) AppCollaborators(appID string) ([]Collaborator, error) {
	collaborators := make([]Collaborator, 0)
	err := a.get(a.auth.WithScope(scope.App(appID)), fmt.Sprintf("/api/v2/applications/%s/collaborators", appID), &collaborators)
	if err != nil {
		return nil, err
	}

	return collaborators, nil
}
1289097
func (api libraryApi) GetArtists(args map[string]interface{}) (result LibraryGetArtists, err error) {
	defer func() { appendCaller(err, "lastfm.Library.GetArtists") }()
	err = callGet("library.getartists", api.params, args, &result, P{
		"plain": []string{"user", "limit", "page"},
	})
	return
}
271352
func (az *Cloud) GetResourceGroups() (sets.String, error) {
	// Kubelet won't set az.nodeInformerSynced, always return configured resourceGroup.
	if az.nodeInformerSynced == nil {
		return sets.NewString(az.ResourceGroup), nil
	}

	az.nodeCachesLock.Lock()
	defer az.nodeCachesLock.Unlock()
	if !az.nodeInformerSynced() {
		return nil, fmt.Errorf("node informer is not synced when trying to GetResourceGroups")
	}

	resourceGroups := sets.NewString(az.ResourceGroup)
	for _, rg := range az.nodeResourceGroups {
		resourceGroups.Insert(rg)
	}

	return resourceGroups, nil
}
1004608
func RetentionPrometheusCollectors() []prometheus.Collector {
	mmu.RLock()
	defer mmu.RUnlock()

	var collectors []prometheus.Collector
	if rms != nil {
		collectors = append(collectors, rms.PrometheusCollectors()...)
	}
	return collectors
}
929909
func getTreeGenerators(bFactors []int) ([]generator.Generator, error) {
	var gens []generator.Generator
	for _, b := range bFactors {
		t, err := tree.New(b)
		if err != nil {
			return nil, err
		}
		gens = append(gens, t)
	}
	return gens, nil
}
362206
func (s *RepositoriesService) ListContributors(ctx context.Context, owner string, repository string, opt *ListContributorsOptions) ([]*Contributor, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/contributors", owner, repository)
	u, err := addOptions(u, opt)
	if err != nil {
		return nil, nil, err
	}

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

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

	return contributor, resp, nil
}
1197102
func (c *Client) OrganizationAppCollaboratorList(appIdentity string, lr *ListRange) ([]OrganizationAppCollaborator, error) {
	req, err := c.NewRequest("GET", "/organizations/apps/"+appIdentity+"/collaborators", nil, nil)
	if err != nil {
		return nil, err
	}

	if lr != nil {
		lr.SetHeader(req)
	}

	var organizationAppCollaboratorsRes []OrganizationAppCollaborator
	return organizationAppCollaboratorsRes, c.DoReq(req, &organizationAppCollaboratorsRes)
}
269125
func IsCollaborator(repoID, userID int64) bool {
	collaboration := &Collaboration{
		RepoID: repoID,
		UserID: userID,
	}
	has, err := x.Get(collaboration)
	if err != nil {
		log.Error(2, "get collaboration [repo_id: %d, user_id: %d]: %v", repoID, userID, err)
		return false
	}
	return has
}
734004
func SendCollaboratorMail(u, doer User, repo Repository) {
	subject := fmt.Sprintf("%s added you to %s", doer.DisplayName(), repo.FullName())

	data := map[string]interface{}{
		"Subject":  subject,
		"RepoName": repo.FullName(),
		"Link":     repo.HTMLURL(),
	}
	body, err := mailRender.HTMLString(string(MAIL_NOTIFY_COLLABORATOR), data)
	if err != nil {
		log.Error(3, "HTMLString: %v", err)
		return
	}

	msg := NewMessage([]string{u.Email()}, subject, body)
	msg.Info = fmt.Sprintf("UID: %d, add collaborator", u.ID())

	Send(msg)
}
533442
func (sm *schedulerMetrics) PrometheusCollectors() []prometheus.Collector {
	return []prometheus.Collector{
		sm.totalRunsComplete,
		sm.totalRunsActive,
		sm.runsComplete,
		sm.runsActive,
		sm.claimsComplete,
		sm.claimsActive,
	}
}
845310
func (m *blockMetrics) PrometheusCollectors() []prometheus.Collector {
	var metrics []prometheus.Collector
	metrics = append(metrics, m.compactionMetrics.PrometheusCollectors()...)
	metrics = append(metrics, m.fileMetrics.PrometheusCollectors()...)
	metrics = append(metrics, m.cacheMetrics.PrometheusCollectors()...)
	return metrics
}
946968
func (c *Client) GetBanners(ctx context.Context, ch chan *HostData) error {
	resp, err := c.startStreaming(ctx, bannersPath)
	if err != nil {
		return err
	}

	go c.handleResponseStream(resp, ch)

	return nil
}
504587
func (c *CollaboratorsController) List(ctx *app.ListCollaboratorsContext) error {
	err := c.checkSpaceExist(ctx, ctx.SpaceID.String())
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}

	isServiceAccount := token.IsSpecificServiceAccount(ctx, token.Notification)

	var currentIdentity *account.Identity
	if !isServiceAccount {
		currentIdentity, err = c.app.UserService().LoadContextIdentityIfNotBanned(ctx)
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, err)
		}
	}

	cm := make(map[uuid.UUID]account.Identity) // Use map to check duplications
	var collaborators []account.Identity
	// Collect all contributors and admins of the space
	contributors, err := c.listRoles(ctx, currentIdentity, authorization.SpaceContributorRole, isServiceAccount)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	for _, c := range contributors {
		cm[c.IdentityID] = c.Identity
		collaborators = append(collaborators, c.Identity)
	}
	admins, err := c.listRoles(ctx, currentIdentity, authorization.SpaceAdminRole, isServiceAccount)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	for _, a := range admins {
		if _, found := cm[a.IdentityID]; !found { // Add admins only if they are not already added as contributors
			collaborators = append(collaborators, a.Identity)
		}
	}

	count := len(collaborators)
	offset, limit := computePagingLimits(ctx.PageOffset, ctx.PageLimit)
	pageOffset := offset
	pageLimit := offset + limit
	if offset > count {
		pageOffset = count
	}
	if offset+limit > count {
		pageLimit = count
	}
	page := collaborators[pageOffset:pageLimit]
	resultIdentities := make([]account.Identity, len(page))
	resultUsers := make([]account.User, len(page))
	for i, idn := range page {
		user, err := c.app.Users().Load(ctx, idn.UserID.UUID)
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, autherrors.NewInternalError(ctx, err))
		}
		idn.User = *user
		resultUsers[i] = idn.User
		resultIdentities[i] = idn
	}
	log.Debug(ctx, map[string]interface{}{"offset": offset, "limit": limit, "page_offset": pageOffset, "page_limit": pageLimit, "count": len(resultIdentities), "resource_id": ctx.SpaceID.String()}, "listed collaborators for resource")

	return ctx.ConditionalEntities(resultUsers, c.config.GetCacheControlCollaborators, func() error {
		data := make([]*app.UserData, len(page))
		for i := range resultUsers {
			appUser := ConvertToAppUser(ctx.RequestData, &resultUsers[i], &resultIdentities[i], isServiceAccount)
			data[i] = appUser.Data
		}
		response := app.UserList{
			Links: &app.PagingLinks{},
			Meta:  &app.UserListMeta{TotalCount: count},
			Data:  data,
		}
		setPagingLinks(response.Links, buildAbsoluteURL(ctx.RequestData), len(page), offset, limit, count)
		return ctx.OK(&response)
	})
}
1199282
func (c *CollaboratorsController) List(ctx *app.ListCollaboratorsContext) error {
	return proxy.RouteHTTP(ctx, c.config.GetAuthShortServiceHostName())
}
358444
func (repo *Repository) refreshCollaboratorAccesses(e Engine, accessMap map[int64]AccessMode) error {
	collaborations, err := repo.getCollaborations(e)
	if err != nil {
		return fmt.Errorf("getCollaborations: %v", err)
	}
	for _, c := range collaborations {
		accessMap[c.UserID] = c.Mode
	}
	return nil
}