// SetWorkteam sets the Workteam field's value.
353853
func (s *DescribeWorkteamOutput) SetWorkteam(v *Workteam) *DescribeWorkteamOutput {
	s.Workteam = v
	return s
}
207774
func (s *ListWorkteamsOutput) SetWorkteams(v []*Workteam) *ListWorkteamsOutput {
	s.Workteams = v
	return s
}
1102130
func (s *PollForActivityTaskOutput) SetWorkflowExecution(v *WorkflowExecution) *PollForActivityTaskOutput {
	s.WorkflowExecution = v
	return s
}
151496
func UpdateTeam(t *Team, authChanged bool) (err error) {
	if len(t.Name) == 0 {
		return errors.New("empty team name")
	}

	if len(t.Description) > 255 {
		t.Description = t.Description[:255]
	}

	sess := x.NewSession()
	defer sess.Close()
	if err = sess.Begin(); err != nil {
		return err
	}

	t.LowerName = strings.ToLower(t.Name)
	has, err := x.Where("org_id=?", t.OrgID).And("lower_name=?", t.LowerName).And("id!=?", t.ID).Get(new(Team))
	if err != nil {
		return err
	} else if has {
		return ErrTeamAlreadyExist{t.OrgID, t.LowerName}
	}

	if _, err = sess.ID(t.ID).AllCols().Update(t); err != nil {
		return fmt.Errorf("update: %v", err)
	}

	// Update access for team members if needed.
	if authChanged {
		if err = t.getRepositories(sess); err != nil {
			return fmt.Errorf("getRepositories:%v", err)
		}

		for _, repo := range t.Repos {
			if err = repo.recalculateTeamAccesses(sess, 0); err != nil {
				return fmt.Errorf("recalculateTeamAccesses: %v", err)
			}
		}
	}

	return sess.Commit()
}
823475
func (p *proofSetT) SetTeamLinkMap(ctx context.Context, teamID keybase1.TeamID, linkMap linkMapT) {
	p.teamLinkMaps[teamID] = linkMap
}
402029
func (s *WorkflowExecutionFilter) SetWorkflowId(v string) *WorkflowExecutionFilter {
	s.WorkflowId = &v
	return s
}
389598
func (s *MigrationTask) SetTask(v *Task) *MigrationTask {
	s.Task = v
	return s
}
185873
func (hs *HTTPServer) UpdateTeam(c *m.ReqContext, cmd m.UpdateTeamCommand) Response {
	cmd.OrgId = c.OrgId
	cmd.Id = c.ParamsInt64(":teamId")

	if err := teamguardian.CanAdmin(hs.Bus, cmd.OrgId, cmd.Id, c.SignedInUser); err != nil {
		return Error(403, "Not allowed to update team", err)
	}

	if err := hs.Bus.Dispatch(&cmd); err != nil {
		if err == m.ErrTeamNameTaken {
			return Error(400, "Team name taken", err)
		}
		return Error(500, "Failed to update Team", err)
	}

	return Success("Team updated")
}
1250812
func (s *CreateWorkteamInput) SetWorkteamName(v string) *CreateWorkteamInput {
	s.WorkteamName = &v
	return s
}
1164417
func (s *GetGroupOutput) SetGroup(v *GroupType) *GetGroupOutput {
	s.Group = v
	return s
}
1352265
func (s *PollForDecisionTaskOutput) SetWorkflowExecution(v *WorkflowExecution) *PollForDecisionTaskOutput {
	s.WorkflowExecution = v
	return s
}
1216857
func (s *DescribeGroupOutput) SetGroup(v *Group) *DescribeGroupOutput {
	s.Group = v
	return s
}
1219108
func (s *UpdateWorkGroupInput) SetWorkGroup(v string) *UpdateWorkGroupInput {
	s.WorkGroup = &v
	return s
}
1322691
func (s *WorkGroupConfigurationUpdates) SetEnforceWorkGroupConfiguration(v bool) *WorkGroupConfigurationUpdates {
	s.EnforceWorkGroupConfiguration = &v
	return s
}
1191789
func (s *TerminateWorkflowExecutionInput) SetWorkflowId(v string) *TerminateWorkflowExecutionInput {
	s.WorkflowId = &v
	return s
}
303311
func (s *ListLabelingJobsForWorkteamInput) SetWorkteamArn(v string) *ListLabelingJobsForWorkteamInput {
	s.WorkteamArn = &v
	return s
}
1359737
func (s *GetWorkGroupOutput) SetWorkGroup(v *WorkGroup) *GetWorkGroupOutput {
	s.WorkGroup = v
	return s
}