Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,6 @@ linters:
- SCIMUserAttributes
- SourceImportAuthor
- Subscription
- TeamAddTeamMembershipOptions
- TeamAddTeamRepoOptions
- TeamProjectOptions
- UpdateDefaultSetupConfigurationOptions
- UpdateProjectItemOptions
- UserSuspendOptions
Expand All @@ -261,9 +258,6 @@ linters:
- RepositoryAddCollaboratorOptions
- RepositoryContentFileOptions
- RepositoryCreateForkOptions
- TeamAddTeamMembershipOptions
- TeamAddTeamRepoOptions
- TeamProjectOptions
- UpdateCheckRunOptions
- UpdateDefaultSetupConfigurationOptions
- UpdateProjectItemOptions
Expand Down Expand Up @@ -444,8 +438,6 @@ linters:
- SearchOptions.AdvancedSearch
- Secret.SelectedRepositoriesURL # TODO: Actions
- Secret.Visibility # TODO: Actions
- TeamAddTeamMembershipOptions.Role # TODO: Teams
- TeamAddTeamRepoOptions.Permission # TODO: Teams
- UpdateRuleParameters.UpdateAllowsFetchAndMerge # TODO: Rules
- UsageReportOptions.Day
- UsageReportOptions.Hour
Expand Down
48 changes: 24 additions & 24 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 33 additions & 27 deletions github/github-accessors_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 9 additions & 11 deletions github/teams.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,8 @@ func (s *TeamsService) IsTeamRepoBySlug(ctx context.Context, org, slug, owner, r
return repository, resp, nil
}

