From 448f9a28bc50bb1715720ecb48123130ba599c75 Mon Sep 17 00:00:00 2001 From: billnapier Date: Tue, 3 Oct 2023 13:55:59 -0700 Subject: [PATCH 1/5] Add "organization" field to more events. This should cover all events that GitHub says have an organization field. --- github/event_types.go | 77 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/github/event_types.go b/github/event_types.go index 1a403da9b9..bb10c76921 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -76,6 +76,10 @@ type CommitCommentEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // ContentReferenceEvent is triggered when the body or comment of an issue or @@ -132,6 +136,10 @@ type DeleteEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // DependabotAlertEvent is triggered when there is activity relating to Dependabot alerts. @@ -192,6 +200,10 @@ type DeploymentEvent struct { // The following fields are only populated by Webhook events. Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` } // DeploymentProtectionRuleEvent represents a deployment protection rule event. @@ -227,6 +239,10 @@ type DeploymentStatusEvent struct { // The following fields are only populated by Webhook events. Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` } // DiscussionCommentEvent represents a webhook event for a comment on discussion. @@ -363,6 +379,10 @@ type GollumEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` } // EditChange represents the changes when an issue, pull request, comment, @@ -510,6 +530,10 @@ type InstallationEvent struct { Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` Requester *User `json:"requester,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` } // InstallationRepositoriesEvent is triggered when a repository is added or @@ -524,6 +548,10 @@ type InstallationRepositoriesEvent struct { RepositorySelection *string `json:"repository_selection,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` } // InstallationLoginChange represents a change in login on an installation. @@ -603,6 +631,10 @@ type IssuesEvent struct { Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` Milestone *Milestone `json:"milestone,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` } // LabelEvent is triggered when a repository's label is created, edited, or deleted. @@ -639,6 +671,10 @@ type MarketplacePurchaseEvent struct { PreviousMarketplacePurchase *MarketplacePurchase `json:"previous_marketplace_purchase,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` } // MemberEvent is triggered when a user is added as a collaborator to a repository. @@ -654,6 +690,10 @@ type MemberEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` } // MembershipEvent is triggered when a user is added or removed from a team. @@ -825,6 +865,10 @@ type PageBuildEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` } // PersonalAccessTokenRequestEvent occurs when there is activity relating to a @@ -885,6 +929,10 @@ type PersonalAccessTokenRequest struct { // Date and time when the associated fine-grained personal access token was last used for authentication. TokenLastUsedAt *Timestamp `json:"token_last_used_at,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` } // PersonalAccessTokenPermissions represents the original or newly requested @@ -1044,6 +1092,10 @@ type PublicEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` } // PullRequestEvent is triggered when a pull request is assigned, unassigned, labeled, @@ -1126,6 +1178,10 @@ type PullRequestReviewCommentEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` } // PullRequestReviewThreadEvent is triggered when a comment made as part of a @@ -1144,6 +1200,10 @@ type PullRequestReviewThreadEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` } // PullRequestTargetEvent is triggered when a pull request is assigned, unassigned, labeled, @@ -1309,6 +1369,10 @@ type ReleaseEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` } // RepositoryEvent is triggered when a repository is created, archived, unarchived, @@ -1379,6 +1443,10 @@ type RepositoryVulnerabilityAlertEvent struct { // The user that triggered the event. Sender *User `json:"sender,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` } // RepositoryVulnerabilityAlert represents a repository security alert. @@ -1485,6 +1553,10 @@ type StatusEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` } // TeamEvent is triggered when an organization's team is created, modified or deleted. @@ -1555,6 +1627,11 @@ type WatchEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + + + // The following field is only present when the webhook is triggered on + // a repository belonging to an organization. + Organization *Organization `json:"organization,omitempty"` } // WorkflowDispatchEvent is triggered when someone triggers a workflow run on GitHub or From afe561e2ab7210f57b8a1889dbf7d4dfc66d9487 Mon Sep 17 00:00:00 2001 From: billnapier Date: Tue, 3 Oct 2023 21:06:02 +0000 Subject: [PATCH 2/5] Fix gofmt. --- github/event_types.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/github/event_types.go b/github/event_types.go index bb10c76921..8113ac66f9 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -79,7 +79,7 @@ type CommitCommentEvent struct { // The following field is only present when the webhook is triggered on // a repository belonging to an organization. - Org *Organization `json:"organization,omitempty"` + Org *Organization `json:"organization,omitempty"` } // ContentReferenceEvent is triggered when the body or comment of an issue or @@ -138,8 +138,8 @@ type DeleteEvent struct { Installation *Installation `json:"installation,omitempty"` // The following field is only present when the webhook is triggered on - // a repository belonging to an organization. - Org *Organization `json:"organization,omitempty"` + // a repository belonging to an organization. + Org *Organization `json:"organization,omitempty"` } // DependabotAlertEvent is triggered when there is activity relating to Dependabot alerts. @@ -631,7 +631,7 @@ type IssuesEvent struct { Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` Milestone *Milestone `json:"milestone,omitempty"` - + // The following field is only present when the webhook is triggered on // a repository belonging to an organization. Organization *Organization `json:"organization,omitempty"` @@ -671,7 +671,7 @@ type MarketplacePurchaseEvent struct { PreviousMarketplacePurchase *MarketplacePurchase `json:"previous_marketplace_purchase,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` - + // The following field is only present when the webhook is triggered on // a repository belonging to an organization. Organization *Organization `json:"organization,omitempty"` @@ -1628,7 +1628,6 @@ type WatchEvent struct { Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` - // The following field is only present when the webhook is triggered on // a repository belonging to an organization. Organization *Organization `json:"organization,omitempty"` From a1669dc21e85e2aa51a91a86114ae7551a4add98 Mon Sep 17 00:00:00 2001 From: billnapier Date: Tue, 3 Oct 2023 21:07:10 +0000 Subject: [PATCH 3/5] Update tests by running script/generate.sh. --- github/github-accessors.go | 152 ++++++++++++++++++++++++++++++++ github/github-accessors_test.go | 133 ++++++++++++++++++++++++++++ 2 files changed, 285 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index b305bfc644..a9c33e1b5e 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -3814,6 +3814,14 @@ func (c *CommitCommentEvent) GetInstallation() *Installation { return c.Installation } +// GetOrg returns the Org field. +func (c *CommitCommentEvent) GetOrg() *Organization { + if c == nil { + return nil + } + return c.Org +} + // GetRepo returns the Repo field. func (c *CommitCommentEvent) GetRepo() *Repository { if c == nil { @@ -5046,6 +5054,14 @@ func (d *DeleteEvent) GetInstallation() *Installation { return d.Installation } +// GetOrg returns the Org field. +func (d *DeleteEvent) GetOrg() *Organization { + if d == nil { + return nil + } + return d.Org +} + // GetPusherType returns the PusherType field if it's non-nil, zero value otherwise. func (d *DeleteEvent) GetPusherType() string { if d == nil || d.PusherType == nil { @@ -5582,6 +5598,14 @@ func (d *DeploymentEvent) GetInstallation() *Installation { return d.Installation } +// GetOrganization returns the Organization field. +func (d *DeploymentEvent) GetOrganization() *Organization { + if d == nil { + return nil + } + return d.Organization +} + // GetRepo returns the Repo field. func (d *DeploymentEvent) GetRepo() *Repository { if d == nil { @@ -5886,6 +5910,14 @@ func (d *DeploymentStatusEvent) GetInstallation() *Installation { return d.Installation } +// GetOrganization returns the Organization field. +func (d *DeploymentStatusEvent) GetOrganization() *Organization { + if d == nil { + return nil + } + return d.Organization +} + // GetRepo returns the Repo field. func (d *DeploymentStatusEvent) GetRepo() *Repository { if d == nil { @@ -7686,6 +7718,14 @@ func (g *GollumEvent) GetInstallation() *Installation { return g.Installation } +// GetOrganization returns the Organization field. +func (g *GollumEvent) GetOrganization() *Organization { + if g == nil { + return nil + } + return g.Organization +} + // GetRepo returns the Repo field. func (g *GollumEvent) GetRepo() *Repository { if g == nil { @@ -8558,6 +8598,14 @@ func (i *InstallationEvent) GetInstallation() *Installation { return i.Installation } +// GetOrganization returns the Organization field. +func (i *InstallationEvent) GetOrganization() *Organization { + if i == nil { + return nil + } + return i.Organization +} + // GetRequester returns the Requester field. func (i *InstallationEvent) GetRequester() *User { if i == nil { @@ -8894,6 +8942,14 @@ func (i *InstallationRepositoriesEvent) GetInstallation() *Installation { return i.Installation } +// GetOrganization returns the Organization field. +func (i *InstallationRepositoriesEvent) GetOrganization() *Organization { + if i == nil { + return nil + } + return i.Organization +} + // GetRepositorySelection returns the RepositorySelection field if it's non-nil, zero value otherwise. func (i *InstallationRepositoriesEvent) GetRepositorySelection() string { if i == nil || i.RepositorySelection == nil { @@ -9942,6 +9998,14 @@ func (i *IssuesEvent) GetMilestone() *Milestone { return i.Milestone } +// GetOrganization returns the Organization field. +func (i *IssuesEvent) GetOrganization() *Organization { + if i == nil { + return nil + } + return i.Organization +} + // GetRepo returns the Repo field. func (i *IssuesEvent) GetRepo() *Repository { if i == nil { @@ -10990,6 +11054,14 @@ func (m *MarketplacePurchaseEvent) GetMarketplacePurchase() *MarketplacePurchase return m.MarketplacePurchase } +// GetOrganization returns the Organization field. +func (m *MarketplacePurchaseEvent) GetOrganization() *Organization { + if m == nil { + return nil + } + return m.Organization +} + // GetPreviousMarketplacePurchase returns the PreviousMarketplacePurchase field. func (m *MarketplacePurchaseEvent) GetPreviousMarketplacePurchase() *MarketplacePurchase { if m == nil { @@ -11038,6 +11110,14 @@ func (m *MemberEvent) GetMember() *User { return m.Member } +// GetOrganization returns the Organization field. +func (m *MemberEvent) GetOrganization() *Organization { + if m == nil { + return nil + } + return m.Organization +} + // GetRepo returns the Repo field. func (m *MemberEvent) GetRepo() *Repository { if m == nil { @@ -13270,6 +13350,14 @@ func (p *PageBuildEvent) GetInstallation() *Installation { return p.Installation } +// GetOrganization returns the Organization field. +func (p *PageBuildEvent) GetOrganization() *Organization { + if p == nil { + return nil + } + return p.Organization +} + // GetRepo returns the Repo field. func (p *PageBuildEvent) GetRepo() *Repository { if p == nil { @@ -13806,6 +13894,14 @@ func (p *PersonalAccessTokenRequest) GetID() int64 { return *p.ID } +// GetOrganization returns the Organization field. +func (p *PersonalAccessTokenRequest) GetOrganization() *Organization { + if p == nil { + return nil + } + return p.Organization +} + // GetOwner returns the Owner field. func (p *PersonalAccessTokenRequest) GetOwner() *User { if p == nil { @@ -15398,6 +15494,14 @@ func (p *PublicEvent) GetInstallation() *Installation { return p.Installation } +// GetOrganization returns the Organization field. +func (p *PublicEvent) GetOrganization() *Organization { + if p == nil { + return nil + } + return p.Organization +} + // GetRepo returns the Repo field. func (p *PublicEvent) GetRepo() *Repository { if p == nil { @@ -16366,6 +16470,14 @@ func (p *PullRequestReviewCommentEvent) GetInstallation() *Installation { return p.Installation } +// GetOrganization returns the Organization field. +func (p *PullRequestReviewCommentEvent) GetOrganization() *Organization { + if p == nil { + return nil + } + return p.Organization +} + // GetPullRequest returns the PullRequest field. func (p *PullRequestReviewCommentEvent) GetPullRequest() *PullRequest { if p == nil { @@ -16590,6 +16702,14 @@ func (p *PullRequestReviewThreadEvent) GetInstallation() *Installation { return p.Installation } +// GetOrganization returns the Organization field. +func (p *PullRequestReviewThreadEvent) GetOrganization() *Organization { + if p == nil { + return nil + } + return p.Organization +} + // GetPullRequest returns the PullRequest field. func (p *PullRequestReviewThreadEvent) GetPullRequest() *PullRequest { if p == nil { @@ -17614,6 +17734,14 @@ func (r *ReleaseEvent) GetInstallation() *Installation { return r.Installation } +// GetOrganization returns the Organization field. +func (r *ReleaseEvent) GetOrganization() *Organization { + if r == nil { + return nil + } + return r.Organization +} + // GetRelease returns the Release field. func (r *ReleaseEvent) GetRelease() *RepositoryRelease { if r == nil { @@ -19702,6 +19830,14 @@ func (r *RepositoryVulnerabilityAlertEvent) GetInstallation() *Installation { return r.Installation } +// GetOrganization returns the Organization field. +func (r *RepositoryVulnerabilityAlertEvent) GetOrganization() *Organization { + if r == nil { + return nil + } + return r.Organization +} + // GetRepository returns the Repository field. func (r *RepositoryVulnerabilityAlertEvent) GetRepository() *Repository { if r == nil { @@ -21550,6 +21686,14 @@ func (s *StatusEvent) GetName() string { return *s.Name } +// GetOrganization returns the Organization field. +func (s *StatusEvent) GetOrganization() *Organization { + if s == nil { + return nil + } + return s.Organization +} + // GetRepo returns the Repo field. func (s *StatusEvent) GetRepo() *Repository { if s == nil { @@ -23870,6 +24014,14 @@ func (w *WatchEvent) GetInstallation() *Installation { return w.Installation } +// GetOrganization returns the Organization field. +func (w *WatchEvent) GetOrganization() *Organization { + if w == nil { + return nil + } + return w.Organization +} + // GetRepo returns the Repo field. func (w *WatchEvent) GetRepo() *Repository { if w == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 962e5e8f73..6b81f722d5 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -4519,6 +4519,13 @@ func TestCommitCommentEvent_GetInstallation(tt *testing.T) { c.GetInstallation() } +func TestCommitCommentEvent_GetOrg(tt *testing.T) { + c := &CommitCommentEvent{} + c.GetOrg() + c = nil + c.GetOrg() +} + func TestCommitCommentEvent_GetRepo(tt *testing.T) { c := &CommitCommentEvent{} c.GetRepo() @@ -5969,6 +5976,13 @@ func TestDeleteEvent_GetInstallation(tt *testing.T) { d.GetInstallation() } +func TestDeleteEvent_GetOrg(tt *testing.T) { + d := &DeleteEvent{} + d.GetOrg() + d = nil + d.GetOrg() +} + func TestDeleteEvent_GetPusherType(tt *testing.T) { var zeroValue string d := &DeleteEvent{PusherType: &zeroValue} @@ -6570,6 +6584,13 @@ func TestDeploymentEvent_GetInstallation(tt *testing.T) { d.GetInstallation() } +func TestDeploymentEvent_GetOrganization(tt *testing.T) { + d := &DeploymentEvent{} + d.GetOrganization() + d = nil + d.GetOrganization() +} + func TestDeploymentEvent_GetRepo(tt *testing.T) { d := &DeploymentEvent{} d.GetRepo() @@ -6911,6 +6932,13 @@ func TestDeploymentStatusEvent_GetInstallation(tt *testing.T) { d.GetInstallation() } +func TestDeploymentStatusEvent_GetOrganization(tt *testing.T) { + d := &DeploymentStatusEvent{} + d.GetOrganization() + d = nil + d.GetOrganization() +} + func TestDeploymentStatusEvent_GetRepo(tt *testing.T) { d := &DeploymentStatusEvent{} d.GetRepo() @@ -9011,6 +9039,13 @@ func TestGollumEvent_GetInstallation(tt *testing.T) { g.GetInstallation() } +func TestGollumEvent_GetOrganization(tt *testing.T) { + g := &GollumEvent{} + g.GetOrganization() + g = nil + g.GetOrganization() +} + func TestGollumEvent_GetRepo(tt *testing.T) { g := &GollumEvent{} g.GetRepo() @@ -10059,6 +10094,13 @@ func TestInstallationEvent_GetInstallation(tt *testing.T) { i.GetInstallation() } +func TestInstallationEvent_GetOrganization(tt *testing.T) { + i := &InstallationEvent{} + i.GetOrganization() + i = nil + i.GetOrganization() +} + func TestInstallationEvent_GetRequester(tt *testing.T) { i := &InstallationEvent{} i.GetRequester() @@ -10470,6 +10512,13 @@ func TestInstallationRepositoriesEvent_GetInstallation(tt *testing.T) { i.GetInstallation() } +func TestInstallationRepositoriesEvent_GetOrganization(tt *testing.T) { + i := &InstallationRepositoriesEvent{} + i.GetOrganization() + i = nil + i.GetOrganization() +} + func TestInstallationRepositoriesEvent_GetRepositorySelection(tt *testing.T) { var zeroValue string i := &InstallationRepositoriesEvent{RepositorySelection: &zeroValue} @@ -11648,6 +11697,13 @@ func TestIssuesEvent_GetMilestone(tt *testing.T) { i.GetMilestone() } +func TestIssuesEvent_GetOrganization(tt *testing.T) { + i := &IssuesEvent{} + i.GetOrganization() + i = nil + i.GetOrganization() +} + func TestIssuesEvent_GetRepo(tt *testing.T) { i := &IssuesEvent{} i.GetRepo() @@ -12907,6 +12963,13 @@ func TestMarketplacePurchaseEvent_GetMarketplacePurchase(tt *testing.T) { m.GetMarketplacePurchase() } +func TestMarketplacePurchaseEvent_GetOrganization(tt *testing.T) { + m := &MarketplacePurchaseEvent{} + m.GetOrganization() + m = nil + m.GetOrganization() +} + func TestMarketplacePurchaseEvent_GetPreviousMarketplacePurchase(tt *testing.T) { m := &MarketplacePurchaseEvent{} m.GetPreviousMarketplacePurchase() @@ -12955,6 +13018,13 @@ func TestMemberEvent_GetMember(tt *testing.T) { m.GetMember() } +func TestMemberEvent_GetOrganization(tt *testing.T) { + m := &MemberEvent{} + m.GetOrganization() + m = nil + m.GetOrganization() +} + func TestMemberEvent_GetRepo(tt *testing.T) { m := &MemberEvent{} m.GetRepo() @@ -15562,6 +15632,13 @@ func TestPageBuildEvent_GetInstallation(tt *testing.T) { p.GetInstallation() } +func TestPageBuildEvent_GetOrganization(tt *testing.T) { + p := &PageBuildEvent{} + p.GetOrganization() + p = nil + p.GetOrganization() +} + func TestPageBuildEvent_GetRepo(tt *testing.T) { p := &PageBuildEvent{} p.GetRepo() @@ -16205,6 +16282,13 @@ func TestPersonalAccessTokenRequest_GetID(tt *testing.T) { p.GetID() } +func TestPersonalAccessTokenRequest_GetOrganization(tt *testing.T) { + p := &PersonalAccessTokenRequest{} + p.GetOrganization() + p = nil + p.GetOrganization() +} + func TestPersonalAccessTokenRequest_GetOwner(tt *testing.T) { p := &PersonalAccessTokenRequest{} p.GetOwner() @@ -17922,6 +18006,13 @@ func TestPublicEvent_GetInstallation(tt *testing.T) { p.GetInstallation() } +func TestPublicEvent_GetOrganization(tt *testing.T) { + p := &PublicEvent{} + p.GetOrganization() + p = nil + p.GetOrganization() +} + func TestPublicEvent_GetRepo(tt *testing.T) { p := &PublicEvent{} p.GetRepo() @@ -19045,6 +19136,13 @@ func TestPullRequestReviewCommentEvent_GetInstallation(tt *testing.T) { p.GetInstallation() } +func TestPullRequestReviewCommentEvent_GetOrganization(tt *testing.T) { + p := &PullRequestReviewCommentEvent{} + p.GetOrganization() + p = nil + p.GetOrganization() +} + func TestPullRequestReviewCommentEvent_GetPullRequest(tt *testing.T) { p := &PullRequestReviewCommentEvent{} p.GetPullRequest() @@ -19277,6 +19375,13 @@ func TestPullRequestReviewThreadEvent_GetInstallation(tt *testing.T) { p.GetInstallation() } +func TestPullRequestReviewThreadEvent_GetOrganization(tt *testing.T) { + p := &PullRequestReviewThreadEvent{} + p.GetOrganization() + p = nil + p.GetOrganization() +} + func TestPullRequestReviewThreadEvent_GetPullRequest(tt *testing.T) { p := &PullRequestReviewThreadEvent{} p.GetPullRequest() @@ -20458,6 +20563,13 @@ func TestReleaseEvent_GetInstallation(tt *testing.T) { r.GetInstallation() } +func TestReleaseEvent_GetOrganization(tt *testing.T) { + r := &ReleaseEvent{} + r.GetOrganization() + r = nil + r.GetOrganization() +} + func TestReleaseEvent_GetRelease(tt *testing.T) { r := &ReleaseEvent{} r.GetRelease() @@ -22939,6 +23051,13 @@ func TestRepositoryVulnerabilityAlertEvent_GetInstallation(tt *testing.T) { r.GetInstallation() } +func TestRepositoryVulnerabilityAlertEvent_GetOrganization(tt *testing.T) { + r := &RepositoryVulnerabilityAlertEvent{} + r.GetOrganization() + r = nil + r.GetOrganization() +} + func TestRepositoryVulnerabilityAlertEvent_GetRepository(tt *testing.T) { r := &RepositoryVulnerabilityAlertEvent{} r.GetRepository() @@ -25093,6 +25212,13 @@ func TestStatusEvent_GetName(tt *testing.T) { s.GetName() } +func TestStatusEvent_GetOrganization(tt *testing.T) { + s := &StatusEvent{} + s.GetOrganization() + s = nil + s.GetOrganization() +} + func TestStatusEvent_GetRepo(tt *testing.T) { s := &StatusEvent{} s.GetRepo() @@ -27846,6 +27972,13 @@ func TestWatchEvent_GetInstallation(tt *testing.T) { w.GetInstallation() } +func TestWatchEvent_GetOrganization(tt *testing.T) { + w := &WatchEvent{} + w.GetOrganization() + w = nil + w.GetOrganization() +} + func TestWatchEvent_GetRepo(tt *testing.T) { w := &WatchEvent{} w.GetRepo() From ff1b5d4febd06fce45395167651b9c98d6a6e4e8 Mon Sep 17 00:00:00 2001 From: billnapier Date: Tue, 3 Oct 2023 22:54:37 +0000 Subject: [PATCH 4/5] Change new Organizations to just be Org. This field is inconsistently named throughout this file, but updating the old instances would be a breaking change, so they got left. --- github/event_types.go | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/github/event_types.go b/github/event_types.go index 8113ac66f9..aef9c6d784 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -203,7 +203,7 @@ type DeploymentEvent struct { // The following field is only present when the webhook is triggered on // a repository belonging to an organization. - Organization *Organization `json:"organization,omitempty"` + Org *Organization `json:"organization,omitempty"` } // DeploymentProtectionRuleEvent represents a deployment protection rule event. @@ -242,7 +242,7 @@ type DeploymentStatusEvent struct { // The following field is only present when the webhook is triggered on // a repository belonging to an organization. - Organization *Organization `json:"organization,omitempty"` + Org *Organization `json:"organization,omitempty"` } // DiscussionCommentEvent represents a webhook event for a comment on discussion. @@ -382,7 +382,7 @@ type GollumEvent struct { // The following field is only present when the webhook is triggered on // a repository belonging to an organization. - Organization *Organization `json:"organization,omitempty"` + Org *Organization `json:"organization,omitempty"` } // EditChange represents the changes when an issue, pull request, comment, @@ -533,7 +533,7 @@ type InstallationEvent struct { // The following field is only present when the webhook is triggered on // a repository belonging to an organization. - Organization *Organization `json:"organization,omitempty"` + Org *Organization `json:"organization,omitempty"` } // InstallationRepositoriesEvent is triggered when a repository is added or @@ -551,7 +551,7 @@ type InstallationRepositoriesEvent struct { // The following field is only present when the webhook is triggered on // a repository belonging to an organization. - Organization *Organization `json:"organization,omitempty"` + Org *Organization `json:"organization,omitempty"` } // InstallationLoginChange represents a change in login on an installation. @@ -634,7 +634,7 @@ type IssuesEvent struct { // The following field is only present when the webhook is triggered on // a repository belonging to an organization. - Organization *Organization `json:"organization,omitempty"` + Org *Organization `json:"organization,omitempty"` } // LabelEvent is triggered when a repository's label is created, edited, or deleted. @@ -674,7 +674,7 @@ type MarketplacePurchaseEvent struct { // The following field is only present when the webhook is triggered on // a repository belonging to an organization. - Organization *Organization `json:"organization,omitempty"` + Org *Organization `json:"organization,omitempty"` } // MemberEvent is triggered when a user is added as a collaborator to a repository. @@ -693,7 +693,7 @@ type MemberEvent struct { // The following field is only present when the webhook is triggered on // a repository belonging to an organization. - Organization *Organization `json:"organization,omitempty"` + Org *Organization `json:"organization,omitempty"` } // MembershipEvent is triggered when a user is added or removed from a team. @@ -868,7 +868,7 @@ type PageBuildEvent struct { // The following field is only present when the webhook is triggered on // a repository belonging to an organization. - Organization *Organization `json:"organization,omitempty"` + Org *Organization `json:"organization,omitempty"` } // PersonalAccessTokenRequestEvent occurs when there is activity relating to a @@ -932,7 +932,7 @@ type PersonalAccessTokenRequest struct { // The following field is only present when the webhook is triggered on // a repository belonging to an organization. - Organization *Organization `json:"organization,omitempty"` + Org *Organization `json:"organization,omitempty"` } // PersonalAccessTokenPermissions represents the original or newly requested @@ -1095,7 +1095,7 @@ type PublicEvent struct { // The following field is only present when the webhook is triggered on // a repository belonging to an organization. - Organization *Organization `json:"organization,omitempty"` + Org *Organization `json:"organization,omitempty"` } // PullRequestEvent is triggered when a pull request is assigned, unassigned, labeled, @@ -1181,7 +1181,7 @@ type PullRequestReviewCommentEvent struct { // The following field is only present when the webhook is triggered on // a repository belonging to an organization. - Organization *Organization `json:"organization,omitempty"` + Org *Organization `json:"organization,omitempty"` } // PullRequestReviewThreadEvent is triggered when a comment made as part of a @@ -1203,7 +1203,7 @@ type PullRequestReviewThreadEvent struct { // The following field is only present when the webhook is triggered on // a repository belonging to an organization. - Organization *Organization `json:"organization,omitempty"` + Org *Organization `json:"organization,omitempty"` } // PullRequestTargetEvent is triggered when a pull request is assigned, unassigned, labeled, @@ -1372,7 +1372,7 @@ type ReleaseEvent struct { // The following field is only present when the webhook is triggered on // a repository belonging to an organization. - Organization *Organization `json:"organization,omitempty"` + Org *Organization `json:"organization,omitempty"` } // RepositoryEvent is triggered when a repository is created, archived, unarchived, @@ -1446,7 +1446,7 @@ type RepositoryVulnerabilityAlertEvent struct { // The following field is only present when the webhook is triggered on // a repository belonging to an organization. - Organization *Organization `json:"organization,omitempty"` + Org *Organization `json:"organization,omitempty"` } // RepositoryVulnerabilityAlert represents a repository security alert. @@ -1556,7 +1556,7 @@ type StatusEvent struct { // The following field is only present when the webhook is triggered on // a repository belonging to an organization. - Organization *Organization `json:"organization,omitempty"` + Org *Organization `json:"organization,omitempty"` } // TeamEvent is triggered when an organization's team is created, modified or deleted. @@ -1630,7 +1630,7 @@ type WatchEvent struct { // The following field is only present when the webhook is triggered on // a repository belonging to an organization. - Organization *Organization `json:"organization,omitempty"` + Org *Organization `json:"organization,omitempty"` } // WorkflowDispatchEvent is triggered when someone triggers a workflow run on GitHub or From 360694733602620f741dad61b04018b86821c9a5 Mon Sep 17 00:00:00 2001 From: billnapier Date: Tue, 3 Oct 2023 22:56:38 +0000 Subject: [PATCH 5/5] And update the tests I missed in the last commit. --- github/github-accessors.go | 102 ++++++++++++++++---------------- github/github-accessors_test.go | 102 ++++++++++++++++---------------- 2 files changed, 102 insertions(+), 102 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index a9c33e1b5e..ecdaf1a073 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -5598,12 +5598,12 @@ func (d *DeploymentEvent) GetInstallation() *Installation { return d.Installation } -// GetOrganization returns the Organization field. -func (d *DeploymentEvent) GetOrganization() *Organization { +// GetOrg returns the Org field. +func (d *DeploymentEvent) GetOrg() *Organization { if d == nil { return nil } - return d.Organization + return d.Org } // GetRepo returns the Repo field. @@ -5910,12 +5910,12 @@ func (d *DeploymentStatusEvent) GetInstallation() *Installation { return d.Installation } -// GetOrganization returns the Organization field. -func (d *DeploymentStatusEvent) GetOrganization() *Organization { +// GetOrg returns the Org field. +func (d *DeploymentStatusEvent) GetOrg() *Organization { if d == nil { return nil } - return d.Organization + return d.Org } // GetRepo returns the Repo field. @@ -7718,12 +7718,12 @@ func (g *GollumEvent) GetInstallation() *Installation { return g.Installation } -// GetOrganization returns the Organization field. -func (g *GollumEvent) GetOrganization() *Organization { +// GetOrg returns the Org field. +func (g *GollumEvent) GetOrg() *Organization { if g == nil { return nil } - return g.Organization + return g.Org } // GetRepo returns the Repo field. @@ -8598,12 +8598,12 @@ func (i *InstallationEvent) GetInstallation() *Installation { return i.Installation } -// GetOrganization returns the Organization field. -func (i *InstallationEvent) GetOrganization() *Organization { +// GetOrg returns the Org field. +func (i *InstallationEvent) GetOrg() *Organization { if i == nil { return nil } - return i.Organization + return i.Org } // GetRequester returns the Requester field. @@ -8942,12 +8942,12 @@ func (i *InstallationRepositoriesEvent) GetInstallation() *Installation { return i.Installation } -// GetOrganization returns the Organization field. -func (i *InstallationRepositoriesEvent) GetOrganization() *Organization { +// GetOrg returns the Org field. +func (i *InstallationRepositoriesEvent) GetOrg() *Organization { if i == nil { return nil } - return i.Organization + return i.Org } // GetRepositorySelection returns the RepositorySelection field if it's non-nil, zero value otherwise. @@ -9998,12 +9998,12 @@ func (i *IssuesEvent) GetMilestone() *Milestone { return i.Milestone } -// GetOrganization returns the Organization field. -func (i *IssuesEvent) GetOrganization() *Organization { +// GetOrg returns the Org field. +func (i *IssuesEvent) GetOrg() *Organization { if i == nil { return nil } - return i.Organization + return i.Org } // GetRepo returns the Repo field. @@ -11054,12 +11054,12 @@ func (m *MarketplacePurchaseEvent) GetMarketplacePurchase() *MarketplacePurchase return m.MarketplacePurchase } -// GetOrganization returns the Organization field. -func (m *MarketplacePurchaseEvent) GetOrganization() *Organization { +// GetOrg returns the Org field. +func (m *MarketplacePurchaseEvent) GetOrg() *Organization { if m == nil { return nil } - return m.Organization + return m.Org } // GetPreviousMarketplacePurchase returns the PreviousMarketplacePurchase field. @@ -11110,12 +11110,12 @@ func (m *MemberEvent) GetMember() *User { return m.Member } -// GetOrganization returns the Organization field. -func (m *MemberEvent) GetOrganization() *Organization { +// GetOrg returns the Org field. +func (m *MemberEvent) GetOrg() *Organization { if m == nil { return nil } - return m.Organization + return m.Org } // GetRepo returns the Repo field. @@ -13350,12 +13350,12 @@ func (p *PageBuildEvent) GetInstallation() *Installation { return p.Installation } -// GetOrganization returns the Organization field. -func (p *PageBuildEvent) GetOrganization() *Organization { +// GetOrg returns the Org field. +func (p *PageBuildEvent) GetOrg() *Organization { if p == nil { return nil } - return p.Organization + return p.Org } // GetRepo returns the Repo field. @@ -13894,12 +13894,12 @@ func (p *PersonalAccessTokenRequest) GetID() int64 { return *p.ID } -// GetOrganization returns the Organization field. -func (p *PersonalAccessTokenRequest) GetOrganization() *Organization { +// GetOrg returns the Org field. +func (p *PersonalAccessTokenRequest) GetOrg() *Organization { if p == nil { return nil } - return p.Organization + return p.Org } // GetOwner returns the Owner field. @@ -15494,12 +15494,12 @@ func (p *PublicEvent) GetInstallation() *Installation { return p.Installation } -// GetOrganization returns the Organization field. -func (p *PublicEvent) GetOrganization() *Organization { +// GetOrg returns the Org field. +func (p *PublicEvent) GetOrg() *Organization { if p == nil { return nil } - return p.Organization + return p.Org } // GetRepo returns the Repo field. @@ -16470,12 +16470,12 @@ func (p *PullRequestReviewCommentEvent) GetInstallation() *Installation { return p.Installation } -// GetOrganization returns the Organization field. -func (p *PullRequestReviewCommentEvent) GetOrganization() *Organization { +// GetOrg returns the Org field. +func (p *PullRequestReviewCommentEvent) GetOrg() *Organization { if p == nil { return nil } - return p.Organization + return p.Org } // GetPullRequest returns the PullRequest field. @@ -16702,12 +16702,12 @@ func (p *PullRequestReviewThreadEvent) GetInstallation() *Installation { return p.Installation } -// GetOrganization returns the Organization field. -func (p *PullRequestReviewThreadEvent) GetOrganization() *Organization { +// GetOrg returns the Org field. +func (p *PullRequestReviewThreadEvent) GetOrg() *Organization { if p == nil { return nil } - return p.Organization + return p.Org } // GetPullRequest returns the PullRequest field. @@ -17734,12 +17734,12 @@ func (r *ReleaseEvent) GetInstallation() *Installation { return r.Installation } -// GetOrganization returns the Organization field. -func (r *ReleaseEvent) GetOrganization() *Organization { +// GetOrg returns the Org field. +func (r *ReleaseEvent) GetOrg() *Organization { if r == nil { return nil } - return r.Organization + return r.Org } // GetRelease returns the Release field. @@ -19830,12 +19830,12 @@ func (r *RepositoryVulnerabilityAlertEvent) GetInstallation() *Installation { return r.Installation } -// GetOrganization returns the Organization field. -func (r *RepositoryVulnerabilityAlertEvent) GetOrganization() *Organization { +// GetOrg returns the Org field. +func (r *RepositoryVulnerabilityAlertEvent) GetOrg() *Organization { if r == nil { return nil } - return r.Organization + return r.Org } // GetRepository returns the Repository field. @@ -21686,12 +21686,12 @@ func (s *StatusEvent) GetName() string { return *s.Name } -// GetOrganization returns the Organization field. -func (s *StatusEvent) GetOrganization() *Organization { +// GetOrg returns the Org field. +func (s *StatusEvent) GetOrg() *Organization { if s == nil { return nil } - return s.Organization + return s.Org } // GetRepo returns the Repo field. @@ -24014,12 +24014,12 @@ func (w *WatchEvent) GetInstallation() *Installation { return w.Installation } -// GetOrganization returns the Organization field. -func (w *WatchEvent) GetOrganization() *Organization { +// GetOrg returns the Org field. +func (w *WatchEvent) GetOrg() *Organization { if w == nil { return nil } - return w.Organization + return w.Org } // GetRepo returns the Repo field. diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 6b81f722d5..d43ae1b0c2 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -6584,11 +6584,11 @@ func TestDeploymentEvent_GetInstallation(tt *testing.T) { d.GetInstallation() } -func TestDeploymentEvent_GetOrganization(tt *testing.T) { +func TestDeploymentEvent_GetOrg(tt *testing.T) { d := &DeploymentEvent{} - d.GetOrganization() + d.GetOrg() d = nil - d.GetOrganization() + d.GetOrg() } func TestDeploymentEvent_GetRepo(tt *testing.T) { @@ -6932,11 +6932,11 @@ func TestDeploymentStatusEvent_GetInstallation(tt *testing.T) { d.GetInstallation() } -func TestDeploymentStatusEvent_GetOrganization(tt *testing.T) { +func TestDeploymentStatusEvent_GetOrg(tt *testing.T) { d := &DeploymentStatusEvent{} - d.GetOrganization() + d.GetOrg() d = nil - d.GetOrganization() + d.GetOrg() } func TestDeploymentStatusEvent_GetRepo(tt *testing.T) { @@ -9039,11 +9039,11 @@ func TestGollumEvent_GetInstallation(tt *testing.T) { g.GetInstallation() } -func TestGollumEvent_GetOrganization(tt *testing.T) { +func TestGollumEvent_GetOrg(tt *testing.T) { g := &GollumEvent{} - g.GetOrganization() + g.GetOrg() g = nil - g.GetOrganization() + g.GetOrg() } func TestGollumEvent_GetRepo(tt *testing.T) { @@ -10094,11 +10094,11 @@ func TestInstallationEvent_GetInstallation(tt *testing.T) { i.GetInstallation() } -func TestInstallationEvent_GetOrganization(tt *testing.T) { +func TestInstallationEvent_GetOrg(tt *testing.T) { i := &InstallationEvent{} - i.GetOrganization() + i.GetOrg() i = nil - i.GetOrganization() + i.GetOrg() } func TestInstallationEvent_GetRequester(tt *testing.T) { @@ -10512,11 +10512,11 @@ func TestInstallationRepositoriesEvent_GetInstallation(tt *testing.T) { i.GetInstallation() } -func TestInstallationRepositoriesEvent_GetOrganization(tt *testing.T) { +func TestInstallationRepositoriesEvent_GetOrg(tt *testing.T) { i := &InstallationRepositoriesEvent{} - i.GetOrganization() + i.GetOrg() i = nil - i.GetOrganization() + i.GetOrg() } func TestInstallationRepositoriesEvent_GetRepositorySelection(tt *testing.T) { @@ -11697,11 +11697,11 @@ func TestIssuesEvent_GetMilestone(tt *testing.T) { i.GetMilestone() } -func TestIssuesEvent_GetOrganization(tt *testing.T) { +func TestIssuesEvent_GetOrg(tt *testing.T) { i := &IssuesEvent{} - i.GetOrganization() + i.GetOrg() i = nil - i.GetOrganization() + i.GetOrg() } func TestIssuesEvent_GetRepo(tt *testing.T) { @@ -12963,11 +12963,11 @@ func TestMarketplacePurchaseEvent_GetMarketplacePurchase(tt *testing.T) { m.GetMarketplacePurchase() } -func TestMarketplacePurchaseEvent_GetOrganization(tt *testing.T) { +func TestMarketplacePurchaseEvent_GetOrg(tt *testing.T) { m := &MarketplacePurchaseEvent{} - m.GetOrganization() + m.GetOrg() m = nil - m.GetOrganization() + m.GetOrg() } func TestMarketplacePurchaseEvent_GetPreviousMarketplacePurchase(tt *testing.T) { @@ -13018,11 +13018,11 @@ func TestMemberEvent_GetMember(tt *testing.T) { m.GetMember() } -func TestMemberEvent_GetOrganization(tt *testing.T) { +func TestMemberEvent_GetOrg(tt *testing.T) { m := &MemberEvent{} - m.GetOrganization() + m.GetOrg() m = nil - m.GetOrganization() + m.GetOrg() } func TestMemberEvent_GetRepo(tt *testing.T) { @@ -15632,11 +15632,11 @@ func TestPageBuildEvent_GetInstallation(tt *testing.T) { p.GetInstallation() } -func TestPageBuildEvent_GetOrganization(tt *testing.T) { +func TestPageBuildEvent_GetOrg(tt *testing.T) { p := &PageBuildEvent{} - p.GetOrganization() + p.GetOrg() p = nil - p.GetOrganization() + p.GetOrg() } func TestPageBuildEvent_GetRepo(tt *testing.T) { @@ -16282,11 +16282,11 @@ func TestPersonalAccessTokenRequest_GetID(tt *testing.T) { p.GetID() } -func TestPersonalAccessTokenRequest_GetOrganization(tt *testing.T) { +func TestPersonalAccessTokenRequest_GetOrg(tt *testing.T) { p := &PersonalAccessTokenRequest{} - p.GetOrganization() + p.GetOrg() p = nil - p.GetOrganization() + p.GetOrg() } func TestPersonalAccessTokenRequest_GetOwner(tt *testing.T) { @@ -18006,11 +18006,11 @@ func TestPublicEvent_GetInstallation(tt *testing.T) { p.GetInstallation() } -func TestPublicEvent_GetOrganization(tt *testing.T) { +func TestPublicEvent_GetOrg(tt *testing.T) { p := &PublicEvent{} - p.GetOrganization() + p.GetOrg() p = nil - p.GetOrganization() + p.GetOrg() } func TestPublicEvent_GetRepo(tt *testing.T) { @@ -19136,11 +19136,11 @@ func TestPullRequestReviewCommentEvent_GetInstallation(tt *testing.T) { p.GetInstallation() } -func TestPullRequestReviewCommentEvent_GetOrganization(tt *testing.T) { +func TestPullRequestReviewCommentEvent_GetOrg(tt *testing.T) { p := &PullRequestReviewCommentEvent{} - p.GetOrganization() + p.GetOrg() p = nil - p.GetOrganization() + p.GetOrg() } func TestPullRequestReviewCommentEvent_GetPullRequest(tt *testing.T) { @@ -19375,11 +19375,11 @@ func TestPullRequestReviewThreadEvent_GetInstallation(tt *testing.T) { p.GetInstallation() } -func TestPullRequestReviewThreadEvent_GetOrganization(tt *testing.T) { +func TestPullRequestReviewThreadEvent_GetOrg(tt *testing.T) { p := &PullRequestReviewThreadEvent{} - p.GetOrganization() + p.GetOrg() p = nil - p.GetOrganization() + p.GetOrg() } func TestPullRequestReviewThreadEvent_GetPullRequest(tt *testing.T) { @@ -20563,11 +20563,11 @@ func TestReleaseEvent_GetInstallation(tt *testing.T) { r.GetInstallation() } -func TestReleaseEvent_GetOrganization(tt *testing.T) { +func TestReleaseEvent_GetOrg(tt *testing.T) { r := &ReleaseEvent{} - r.GetOrganization() + r.GetOrg() r = nil - r.GetOrganization() + r.GetOrg() } func TestReleaseEvent_GetRelease(tt *testing.T) { @@ -23051,11 +23051,11 @@ func TestRepositoryVulnerabilityAlertEvent_GetInstallation(tt *testing.T) { r.GetInstallation() } -func TestRepositoryVulnerabilityAlertEvent_GetOrganization(tt *testing.T) { +func TestRepositoryVulnerabilityAlertEvent_GetOrg(tt *testing.T) { r := &RepositoryVulnerabilityAlertEvent{} - r.GetOrganization() + r.GetOrg() r = nil - r.GetOrganization() + r.GetOrg() } func TestRepositoryVulnerabilityAlertEvent_GetRepository(tt *testing.T) { @@ -25212,11 +25212,11 @@ func TestStatusEvent_GetName(tt *testing.T) { s.GetName() } -func TestStatusEvent_GetOrganization(tt *testing.T) { +func TestStatusEvent_GetOrg(tt *testing.T) { s := &StatusEvent{} - s.GetOrganization() + s.GetOrg() s = nil - s.GetOrganization() + s.GetOrg() } func TestStatusEvent_GetRepo(tt *testing.T) { @@ -27972,11 +27972,11 @@ func TestWatchEvent_GetInstallation(tt *testing.T) { w.GetInstallation() } -func TestWatchEvent_GetOrganization(tt *testing.T) { +func TestWatchEvent_GetOrg(tt *testing.T) { w := &WatchEvent{} - w.GetOrganization() + w.GetOrg() w = nil - w.GetOrganization() + w.GetOrg() } func TestWatchEvent_GetRepo(tt *testing.T) {