diff --git a/github/apps.go b/github/apps.go index 6969daba6c0..16ef758cbdd 100644 --- a/github/apps.go +++ b/github/apps.go @@ -78,6 +78,7 @@ type InstallationTokenListRepoOptions struct { // https://docs.github.com/rest/apps#create-an-installation-access-token-for-an-app type InstallationPermissions struct { Actions *string `json:"actions,omitempty"` + ActionsVariables *string `json:"actions_variables,omitempty"` Administration *string `json:"administration,omitempty"` Blocking *string `json:"blocking,omitempty"` Checks *string `json:"checks,omitempty"` @@ -93,6 +94,7 @@ type InstallationPermissions struct { OrganizationAdministration *string `json:"organization_administration,omitempty"` OrganizationCustomProperties *string `json:"organization_custom_properties,omitempty"` OrganizationCustomRoles *string `json:"organization_custom_roles,omitempty"` + OrganizationCustomOrgRoles *string `json:"organization_custom_org_roles,omitempty"` OrganizationHooks *string `json:"organization_hooks,omitempty"` OrganizationPackages *string `json:"organization_packages,omitempty"` OrganizationPlan *string `json:"organization_plan,omitempty"` diff --git a/github/apps_test.go b/github/apps_test.go index ea670344595..bb060d7a052 100644 --- a/github/apps_test.go +++ b/github/apps_test.go @@ -769,6 +769,7 @@ func TestInstallationPermissions_Marshal(t *testing.T) { Metadata: String("md"), Members: String("m"), OrganizationAdministration: String("oa"), + OrganizationCustomOrgRoles: String("ocr"), OrganizationHooks: String("oh"), OrganizationPlan: String("op"), OrganizationPreReceiveHooks: String("opr"), @@ -804,6 +805,7 @@ func TestInstallationPermissions_Marshal(t *testing.T) { "metadata": "md", "members": "m", "organization_administration": "oa", + "organization_custom_org_roles": "ocr", "organization_hooks": "oh", "organization_plan": "op", "organization_pre_receive_hooks": "opr", @@ -869,6 +871,7 @@ func TestInstallation_Marshal(t *testing.T) { SingleFilePaths: []string{"s"}, Permissions: &InstallationPermissions{ Actions: String("a"), + ActionsVariables: String("ac"), Administration: String("ad"), Checks: String("c"), Contents: String("co"), @@ -879,6 +882,7 @@ func TestInstallation_Marshal(t *testing.T) { Metadata: String("md"), Members: String("m"), OrganizationAdministration: String("oa"), + OrganizationCustomOrgRoles: String("ocr"), OrganizationHooks: String("oh"), OrganizationPlan: String("op"), OrganizationPreReceiveHooks: String("opr"), @@ -967,6 +971,7 @@ func TestInstallation_Marshal(t *testing.T) { ], "permissions": { "actions": "a", + "actions_variables": "ac", "administration": "ad", "checks": "c", "contents": "co", @@ -977,6 +982,7 @@ func TestInstallation_Marshal(t *testing.T) { "metadata": "md", "members": "m", "organization_administration": "oa", + "organization_custom_org_roles": "ocr", "organization_hooks": "oh", "organization_plan": "op", "organization_pre_receive_hooks": "opr", @@ -1035,6 +1041,7 @@ func TestInstallationTokenOptions_Marshal(t *testing.T) { RepositoryIDs: []int64{1}, Permissions: &InstallationPermissions{ Actions: String("a"), + ActionsVariables: String("ac"), Administration: String("ad"), Checks: String("c"), Contents: String("co"), @@ -1045,6 +1052,7 @@ func TestInstallationTokenOptions_Marshal(t *testing.T) { Metadata: String("md"), Members: String("m"), OrganizationAdministration: String("oa"), + OrganizationCustomOrgRoles: String("ocr"), OrganizationHooks: String("oh"), OrganizationPlan: String("op"), OrganizationPreReceiveHooks: String("opr"), @@ -1073,6 +1081,7 @@ func TestInstallationTokenOptions_Marshal(t *testing.T) { "repository_ids": [1], "permissions": { "actions": "a", + "actions_variables": "ac", "administration": "ad", "checks": "c", "contents": "co", @@ -1083,6 +1092,7 @@ func TestInstallationTokenOptions_Marshal(t *testing.T) { "metadata": "md", "members": "m", "organization_administration": "oa", + "organization_custom_org_roles": "ocr", "organization_hooks": "oh", "organization_plan": "op", "organization_pre_receive_hooks": "opr", @@ -1118,6 +1128,7 @@ func TestInstallationToken_Marshal(t *testing.T) { ExpiresAt: &Timestamp{referenceTime}, Permissions: &InstallationPermissions{ Actions: String("a"), + ActionsVariables: String("ac"), Administration: String("ad"), Checks: String("c"), Contents: String("co"), @@ -1128,6 +1139,7 @@ func TestInstallationToken_Marshal(t *testing.T) { Metadata: String("md"), Members: String("m"), OrganizationAdministration: String("oa"), + OrganizationCustomOrgRoles: String("ocr"), OrganizationHooks: String("oh"), OrganizationPlan: String("op"), OrganizationPreReceiveHooks: String("opr"), @@ -1164,6 +1176,7 @@ func TestInstallationToken_Marshal(t *testing.T) { "expires_at": ` + referenceTimeStr + `, "permissions": { "actions": "a", + "actions_variables": "ac", "administration": "ad", "checks": "c", "contents": "co", @@ -1174,6 +1187,7 @@ func TestInstallationToken_Marshal(t *testing.T) { "metadata": "md", "members": "m", "organization_administration": "oa", + "organization_custom_org_roles": "ocr", "organization_hooks": "oh", "organization_plan": "op", "organization_pre_receive_hooks": "opr", @@ -1243,6 +1257,7 @@ func TestApp_Marshal(t *testing.T) { UpdatedAt: &Timestamp{referenceTime}, Permissions: &InstallationPermissions{ Actions: String("a"), + ActionsVariables: String("ac"), Administration: String("ad"), Checks: String("c"), Contents: String("co"), @@ -1253,6 +1268,7 @@ func TestApp_Marshal(t *testing.T) { Metadata: String("md"), Members: String("m"), OrganizationAdministration: String("oa"), + OrganizationCustomOrgRoles: String("ocr"), OrganizationHooks: String("oh"), OrganizationPlan: String("op"), OrganizationPreReceiveHooks: String("opr"), @@ -1310,6 +1326,7 @@ func TestApp_Marshal(t *testing.T) { "updated_at": ` + referenceTimeStr + `, "permissions": { "actions": "a", + "actions_variables": "ac", "administration": "ad", "checks": "c", "contents": "co", @@ -1320,6 +1337,7 @@ func TestApp_Marshal(t *testing.T) { "metadata": "md", "members": "m", "organization_administration": "oa", + "organization_custom_org_roles": "ocr", "organization_hooks": "oh", "organization_plan": "op", "organization_pre_receive_hooks": "opr", diff --git a/github/github-accessors.go b/github/github-accessors.go index 421922d33db..98985def895 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -8822,6 +8822,14 @@ func (i *InstallationPermissions) GetActions() string { return *i.Actions } +// GetActionsVariables returns the ActionsVariables field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetActionsVariables() string { + if i == nil || i.ActionsVariables == nil { + return "" + } + return *i.ActionsVariables +} + // GetAdministration returns the Administration field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetAdministration() string { if i == nil || i.Administration == nil { @@ -8926,6 +8934,14 @@ func (i *InstallationPermissions) GetOrganizationAdministration() string { return *i.OrganizationAdministration } +// GetOrganizationCustomOrgRoles returns the OrganizationCustomOrgRoles field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationCustomOrgRoles() string { + if i == nil || i.OrganizationCustomOrgRoles == nil { + return "" + } + return *i.OrganizationCustomOrgRoles +} + // GetOrganizationCustomProperties returns the OrganizationCustomProperties field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetOrganizationCustomProperties() string { if i == nil || i.OrganizationCustomProperties == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 8753c42b79e..f123be8f8c4 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -10338,6 +10338,16 @@ func TestInstallationPermissions_GetActions(tt *testing.T) { i.GetActions() } +func TestInstallationPermissions_GetActionsVariables(tt *testing.T) { + var zeroValue string + i := &InstallationPermissions{ActionsVariables: &zeroValue} + i.GetActionsVariables() + i = &InstallationPermissions{} + i.GetActionsVariables() + i = nil + i.GetActionsVariables() +} + func TestInstallationPermissions_GetAdministration(tt *testing.T) { var zeroValue string i := &InstallationPermissions{Administration: &zeroValue} @@ -10468,6 +10478,16 @@ func TestInstallationPermissions_GetOrganizationAdministration(tt *testing.T) { i.GetOrganizationAdministration() } +func TestInstallationPermissions_GetOrganizationCustomOrgRoles(tt *testing.T) { + var zeroValue string + i := &InstallationPermissions{OrganizationCustomOrgRoles: &zeroValue} + i.GetOrganizationCustomOrgRoles() + i = &InstallationPermissions{} + i.GetOrganizationCustomOrgRoles() + i = nil + i.GetOrganizationCustomOrgRoles() +} + func TestInstallationPermissions_GetOrganizationCustomProperties(tt *testing.T) { var zeroValue string i := &InstallationPermissions{OrganizationCustomProperties: &zeroValue}