// TeamAddTeamRepoOptions specifies the optional parameters to the
// TeamsService.AddTeamRepoByID and TeamsService.AddTeamRepoBySlug methods.
type TeamAddTeamRepoOptions struct {
// AddTeamRepoRequest represents a request to add or update a team's permissions on a repository.
type AddTeamRepoRequest struct {
// Permission specifies the permission to grant the team on this repository.
// Possible values are:
// pull - team members can pull, but not push to or administer this repository
Expand All @@ -528,7 +527,7 @@ type TeamAddTeamRepoOptions struct {
// triage - team members can proactively manage issues and pull requests without write access.
//
// If not specified, the team's permission attribute will be used.
Permission string `json:"permission,omitempty"`
Permission *string `json:"permission,omitempty"`
}

// AddTeamRepoByID adds a repository to be managed by the specified team given the team ID.
Expand All @@ -538,7 +537,7 @@ type TeamAddTeamRepoOptions struct {
// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#add-or-update-team-repository-permissions
//
//meta:operation PUT /organizations/{organization_id}/team/{team_id}/repos/{owner}/{repo}
func (s *TeamsService) AddTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string, body *TeamAddTeamRepoOptions) (*Response, error) {
func (s *TeamsService) AddTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string, body AddTeamRepoRequest) (*Response, error) {
u := fmt.Sprintf("organizations/%v/team/%v/repos/%v/%v", orgID, teamID, owner, repo)
req, err := s.client.NewRequest(ctx, "PUT", u, body)
if err != nil {
Expand All @@ -555,7 +554,7 @@ func (s *TeamsService) AddTeamRepoByID(ctx context.Context, orgID, teamID int64,
// GitHub API docs: https://docs.github.com/rest/teams/teams?apiVersion=2022-11-28#add-or-update-team-repository-permissions
//
//meta:operation PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}
func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string, body *TeamAddTeamRepoOptions) (*Response, error) {
func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string, body AddTeamRepoRequest) (*Response, error) {
u := fmt.Sprintf("orgs/%v/teams/%v/repos/%v/%v", org, slug, owner, repo)
req, err := s.client.NewRequest(ctx, "PUT", u, body)
if err != nil {
Expand Down Expand Up @@ -729,9 +728,8 @@ func (s *TeamsService) ReviewTeamProjectsBySlug(ctx context.Context, org, slug s
return projects, resp, nil
}

// TeamProjectOptions specifies the optional parameters to the
// TeamsService.AddTeamProject method.
type TeamProjectOptions struct {
// AddTeamProjectRequest represents a request to add or update a team's permissions on a project.
type AddTeamProjectRequest struct {
// Permission specifies the permission to grant to the team for this project.
// Possible values are:
// "read" - team members can read, but not write to or administer this project.
Expand All @@ -750,7 +748,7 @@ type TeamProjectOptions struct {
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#add-or-update-team-project-permissions
//
//meta:operation PUT /organizations/{organization_id}/team/{team_id}/projects/{project_id}
func (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, projectID int64, body *TeamProjectOptions) (*Response, error) {
func (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, projectID int64, body AddTeamProjectRequest) (*Response, error) {
u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID)
req, err := s.client.NewRequest(ctx, "PUT", u, body)
if err != nil {
Expand All @@ -771,7 +769,7 @@ func (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, pr
// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#add-or-update-team-project-permissions
//
//meta:operation PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}
func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug string, projectID int64, body *TeamProjectOptions) (*Response, error) {
func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug string, projectID int64, body AddTeamProjectRequest) (*Response, error) {
u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID)
req, err := s.client.NewRequest(ctx, "PUT", u, body)
if err != nil {
Expand Down
11 changes: 5 additions & 6 deletions github/teams_members.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,8 @@ func (s *TeamsService) GetTeamMembershipBySlug(ctx context.Context, org, slug, u
return t, resp, nil
}

// TeamAddTeamMembershipOptions specifies the optional
// parameters to the TeamsService.AddTeamMembership method.
type TeamAddTeamMembershipOptions struct {
// AddTeamMembershipRequest represents a request to add or update a user's membership in a team.
type AddTeamMembershipRequest struct {
// Role specifies the role the user should have in the team. Possible
// values are:
// member - a normal member of the team
Expand All @@ -129,7 +128,7 @@ type TeamAddTeamMembershipOptions struct {
// maintainer, and edit the team’s name and description
//
// Default value is "member".
Role string `json:"role,omitempty"`
Role *string `json:"role,omitempty"`
}

// AddTeamMembershipByID adds or invites a user to a team, given a specified
Expand All @@ -138,7 +137,7 @@ type TeamAddTeamMembershipOptions struct {
// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#add-or-update-team-membership-for-a-user
//
//meta:operation PUT /organizations/{organization_id}/team/{team_id}/memberships/{username}
func (s *TeamsService) AddTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string, body *TeamAddTeamMembershipOptions) (*Membership, *Response, error) {
func (s *TeamsService) AddTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string, body AddTeamMembershipRequest) (*Membership, *Response, error) {
u := fmt.Sprintf("organizations/%v/team/%v/memberships/%v", orgID, teamID, user)
req, err := s.client.NewRequest(ctx, "PUT", u, body)
if err != nil {
Expand All @@ -160,7 +159,7 @@ func (s *TeamsService) AddTeamMembershipByID(ctx context.Context, orgID, teamID
// GitHub API docs: https://docs.github.com/rest/teams/members?apiVersion=2022-11-28#add-or-update-team-membership-for-a-user
//
//meta:operation PUT /orgs/{org}/teams/{team_slug}/memberships/{username}
func (s *TeamsService) AddTeamMembershipBySlug(ctx context.Context, org, slug, user string, body *TeamAddTeamMembershipOptions) (*Membership, *Response, error) {
func (s *TeamsService) AddTeamMembershipBySlug(ctx context.Context, org, slug, user string, body AddTeamMembershipRequest) (*Membership, *Response, error) {
u := fmt.Sprintf("orgs/%v/teams/%v/memberships/%v", org, slug, user)
req, err := s.client.NewRequest(ctx, "PUT", u, body)
if err != nil {
Expand Down
Loading
Loading