Repository: google/go-github
Pull request #3349 (2024-11-17 10:07:24)

Add missing permissions to struct
Added permissions:

- repository_custom_properties
- repository_advisories
- merge_queues
- discussions
- dependabot_secrets
- codespaces_secrets
- codespaces_metadata
- codespaces_lifecycle_admin
- codespaces

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/google/go-github/pull/3349?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 92.30%. Comparing base [(`2b8c7fa`)](https://app.codecov.io/gh/google/go-github/commit/2b8c7fa86fcd1cb4a89a44c8e7b5a49fe4be8a45?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) to head [(`aa98173`)](https://app.codecov.io/gh/google/go-github/commit/aa98173fad7431422a49a3c31ac76c0f88993b46?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).
> Report is 170 commits behind head on master.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##           master    #3349      +/-   ##
==========================================
- Coverage   97.72%   92.30%   -5.42%     
==========================================
  Files         153      176      +23     
  Lines       13390    15031    +1641     
==========================================
+ Hits        13085    13874     +789     
- Misses        215     1064     +849     
- Partials       90       93       +3     
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/google/go-github/pull/3349?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).


Patch:
diff --git a/github/apps.go b/github/apps.go
index 2f74c2c2..4757dedf 100644
--- a/github/apps.go
+++ b/github/apps.go
@@ -82,15 +82,22 @@ type InstallationPermissions struct {
 	Administration                          *string `json:"administration,omitempty"`
 	Blocking                                *string `json:"blocking,omitempty"`
 	Checks                                  *string `json:"checks,omitempty"`
+	Codespaces                              *string `json:"codespaces,omitempty"`
+	CodespacesLifecycleAdmin                *string `json:"codespaces_lifecycle_admin,omitempty"`
+	CodespacesMetadata                      *string `json:"codespaces_metadata,omitempty"`
+	CodespacesSecrets                       *string `json:"codespaces_secrets,omitempty"`
 	Contents                                *string `json:"contents,omitempty"`
 	ContentReferences                       *string `json:"content_references,omitempty"`
+	DependabotSecrets                       *string `json:"dependabot_secrets,omitempty"`
 	Deployments                             *string `json:"deployments,omitempty"`
+	Discussions                             *string `json:"discussions,omitempty"`
 	Emails                                  *string `json:"emails,omitempty"`
 	Environments                            *string `json:"environments,omitempty"`
 	Followers                               *string `json:"followers,omitempty"`
 	Issues                                  *string `json:"issues,omitempty"`
 	Metadata                                *string `json:"metadata,omitempty"`
 	Members                                 *string `json:"members,omitempty"`
+	MergeQueues                             *string `json:"merge_queues,omitempty"`
 	OrganizationAdministration              *string `json:"organization_administration,omitempty"`
 	OrganizationCustomProperties            *string `json:"organization_custom_properties,omitempty"`
 	OrganizationCustomRoles                 *string `json:"organization_custom_roles,omitempty"`
@@ -108,6 +115,8 @@ type InstallationPermissions struct {
 	Packages                                *string `json:"packages,omitempty"`
 	Pages                                   *string `json:"pages,omitempty"`
 	PullRequests                            *string `json:"pull_requests,omitempty"`
+	RepositoryAdvisories                    *string `json:"repository_advisories,omitempty"`
+	RepositoryCustomProperties              *string `json:"repository_custom_properties,omitempty"`
 	RepositoryHooks                         *string `json:"repository_hooks,omitempty"`
 	RepositoryProjects                      *string `json:"repository_projects,omitempty"`
 	RepositoryPreReceiveHooks               *string `json:"repository_pre_receive_hooks,omitempty"`
diff --git a/github/github-accessors.go b/github/github-accessors.go
index 1eb787dd..7d8292a9 100644
--- a/github/github-accessors.go
+++ b/github/github-accessors.go
@@ -9302,6 +9302,38 @@ func (i *InstallationPermissions) GetChecks() string {
 	return *i.Checks
 }
 
+// GetCodespaces returns the Codespaces field if it's non-nil, zero value otherwise.
+func (i *InstallationPermissions) GetCodespaces() string {
+	if i == nil || i.Codespaces == nil {
+		return ""
+	}
+	return *i.Codespaces
+}
+
+// GetCodespacesLifecycleAdmin returns the CodespacesLifecycleAdmin field if it's non-nil, zero value otherwise.
+func (i *InstallationPermissions) GetCodespacesLifecycleAdmin() string {
+	if i == nil || i.CodespacesLifecycleAdmin == nil {
+		return ""
+	}
+	return *i.CodespacesLifecycleAdmin
+}
+
+// GetCodespacesMetadata returns the CodespacesMetadata field if it's non-nil, zero value otherwise.
+func (i *InstallationPermissions) GetCodespacesMetadata() string {
+	if i == nil || i.CodespacesMetadata == nil {
+		return ""
+	}
+	return *i.CodespacesMetadata
+}
+
+// GetCodespacesSecrets returns the CodespacesSecrets field if it's non-nil, zero value otherwise.
+func (i *InstallationPermissions) GetCodespacesSecrets() string {
+	if i == nil || i.CodespacesSecrets == nil {
+		return ""
+	}
+	return *i.CodespacesSecrets
+}
+
 // GetContentReferences returns the ContentReferences field if it's non-nil, zero value otherwise.
 func (i *InstallationPermissions) GetContentReferences() string {
 	if i == nil || i.ContentReferences == nil {
@@ -9318,6 +9350,14 @@ func (i *InstallationPermissions) GetContents() string {
 	return *i.Contents
 }
 
+// GetDependabotSecrets returns the DependabotSecrets field if it's non-nil, zero value otherwise.
+func (i *InstallationPermissions) GetDependabotSecrets() string {
+	if i == nil || i.DependabotSecrets == nil {
+		return ""
+	}
+	return *i.DependabotSecrets
+}
+
 // GetDeployments returns the Deployments field if it's non-nil, zero value otherwise.
 func (i *InstallationPermissions) GetDeployments() string {
 	if i == nil || i.Deployments == nil {
@@ -9326,6 +9366,14 @@ func (i *InstallationPermissions) GetDeployments() string {
 	return *i.Deployments
 }
 
+// GetDiscussions returns the Discussions field if it's non-nil, zero value otherwise.
+func (i *InstallationPermissions) GetDiscussions() string {
+	if i == nil || i.Discussions == nil {
+		return ""
+	}
+	return *i.Discussions
+}
+
 // GetEmails returns the Emails field if it's non-nil, zero value otherwise.
 func (i *InstallationPermissions) GetEmails() string {
 	if i == nil || i.Emails == nil {
@@ -9366,6 +9414,14 @@ func (i *InstallationPermissions) GetMembers() string {
 	return *i.Members
 }
 
+// GetMergeQueues returns the MergeQueues field if it's non-nil, zero value otherwise.
+func (i *InstallationPermissions) GetMergeQueues() string {
+	if i == nil || i.MergeQueues == nil {
+		return ""
+	}
+	return *i.MergeQueues
+}
+
 // GetMetadata returns the Metadata field if it's non-nil, zero value otherwise.
 func (i *InstallationPermissions) GetMetadata() string {
 	if i == nil || i.Metadata == nil {
@@ -9510,6 +9566,22 @@ func (i *InstallationPermissions) GetPullRequests() string {
 	return *i.PullRequests
 }
 
+// GetRepositoryAdvisories returns the RepositoryAdvisories field if it's non-nil, zero value otherwise.
+func (i *InstallationPermissions) GetRepositoryAdvisories() string {
+	if i == nil || i.RepositoryAdvisories == nil {
+		return ""
+	}
+	return *i.RepositoryAdvisories
+}
+
+// GetRepositoryCustomProperties returns the RepositoryCustomProperties field if it's non-nil, zero value otherwise.
+func (i *InstallationPermissions) GetRepositoryCustomProperties() string {
+	if i == nil || i.RepositoryCustomProperties == nil {
+		return ""
+	}
+	return *i.RepositoryCustomProperties
+}
+
 // GetRepositoryHooks returns the RepositoryHooks field if it's non-nil, zero value otherwise.
 func (i *InstallationPermissions) GetRepositoryHooks() string {
 	if i == nil || i.RepositoryHooks == nil {


Test patch:
diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go
index b5c0d178..4d7b022e 100644
--- a/github/github-accessors_test.go
+++ b/github/github-accessors_test.go
@@ -12039,6 +12039,50 @@ func TestInstallationPermissions_GetChecks(tt *testing.T) {
 	i.GetChecks()
 }
 
+func TestInstallationPermissions_GetCodespaces(tt *testing.T) {
+	tt.Parallel()
+	var zeroValue string
+	i := &InstallationPermissions{Codespaces: &zeroValue}
+	i.GetCodespaces()
+	i = &InstallationPermissions{}
+	i.GetCodespaces()
+	i = nil
+	i.GetCodespaces()
+}
+
+func TestInstallationPermissions_GetCodespacesLifecycleAdmin(tt *testing.T) {
+	tt.Parallel()
+	var zeroValue string
+	i := &InstallationPermissions{CodespacesLifecycleAdmin: &zeroValue}
+	i.GetCodespacesLifecycleAdmin()
+	i = &InstallationPermissions{}
+	i.GetCodespacesLifecycleAdmin()
+	i = nil
+	i.GetCodespacesLifecycleAdmin()
+}
+
+func TestInstallationPermissions_GetCodespacesMetadata(tt *testing.T) {
+	tt.Parallel()
+	var zeroValue string
+	i := &InstallationPermissions{CodespacesMetadata: &zeroValue}
+	i.GetCodespacesMetadata()
+	i = &InstallationPermissions{}
+	i.GetCodespacesMetadata()
+	i = nil
+	i.GetCodespacesMetadata()
+}
+
+func TestInstallationPermissions_GetCodespacesSecrets(tt *testing.T) {
+	tt.Parallel()
+	var zeroValue string
+	i := &InstallationPermissions{CodespacesSecrets: &zeroValue}
+	i.GetCodespacesSecrets()
+	i = &InstallationPermissions{}
+	i.GetCodespacesSecrets()
+	i = nil
+	i.GetCodespacesSecrets()
+}
+
 func TestInstallationPermissions_GetContentReferences(tt *testing.T) {
 	tt.Parallel()
 	var zeroValue string
@@ -12061,6 +12105,17 @@ func TestInstallationPermissions_GetContents(tt *testing.T) {
 	i.GetContents()
 }
 
+func TestInstallationPermissions_GetDependabotSecrets(tt *testing.T) {
+	tt.Parallel()
+	var zeroValue string
+	i := &InstallationPermissions{DependabotSecrets: &zeroValue}
+	i.GetDependabotSecrets()
+	i = &InstallationPermissions{}
+	i.GetDependabotSecrets()
+	i = nil
+	i.GetDependabotSecrets()
+}
+
 func TestInstallationPermissions_GetDeployments(tt *testing.T) {
 	tt.Parallel()
 	var zeroValue string
@@ -12072,6 +12127,17 @@ func TestInstallationPermissions_GetDeployments(tt *testing.T) {
 	i.GetDeployments()
 }
 
+func TestInstallationPermissions_GetDiscussions(tt *testing.T) {
+	tt.Parallel()
+	var zeroValue string
+	i := &InstallationPermissions{Discussions: &zeroValue}
+	i.GetDiscussions()
+	i = &InstallationPermissions{}
+	i.GetDiscussions()
+	i = nil
+	i.GetDiscussions()
+}
+
 func TestInstallationPermissions_GetEmails(tt *testing.T) {
 	tt.Parallel()
 	var zeroValue string
@@ -12127,6 +12193,17 @@ func TestInstallationPermissions_GetMembers(tt *testing.T) {
 	i.GetMembers()
 }
 
+func TestInstallationPermissions_GetMergeQueues(tt *testing.T) {
+	tt.Parallel()
+	var zeroValue string
+	i := &InstallationPermissions{MergeQueues: &zeroValue}
+	i.GetMergeQueues()
+	i = &InstallationPermissions{}
+	i.GetMergeQueues()
+	i = nil
+	i.GetMergeQueues()
+}
+
 func TestInstallationPermissions_GetMetadata(tt *testing.T) {
 	tt.Parallel()
 	var zeroValue string
@@ -12325,6 +12402,28 @@ func TestInstallationPermissions_GetPullRequests(tt *testing.T) {
 	i.GetPullRequests()
 }
 
+func TestInstallationPermissions_GetRepositoryAdvisories(tt *testing.T) {
+	tt.Parallel()
+	var zeroValue string
+	i := &InstallationPermissions{RepositoryAdvisories: &zeroValue}
+	i.GetRepositoryAdvisories()
+	i = &InstallationPermissions{}
+	i.GetRepositoryAdvisories()
+	i = nil
+	i.GetRepositoryAdvisories()
+}
+
+func TestInstallationPermissions_GetRepositoryCustomProperties(tt *testing.T) {
+	tt.Parallel()
+	var zeroValue string
+	i := &InstallationPermissions{RepositoryCustomProperties: &zeroValue}
+	i.GetRepositoryCustomProperties()
+	i = &InstallationPermissions{}
+	i.GetRepositoryCustomProperties()
+	i = nil
+	i.GetRepositoryCustomProperties()
+}
+
 func TestInstallationPermissions_GetRepositoryHooks(tt *testing.T) {
 	tt.Parallel()
 	var zeroValue string