Repository: google/go-github
Pull request #2486 (2022-10-04 02:36:53)

Update ProtectionChanges to contain the remaining possible return values
Fixes issue https://github.com/google/go-github/issues/2485. The `From` values only seem to come in the variants of `string`, `bool` or `[]string`, so it's possible these objects could be consolidated into something more generic maybe.
e.g.
```go
type FromString struct {
    From *string `json:"from,omitempty"`
}

type FromBool struct {
    From *bool `json:"from,omitempty"`
}

type FromStringSlice struct {
    From []string `json:"from,omitempty"`
}
```
This went against the current pattern so I made everything a `<Value>Changes` struct instead :D

google-cla[bot]: Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this [failed invocation](https://github.com/google/go-github/pull/2486/checks?check_run_id=8690893723) of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.
codecov[bot]: # [Codecov](https://codecov.io/gh/google/go-github/pull/2486?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) Report
> Merging [#2486](https://codecov.io/gh/google/go-github/pull/2486?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (59ac397) into [master](https://codecov.io/gh/google/go-github/commit/08819b7a10547663d219c00d6dcefce516d4f661?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (08819b7) will **not change** coverage.
> The diff coverage is `n/a`.

```diff
@@           Coverage Diff           @@
##           master    #2486   +/-   ##
=======================================
  Coverage   98.03%   98.03%           
=======================================
  Files         122      122           
  Lines       10705    10705           
=======================================
  Hits        10495    10495           
  Misses        144      144           
  Partials       66       66           
```


| [Impacted Files](https://codecov.io/gh/google/go-github/pull/2486?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) | Coverage Δ | |
|---|---|---|
| [github/repos.go](https://codecov.io/gh/google/go-github/pull/2486/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google#diff-Z2l0aHViL3JlcG9zLmdv) | `98.67% <ø> (ø)` | |

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google)

eolso: Fixed!

@gmlewis the structs for the fields `AuthorizedActorNames` and `AuthorizedActorsOnly` could be left alone to prevent any breaking changes if that's preferred? I only renamed them to keep the pattern consistent in the struct. I also only added the `Changes` to the end of each type name because `RequiredStatusChecks` was already defined elsewhere 😅 
gmlewis: > Fixed!
> 
> @gmlewis the structs for the fields `AuthorizedActorNames` and `AuthorizedActorsOnly` could be left alone to prevent any breaking changes if that's preferred? I only renamed them to keep the pattern consistent in the struct. I also only added the `Changes` to the end of each type name because `RequiredStatusChecks` was already defined elsewhere sweat_smile

Thank you, @eolso - I'll review this after work.

Meanwhile, yes, I prefer to avoid breaking API changes if possible... and in this case I think it is probably fine to have the slight inconsistencies... so maybe reverting these two name changes would be preferable. If any other contributors have other opinions, I'm happy to discuss it.
eolso: Agreed, "consistency" can wait. Reverted breaking changes 😄 

Patch:
diff --git a/github/github-accessors.go b/github/github-accessors.go
index 0c87a56e..c03df750 100644
--- a/github/github-accessors.go
+++ b/github/github-accessors.go
@@ -86,6 +86,14 @@ func (a *ActionsPermissionsRepository) GetSelectedActionsURL() string {
 	return *a.SelectedActionsURL
 }
 
+// GetFrom returns the From field if it's non-nil, zero value otherwise.
+func (a *AdminEnforcedChanges) GetFrom() bool {
+	if a == nil || a.From == nil {
+		return false
+	}
+	return *a.From
+}
+
 // GetURL returns the URL field if it's non-nil, zero value otherwise.
 func (a *AdminEnforcement) GetURL() string {
 	if a == nil || a.URL == nil {
@@ -414,6 +422,14 @@ func (a *Alert) GetURL() string {
 	return *a.URL
 }
 
+// GetFrom returns the From field if it's non-nil, zero value otherwise.
+func (a *AllowDeletionsEnforcementLevelChanges) GetFrom() string {
+	if a == nil || a.From == nil {
+		return ""
+	}
+	return *a.From
+}
+
 // GetRef returns the Ref field if it's non-nil, zero value otherwise.
 func (a *AnalysesListOptions) GetRef() string {
 	if a == nil || a.Ref == nil {
@@ -1366,6 +1382,14 @@ func (a *AuthorizedActorsOnly) GetFrom() bool {
 	return *a.From
 }
 
+// GetFrom returns the From field if it's non-nil, zero value otherwise.
+func (a *AuthorizedDismissalActorsOnlyChanges) GetFrom() bool {
+	if a == nil || a.From == nil {
+		return false
+	}
+	return *a.From
+}
+
 // GetID returns the ID field if it's non-nil, zero value otherwise.
 func (a *Autolink) GetID() int64 {
 	if a == nil || a.ID == nil {
@@ -3542,6 +3566,14 @@ func (c *CreateOrgInvitationOptions) GetRole() string {
 	return *c.Role
 }
 
+// GetFrom returns the From field if it's non-nil, zero value otherwise.
+func (c *CreateProtectedChanges) GetFrom() bool {
+	if c == nil || c.From == nil {
+		return false
+	}
+	return *c.From
+}
+
 // GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise.
 func (c *CreateRunnerGroupRequest) GetAllowsPublicRepositories() bool {
 	if c == nil || c.AllowsPublicRepositories == nil {
@@ -4534,6 +4566,14 @@ func (d *DismissedReview) GetState() string {
 	return *d.State
 }
 
+// GetFrom returns the From field if it's non-nil, zero value otherwise.
+func (d *DismissStaleReviewsOnPushChanges) GetFrom() bool {
+	if d == nil || d.From == nil {
+		return false
+	}
+	return *d.From
+}
+
 // GetClientPayload returns the ClientPayload field if it's non-nil, zero value otherwise.
 func (d *DispatchRequestOptions) GetClientPayload() json.RawMessage {
 	if d == nil || d.ClientPayload == nil {
@@ -8174,6 +8214,14 @@ func (l *License) GetURL() string {
 	return *l.URL
 }
 
+// GetFrom returns the From field if it's non-nil, zero value otherwise.
+func (l *LinearHistoryRequirementEnforcementLevelChanges) GetFrom() string {
+	if l == nil || l.From == nil {
+		return ""
+	}
+	return *l.From
+}
+
 // GetAppID returns the AppID field if it's non-nil, zero value otherwise.
 func (l *ListCheckRunsOptions) GetAppID() int64 {
 	if l == nil || l.AppID == nil {
@@ -11806,6 +11854,22 @@ func (p *Protection) GetRestrictions() *BranchRestrictions {
 	return p.Restrictions
 }
 
+// GetAdminEnforced returns the AdminEnforced field.
+func (p *ProtectionChanges) GetAdminEnforced() *AdminEnforcedChanges {
+	if p == nil {
+		return nil
+	}
+	return p.AdminEnforced
+}
+
+// GetAllowDeletionsEnforcementLevel returns the AllowDeletionsEnforcementLevel field.
+func (p *ProtectionChanges) GetAllowDeletionsEnforcementLevel() *AllowDeletionsEnforcementLevelChanges {
+	if p == nil {
+		return nil
+	}
+	return p.AllowDeletionsEnforcementLevel
+}
+
 // GetAuthorizedActorNames returns the AuthorizedActorNames field.
 func (p *ProtectionChanges) GetAuthorizedActorNames() *AuthorizedActorNames {
 	if p == nil {
@@ -11822,6 +11886,94 @@ func (p *ProtectionChanges) GetAuthorizedActorsOnly() *AuthorizedActorsOnly {
 	return p.AuthorizedActorsOnly
 }
 
+// GetAuthorizedDismissalActorsOnly returns the AuthorizedDismissalActorsOnly field.
+func (p *ProtectionChanges) GetAuthorizedDismissalActorsOnly() *AuthorizedDismissalActorsOnlyChanges {
+	if p == nil {
+		return nil
+	}
+	return p.AuthorizedDismissalActorsOnly
+}
+
+// GetCreateProtected returns the CreateProtected field.
+func (p *ProtectionChanges) GetCreateProtected() *CreateProtectedChanges {
+	if p == nil {
+		return nil
+	}
+	return p.CreateProtected
+}
+
+// GetDismissStaleReviewsOnPush returns the DismissStaleReviewsOnPush field.
+func (p *ProtectionChanges) GetDismissStaleReviewsOnPush() *DismissStaleReviewsOnPushChanges {
+	if p == nil {
+		return nil
+	}
+	return p.DismissStaleReviewsOnPush
+}
+
+// GetLinearHistoryRequirementEnforcementLevel returns the LinearHistoryRequirementEnforcementLevel field.
+func (p *ProtectionChanges) GetLinearHistoryRequirementEnforcementLevel() *LinearHistoryRequirementEnforcementLevelChanges {
+	if p == nil {
+		return nil
+	}
+	return p.LinearHistoryRequirementEnforcementLevel
+}
+
+// GetPullRequestReviewsEnforcementLevel returns the PullRequestReviewsEnforcementLevel field.
+func (p *ProtectionChanges) GetPullRequestReviewsEnforcementLevel() *PullRequestReviewsEnforcementLevelChanges {
+	if p == nil {
+		return nil
+	}
+	return p.PullRequestReviewsEnforcementLevel
+}
+
+// GetRequireCodeOwnerReview returns the RequireCodeOwnerReview field.
+func (p *ProtectionChanges) GetRequireCodeOwnerReview() *RequireCodeOwnerReviewChanges {
+	if p == nil {
+		return nil
+	}
+	return p.RequireCodeOwnerReview
+}
+
+// GetRequiredConversationResolutionLevel returns the RequiredConversationResolutionLevel field.
+func (p *ProtectionChanges) GetRequiredConversationResolutionLevel() *RequiredConversationResolutionLevelChanges {
+	if p == nil {
+		return nil
+	}
+	return p.RequiredConversationResolutionLevel
+}
+
+// GetRequiredDeploymentsEnforcementLevel returns the RequiredDeploymentsEnforcementLevel field.
+func (p *ProtectionChanges) GetRequiredDeploymentsEnforcementLevel() *RequiredDeploymentsEnforcementLevelChanges {
+	if p == nil {
+		return nil
+	}
+	return p.RequiredDeploymentsEnforcementLevel
+}
+
+// GetRequiredStatusChecks returns the RequiredStatusChecks field.
+func (p *ProtectionChanges) GetRequiredStatusChecks() *RequiredStatusChecksChanges {
+	if p == nil {
+		return nil
+	}
+	return p.RequiredStatusChecks
+}
+
+// GetRequiredStatusChecksEnforcementLevel returns the RequiredStatusChecksEnforcementLevel field.
+func (p *ProtectionChanges) GetRequiredStatusChecksEnforcementLevel() *RequiredStatusChecksEnforcementLevelChanges {
+	if p == nil {
+		return nil
+	}
+	return p.RequiredStatusChecksEnforcementLevel
+}
+
+// GetSignatureRequirementEnforcementLevel returns the SignatureRequirementEnforcementLevel field.
+func (p *ProtectionChanges) GetSignatureRequirementEnforcementLevel() *SignatureRequirementEnforcementLevelChanges {
+	if p == nil {
+		return nil
+	}
+	return p.SignatureRequirementEnforcementLevel
+}
+
 // GetAllowDeletions returns the AllowDeletions field if it's non-nil, zero value otherwise.
 func (p *ProtectionRequest) GetAllowDeletions() bool {
 	if p == nil || p.AllowDeletions == nil {
@@ -13014,6 +13166,14 @@ func (p *PullRequestReviewsEnforcement) GetDismissalRestrictions() *DismissalRes
 	return p.DismissalRestrictions
 }
 
+// GetFrom returns the From field if it's non-nil, zero value otherwise.
+func (p *PullRequestReviewsEnforcementLevelChanges) GetFrom() string {
+	if p == nil || p.From == nil {
+		return ""
+	}
+	return *p.From
+}
+
 // GetBypassPullRequestAllowancesRequest returns the BypassPullRequestAllowancesRequest field.
 func (p *PullRequestReviewsEnforcementRequest) GetBypassPullRequestAllowancesRequest() *BypassPullRequestAllowancesRequest {
 	if p == nil {
@@ -16134,6 +16294,30 @@ func (r *RepoStatus) GetURL() string {
 	return *r.URL
 }
 
+// GetFrom returns the From field if it's non-nil, zero value otherwise.
+func (r *RequireCodeOwnerReviewChanges) GetFrom() bool {
+	if r == nil || r.From == nil {
+		return false
+	}
+	return *r.From
+}
+
+// GetFrom returns the From field if it's non-nil, zero value otherwise.
+func (r *RequiredConversationResolutionLevelChanges) GetFrom() string {
+	if r == nil || r.From == nil {
+		return ""
+	}
+	return *r.From
+}
+
+// GetFrom returns the From field if it's non-nil, zero value otherwise.
+func (r *RequiredDeploymentsEnforcementLevelChanges) GetFrom() string {
+	if r == nil || r.From == nil {
+		return ""
+	}
+	return *r.From
+}
+
 // GetType returns the Type field if it's non-nil, zero value otherwise.
 func (r *RequiredReviewer) GetType() string {
 	if r == nil || r.Type == nil {
@@ -16150,6 +16334,14 @@ func (r *RequiredStatusCheck) GetAppID() int64 {
 	return *r.AppID
 }
 
+// GetFrom returns the From field if it's non-nil, zero value otherwise.
+func (r *RequiredStatusChecksEnforcementLevelChanges) GetFrom() string {
+	if r == nil || r.From == nil {
+		return ""
+	}
+	return *r.From
+}
+
 // GetStrict returns the Strict field if it's non-nil, zero value otherwise.
 func (r *RequiredStatusChecksRequest) GetStrict() bool {
 	if r == nil || r.Strict == nil {
@@ -17086,6 +17278,14 @@ func (s *ServiceHook) GetName() string {
 	return *s.Name
 }
 
+// GetFrom returns the From field if it's non-nil, zero value otherwise.
+func (s *SignatureRequirementEnforcementLevelChanges) GetFrom() string {
+	if s == nil || s.From == nil {
+		return ""
+	}
+	return *s.From
+}
+
 // GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.
 func (s *SignaturesProtectedBranch) GetEnabled() bool {
 	if s == nil || s.Enabled == nil {
diff --git a/github/repos.go b/github/repos.go
index 309e4430..8f5bbea9 100644
--- a/github/repos.go
+++ b/github/repos.go
@@ -872,8 +872,31 @@ type BranchProtectionRule struct {
 
 // ProtectionChanges represents the changes to the rule if the BranchProtection was edited.
 type ProtectionChanges struct {
-	AuthorizedActorsOnly *AuthorizedActorsOnly `json:"authorized_actors_only,omitempty"`
-	AuthorizedActorNames *AuthorizedActorNames `json:"authorized_actor_names,omitempty"`
+	AdminEnforced                            *AdminEnforcedChanges                            `json:"admin_enforced,omitempty"`
+	AllowDeletionsEnforcementLevel           *AllowDeletionsEnforcementLevelChanges           `json:"allow_deletions_enforcement_level,omitempty"`
+	AuthorizedActorNames                     *AuthorizedActorNames                            `json:"authorized_actor_names,omitempty"`
+	AuthorizedActorsOnly                     *AuthorizedActorsOnly                            `json:"authorized_actors_only,omitempty"`
+	AuthorizedDismissalActorsOnly            *AuthorizedDismissalActorsOnlyChanges            `json:"authorized_dismissal_actors_only,omitempty"`
+	CreateProtected                          *CreateProtectedChanges                          `json:"create_protected,omitempty"`
+	DismissStaleReviewsOnPush                *DismissStaleReviewsOnPushChanges                `json:"dismiss_stale_reviews_on_push,omitempty"`
+	LinearHistoryRequirementEnforcementLevel *LinearHistoryRequirementEnforcementLevelChanges `json:"linear_history_requirement_enforcement_level,omitempty"`
+	PullRequestReviewsEnforcementLevel       *PullRequestReviewsEnforcementLevelChanges       `json:"pull_request_reviews_enforcement_level,omitempty"`
+	RequireCodeOwnerReview                   *RequireCodeOwnerReviewChanges                   `json:"require_code_owner_review,omitempty"`
+	RequiredConversationResolutionLevel      *RequiredConversationResolutionLevelChanges      `json:"required_conversation_resolution_level,omitempty"`
+	RequiredDeploymentsEnforcementLevel      *RequiredDeploymentsEnforcementLevelChanges      `json:"required_deployments_enforcement_level,omitempty"`
+	RequiredStatusChecks                     *RequiredStatusChecksChanges                     `json:"required_status_checks,omitempty"`
+	RequiredStatusChecksEnforcementLevel     *RequiredStatusChecksEnforcementLevelChanges     `json:"required_status_checks_enforcement_level,omitempty"`
+	SignatureRequirementEnforcementLevel     *SignatureRequirementEnforcementLevelChanges     `json:"signature_requirement_enforcement_level,omitempty"`
+}
+
+// AdminEnforcedChanges represents the changes made to the AdminEnforced policy.
+type AdminEnforcedChanges struct {
+	From *bool `json:"from,omitempty"`
+}
+
+// AllowDeletionsEnforcementLevelChanges represents the changes made to the AllowDeletionsEnforcementLevel policy.
+type AllowDeletionsEnforcementLevelChanges struct {
+	From *string `json:"from,omitempty"`
 }
 
 // AuthorizedActorNames represents who are authorized to edit the branch protection rules.
@@ -881,11 +904,66 @@ type AuthorizedActorNames struct {
 	From []string `json:"from,omitempty"`
 }
 
-// AuthorizedActorsOnly represents if the branche rule can be edited by authorized actors only.
+// AuthorizedActorsOnly represents if the branch rule can be edited by authorized actors only.
 type AuthorizedActorsOnly struct {
 	From *bool `json:"from,omitempty"`
 }
 
+// AuthorizedDismissalActorsOnlyChanges represents the changes made to the AuthorizedDismissalActorsOnly policy.
+type AuthorizedDismissalActorsOnlyChanges struct {
+	From *bool `json:"from,omitempty"`
+}
+
+// CreateProtectedChanges represents the changes made to the CreateProtected policy.
+type CreateProtectedChanges struct {
+	From *bool `json:"from,omitempty"`
+}
+
+// DismissStaleReviewsOnPushChanges represents the changes made to the DismissStaleReviewsOnPushChanges policy.
+type DismissStaleReviewsOnPushChanges struct {
+	From *bool `json:"from,omitempty"`
+}
+
+// LinearHistoryRequirementEnforcementLevelChanges represents the changes made to the LinearHistoryRequirementEnforcementLevel policy.
+type LinearHistoryRequirementEnforcementLevelChanges struct {
+	From *string `json:"from,omitempty"`
+}
+
+// PullRequestReviewsEnforcementLevelChanges represents the changes made to the PullRequestReviewsEnforcementLevel policy.
+type PullRequestReviewsEnforcementLevelChanges struct {
+	From *string `json:"from,omitempty"`
+}
+
+// RequireCodeOwnerReviewChanges represents the changes made to the RequireCodeOwnerReview policy.
+type RequireCodeOwnerReviewChanges struct {
+	From *bool `json:"from,omitempty"`
+}
+
+// RequiredConversationResolutionLevelChanges represents the changes made to the RequiredConversationResolutionLevel policy.
+type RequiredConversationResolutionLevelChanges struct {
+	From *string `json:"from,omitempty"`
+}
+
+// RequiredDeploymentsEnforcementLevelChanges represents the changes made to the RequiredDeploymentsEnforcementLevel policy.
+type RequiredDeploymentsEnforcementLevelChanges struct {
+	From *string `json:"from,omitempty"`
+}
+
+// RequiredStatusChecksChanges represents the changes made to the RequiredStatusChecks policy.
+type RequiredStatusChecksChanges struct {
+	From []string `json:"from,omitempty"`
+}
+
+// RequiredStatusChecksEnforcementLevelChanges represents the changes made to the RequiredStatusChecksEnforcementLevel policy.
+type RequiredStatusChecksEnforcementLevelChanges struct {
+	From *string `json:"from,omitempty"`
+}
+
+// SignatureRequirementEnforcementLevelChanges represents the changes made to the SignatureRequirementEnforcementLevel policy.
+type SignatureRequirementEnforcementLevelChanges struct {
+	From *string `json:"from,omitempty"`
+}
+
 // ProtectionRequest represents a request to create/edit a branch's protection.
 type ProtectionRequest struct {
 	RequiredStatusChecks       *RequiredStatusChecks                 `json:"required_status_checks"`


Test patch:
diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go
index 086db726..5cb6f046 100644
--- a/github/github-accessors_test.go
+++ b/github/github-accessors_test.go
@@ -105,6 +105,16 @@ func TestActionsPermissionsRepository_GetSelectedActionsURL(tt *testing.T) {
 	a.GetSelectedActionsURL()
 }
 
+func TestAdminEnforcedChanges_GetFrom(tt *testing.T) {
+	var zeroValue bool
+	a := &AdminEnforcedChanges{From: &zeroValue}
+	a.GetFrom()
+	a = &AdminEnforcedChanges{}
+	a.GetFrom()
+	a = nil
+	a.GetFrom()
+}
+
 func TestAdminEnforcement_GetURL(tt *testing.T) {
 	var zeroValue string
 	a := &AdminEnforcement{URL: &zeroValue}
@@ -461,6 +471,16 @@ func TestAlert_GetURL(tt *testing.T) {
 	a.GetURL()
 }
 
+func TestAllowDeletionsEnforcementLevelChanges_GetFrom(tt *testing.T) {
+	var zeroValue string
+	a := &AllowDeletionsEnforcementLevelChanges{From: &zeroValue}
+	a.GetFrom()
+	a = &AllowDeletionsEnforcementLevelChanges{}
+	a.GetFrom()
+	a = nil
+	a.GetFrom()
+}
+
 func TestAnalysesListOptions_GetRef(tt *testing.T) {
 	var zeroValue string
 	a := &AnalysesListOptions{Ref: &zeroValue}
@@ -1630,6 +1650,16 @@ func TestAuthorizedActorsOnly_GetFrom(tt *testing.T) {
 	a.GetFrom()
 }
 
+func TestAuthorizedDismissalActorsOnlyChanges_GetFrom(tt *testing.T) {
+	var zeroValue bool
+	a := &AuthorizedDismissalActorsOnlyChanges{From: &zeroValue}
+	a.GetFrom()
+	a = &AuthorizedDismissalActorsOnlyChanges{}
+	a.GetFrom()
+	a = nil
+	a.GetFrom()
+}
+
 func TestAutolink_GetID(tt *testing.T) {
 	var zeroValue int64
 	a := &Autolink{ID: &zeroValue}
@@ -4143,6 +4173,16 @@ func TestCreateOrgInvitationOptions_GetRole(tt *testing.T) {
 	c.GetRole()
 }
 
+func TestCreateProtectedChanges_GetFrom(tt *testing.T) {
+	var zeroValue bool
+	c := &CreateProtectedChanges{From: &zeroValue}
+	c.GetFrom()
+	c = &CreateProtectedChanges{}
+	c.GetFrom()
+	c = nil
+	c.GetFrom()
+}
+
 func TestCreateRunnerGroupRequest_GetAllowsPublicRepositories(tt *testing.T) {
 	var zeroValue bool
 	c := &CreateRunnerGroupRequest{AllowsPublicRepositories: &zeroValue}
@@ -5296,6 +5336,16 @@ func TestDismissedReview_GetState(tt *testing.T) {
 	d.GetState()
 }
 
+func TestDismissStaleReviewsOnPushChanges_GetFrom(tt *testing.T) {
+	var zeroValue bool
+	d := &DismissStaleReviewsOnPushChanges{From: &zeroValue}
+	d.GetFrom()
+	d = &DismissStaleReviewsOnPushChanges{}
+	d.GetFrom()
+	d = nil
+	d.GetFrom()
+}
+
 func TestDispatchRequestOptions_GetClientPayload(tt *testing.T) {
 	var zeroValue json.RawMessage
 	d := &DispatchRequestOptions{ClientPayload: &zeroValue}
@@ -9576,6 +9626,16 @@ func TestLicense_GetURL(tt *testing.T) {
 	l.GetURL()
 }
 
+func TestLinearHistoryRequirementEnforcementLevelChanges_GetFrom(tt *testing.T) {
+	var zeroValue string
+	l := &LinearHistoryRequirementEnforcementLevelChanges{From: &zeroValue}
+	l.GetFrom()
+	l = &LinearHistoryRequirementEnforcementLevelChanges{}
+	l.GetFrom()
+	l = nil
+	l.GetFrom()
+}
+
 func TestListCheckRunsOptions_GetAppID(tt *testing.T) {
 	var zeroValue int64
 	l := &ListCheckRunsOptions{AppID: &zeroValue}
@@ -13771,6 +13831,20 @@ func TestProtection_GetRestrictions(tt *testing.T) {
 	p.GetRestrictions()
 }
 
+func TestProtectionChanges_GetAdminEnforced(tt *testing.T) {
+	p := &ProtectionChanges{}
+	p.GetAdminEnforced()
+	p = nil
+	p.GetAdminEnforced()
+}
+
+func TestProtectionChanges_GetAllowDeletionsEnforcementLevel(tt *testing.T) {
+	p := &ProtectionChanges{}
+	p.GetAllowDeletionsEnforcementLevel()
+	p = nil
+	p.GetAllowDeletionsEnforcementLevel()
+}
+
 func TestProtectionChanges_GetAuthorizedActorNames(tt *testing.T) {
 	p := &ProtectionChanges{}
 	p.GetAuthorizedActorNames()
@@ -13785,6 +13859,83 @@ func TestProtectionChanges_GetAuthorizedActorsOnly(tt *testing.T) {
 	p.GetAuthorizedActorsOnly()
 }
 
+func TestProtectionChanges_GetAuthorizedDismissalActorsOnly(tt *testing.T) {
+	p := &ProtectionChanges{}
+	p.GetAuthorizedDismissalActorsOnly()
+	p = nil
+	p.GetAuthorizedDismissalActorsOnly()
+}
+
+func TestProtectionChanges_GetCreateProtected(tt *testing.T) {
+	p := &ProtectionChanges{}
+	p.GetCreateProtected()
+	p = nil
+	p.GetCreateProtected()
+}
+
+func TestProtectionChanges_GetDismissStaleReviewsOnPush(tt *testing.T) {
+	p := &ProtectionChanges{}
+	p.GetDismissStaleReviewsOnPush()
+	p = nil
+	p.GetDismissStaleReviewsOnPush()
+}
+
+func TestProtectionChanges_GetLinearHistoryRequirementEnforcementLevel(tt *testing.T) {
+	p := &ProtectionChanges{}
+	p.GetLinearHistoryRequirementEnforcementLevel()
+	p = nil
+	p.GetLinearHistoryRequirementEnforcementLevel()
+}
+
+func TestProtectionChanges_GetPullRequestReviewsEnforcementLevel(tt *testing.T) {
+	p := &ProtectionChanges{}
+	p.GetPullRequestReviewsEnforcementLevel()
+	p = nil
+	p.GetPullRequestReviewsEnforcementLevel()
+}
+
+func TestProtectionChanges_GetRequireCodeOwnerReview(tt *testing.T) {
+	p := &ProtectionChanges{}
+	p.GetRequireCodeOwnerReview()
+	p = nil
+	p.GetRequireCodeOwnerReview()
+}
+
+func TestProtectionChanges_GetRequiredConversationResolutionLevel(tt *testing.T) {
+	p := &ProtectionChanges{}
+	p.GetRequiredConversationResolutionLevel()
+	p = nil
+	p.GetRequiredConversationResolutionLevel()
+}
+
+func TestProtectionChanges_GetRequiredDeploymentsEnforcementLevel(tt *testing.T) {
+	p := &ProtectionChanges{}
+	p.GetRequiredDeploymentsEnforcementLevel()
+	p = nil
+	p.GetRequiredDeploymentsEnforcementLevel()
+}
+
+func TestProtectionChanges_GetRequiredStatusChecks(tt *testing.T) {
+	p := &ProtectionChanges{}
+	p.GetRequiredStatusChecks()
+	p = nil
+	p.GetRequiredStatusChecks()
+}
+
+func TestProtectionChanges_GetRequiredStatusChecksEnforcementLevel(tt *testing.T) {
+	p := &ProtectionChanges{}
+	p.GetRequiredStatusChecksEnforcementLevel()
+	p = nil
+	p.GetRequiredStatusChecksEnforcementLevel()
+}
+
+func TestProtectionChanges_GetSignatureRequirementEnforcementLevel(tt *testing.T) {
+	p := &ProtectionChanges{}
+	p.GetSignatureRequirementEnforcementLevel()
+	p = nil
+	p.GetSignatureRequirementEnforcementLevel()
+}
+
 func TestProtectionRequest_GetAllowDeletions(tt *testing.T) {
 	var zeroValue bool
 	p := &ProtectionRequest{AllowDeletions: &zeroValue}
@@ -15143,6 +15294,16 @@ func TestPullRequestReviewsEnforcement_GetDismissalRestrictions(tt *testing.T) {
 	p.GetDismissalRestrictions()
 }
 
+func TestPullRequestReviewsEnforcementLevelChanges_GetFrom(tt *testing.T) {
+	var zeroValue string
+	p := &PullRequestReviewsEnforcementLevelChanges{From: &zeroValue}
+	p.GetFrom()
+	p = &PullRequestReviewsEnforcementLevelChanges{}
+	p.GetFrom()
+	p = nil
+	p.GetFrom()
+}
+
 func TestPullRequestReviewsEnforcementRequest_GetBypassPullRequestAllowancesRequest(tt *testing.T) {
 	p := &PullRequestReviewsEnforcementRequest{}
 	p.GetBypassPullRequestAllowancesRequest()
@@ -18794,6 +18955,36 @@ func TestRepoStatus_GetURL(tt *testing.T) {
 	r.GetURL()
 }
 
+func TestRequireCodeOwnerReviewChanges_GetFrom(tt *testing.T) {
+	var zeroValue bool
+	r := &RequireCodeOwnerReviewChanges{From: &zeroValue}
+	r.GetFrom()
+	r = &RequireCodeOwnerReviewChanges{}
+	r.GetFrom()
+	r = nil
+	r.GetFrom()
+}
+
+func TestRequiredConversationResolutionLevelChanges_GetFrom(tt *testing.T) {
+	var zeroValue string
+	r := &RequiredConversationResolutionLevelChanges{From: &zeroValue}
+	r.GetFrom()
+	r = &RequiredConversationResolutionLevelChanges{}
+	r.GetFrom()
+	r = nil
+	r.GetFrom()
+}
+
+func TestRequiredDeploymentsEnforcementLevelChanges_GetFrom(tt *testing.T) {
+	var zeroValue string
+	r := &RequiredDeploymentsEnforcementLevelChanges{From: &zeroValue}
+	r.GetFrom()
+	r = &RequiredDeploymentsEnforcementLevelChanges{}
+	r.GetFrom()
+	r = nil
+	r.GetFrom()
+}
+
 func TestRequiredReviewer_GetType(tt *testing.T) {
 	var zeroValue string
 	r := &RequiredReviewer{Type: &zeroValue}
@@ -18814,6 +19005,16 @@ func TestRequiredStatusCheck_GetAppID(tt *testing.T) {
 	r.GetAppID()
 }
 
+func TestRequiredStatusChecksEnforcementLevelChanges_GetFrom(tt *testing.T) {
+	var zeroValue string
+	r := &RequiredStatusChecksEnforcementLevelChanges{From: &zeroValue}
+	r.GetFrom()
+	r = &RequiredStatusChecksEnforcementLevelChanges{}
+	r.GetFrom()
+	r = nil
+	r.GetFrom()
+}
+
 func TestRequiredStatusChecksRequest_GetStrict(tt *testing.T) {
 	var zeroValue bool
 	r := &RequiredStatusChecksRequest{Strict: &zeroValue}
@@ -19942,6 +20143,16 @@ func TestServiceHook_GetName(tt *testing.T) {
 	s.GetName()
 }
 
+func TestSignatureRequirementEnforcementLevelChanges_GetFrom(tt *testing.T) {
+	var zeroValue string
+	s := &SignatureRequirementEnforcementLevelChanges{From: &zeroValue}
+	s.GetFrom()
+	s = &SignatureRequirementEnforcementLevelChanges{}
+	s.GetFrom()
+	s = nil
+	s.GetFrom()
+}
+
 func TestSignaturesProtectedBranch_GetEnabled(tt *testing.T) {
 	var zeroValue bool
 	s := &SignaturesProtectedBranch{Enabled: &zeroValue}