From aa98173fad7431422a49a3c31ac76c0f88993b46 Mon Sep 17 00:00:00 2001 From: tomfeigin <10672011+tomfeigin@users.noreply.github.com> Date: Sun, 17 Nov 2024 12:04:31 +0200 Subject: [PATCH] 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 --- github/apps.go | 9 +++ github/github-accessors.go | 72 ++++++++++++++++++++++++ github/github-accessors_test.go | 99 +++++++++++++++++++++++++++++++++ 3 files changed, 180 insertions(+) diff --git a/github/apps.go b/github/apps.go index 2f74c2c2639..4757dedfaa9 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 1eb787dd709..7d8292a9652 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 { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index b5c0d178a6a..4d7b022e12c 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