diff --git a/github/event_types.go b/github/event_types.go index b820dddf4a7..60836e6ec54 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -20,23 +20,30 @@ type RequestedAction struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_rule type BranchProtectionRuleEvent struct { - Action *string `json:"action,omitempty"` - Rule *BranchProtectionRule `json:"rule,omitempty"` - Changes *ProtectionChanges `json:"changes,omitempty"` - Repo *Repository `json:"repository,omitempty"` - Org *Organization `json:"organization,omitempty"` - Sender *User `json:"sender,omitempty"` - Installation *Installation `json:"installation,omitempty"` + Action *BranchProtectionRuleEventAction `json:"action,omitempty"` + Rule *BranchProtectionRule `json:"rule,omitempty"` + Changes *ProtectionChanges `json:"changes,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` + Installation *Installation `json:"installation,omitempty"` } +type BranchProtectionRuleEventAction string + +const ( + BranchProtectionRuleEventActionCreated BranchProtectionRuleEventAction = "created" + BranchProtectionRuleEventActionEdited BranchProtectionRuleEventAction = "edited" + BranchProtectionRuleEventActionDeleted BranchProtectionRuleEventAction = "deleted" +) + // CheckRunEvent is triggered when a check run is "created", "completed", or "rerequested". // The Webhook event name is "check_run". // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#check_run type CheckRunEvent struct { - CheckRun *CheckRun `json:"check_run,omitempty"` - // The action performed. Possible values are: "created", "completed", "rerequested" or "requested_action". - Action *string `json:"action,omitempty"` + CheckRun *CheckRun `json:"check_run,omitempty"` + Action CheckRunEventAction `json:"action,omitempty"` // The following fields are only populated by Webhook events. Repo *Repository `json:"repository,omitempty"` @@ -48,14 +55,22 @@ type CheckRunEvent struct { RequestedAction *RequestedAction `json:"requested_action,omitempty"` // } +type CheckRunEventAction string + +const ( + CheckRunEventActionCreated CheckRunEventAction = "created" + CheckRunEventActionCompleted CheckRunEventAction = "completed" + CheckRunEventActionRerequested CheckRunEventAction = "rerequested" + CheckRunEventActionRequestedAction CheckRunEventAction = "requested_action" +) + // CheckSuiteEvent is triggered when a check suite is "completed", "requested", or "rerequested". // The Webhook event name is "check_suite". // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#check_suite type CheckSuiteEvent struct { - CheckSuite *CheckSuite `json:"check_suite,omitempty"` - // The action performed. Possible values are: "completed", "requested" or "rerequested". - Action *string `json:"action,omitempty"` + CheckSuite *CheckSuite `json:"check_suite,omitempty"` + Action CheckSuiteEventAction `json:"action,omitempty"` // The following fields are only populated by Webhook events. Repo *Repository `json:"repository,omitempty"` @@ -64,6 +79,14 @@ type CheckSuiteEvent struct { Installation *Installation `json:"installation,omitempty"` } +type CheckSuiteEventAction string + +const ( + CheckSuiteEventCompleted CheckSuiteEventAction = "completed" + CheckSuiteEventRequested CheckSuiteEventAction = "requested" + CheckSuiteEventRerequested CheckSuiteEventAction = "rerequested" +) + // CommitCommentEvent is triggered when a commit comment is created. // The Webhook event name is "commit_comment". // @@ -72,16 +95,22 @@ type CommitCommentEvent struct { Comment *RepositoryComment `json:"comment,omitempty"` // The following fields are only populated by Webhook events. - Action *string `json:"action,omitempty"` - Repo *Repository `json:"repository,omitempty"` - Sender *User `json:"sender,omitempty"` - Installation *Installation `json:"installation,omitempty"` + Action CommitCommentEventAction `json:"action,omitempty"` + 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"` } +type CommitCommentEventAction string + +const ( + CommitCommentEventCreated CommitCommentEventAction = "created" +) + // ContentReferenceEvent is triggered when the body or comment of an issue or // pull request includes a URL that matches a configured content reference // domain. @@ -94,7 +123,7 @@ type ContentReferenceEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` -} +} //TODO? rm // CreateEvent represents a created repository, branch, or tag. // The Webhook event name is "create". @@ -147,8 +176,8 @@ type DeleteEvent struct { // // GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#dependabot_alert type DependabotAlertEvent struct { - Action *string `json:"action,omitempty"` - Alert *DependabotAlert `json:"alert,omitempty"` + Action DependabotAlertEventAction `json:"action,omitempty"` + Alert *DependabotAlert `json:"alert,omitempty"` // The following fields are only populated by Webhook events. Installation *Installation `json:"installation,omitempty"` @@ -161,6 +190,18 @@ type DependabotAlertEvent struct { Organization *Organization `json:"organization,omitempty"` } +type DependabotAlertEventAction string + +const ( + DependabotAlertEventAutoDismissed DependabotAlertEventAction = "auto_dismissed" + DependabotAlertEventAutoReopened DependabotAlertEventAction = "auto_reopened" + DependabotAlertEventCreated DependabotAlertEventAction = "created" + DependabotAlertEventDismissed DependabotAlertEventAction = "dismissed" + DependabotAlertEventFixed DependabotAlertEventAction = "fixed" + DependabotAlertEventReintroduced DependabotAlertEventAction = "reintroduced" + DependabotAlertEventReopened DependabotAlertEventAction = "reopened" +) + // DeployKeyEvent is triggered when a deploy key is added or removed from a repository. // The Webhook event name is "deploy_key". // @@ -168,7 +209,7 @@ type DependabotAlertEvent struct { type DeployKeyEvent struct { // Action is the action that was performed. Possible values are: // "created" or "deleted". - Action *string `json:"action,omitempty"` + Action DeployKeyEventAction `json:"action,omitempty"` // The deploy key resource. Key *Key `json:"key,omitempty"` @@ -185,6 +226,13 @@ type DeployKeyEvent struct { Installation *Installation `json:"installation,omitempty"` } +type DeployKeyEventAction string + +const ( + DeployKeyEventCreated DeployKeyEventAction = "created" + DeployKeyEventDeleted DeployKeyEventAction = "deleted" +) + // DeploymentEvent represents a deployment. // The Webhook event name is "deployment". // @@ -211,9 +259,9 @@ type DeploymentEvent struct { // // GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#deployment_protection_rule type DeploymentProtectionRuleEvent struct { - Action *string `json:"action,omitempty"` - Environment *string `json:"environment,omitempty"` - Event *string `json:"event,omitempty"` + Action DeploymentProtectionRuleEventAction `json:"action,omitempty"` + Environment *string `json:"environment,omitempty"` + Event *string `json:"event,omitempty"` // The URL Github provides for a third-party to use in order to pass/fail a deployment gate DeploymentCallbackURL *string `json:"deployment_callback_url,omitempty"` @@ -225,6 +273,12 @@ type DeploymentProtectionRuleEvent struct { Installation *Installation `json:"installation,omitempty"` } +type DeploymentProtectionRuleEventAction string + +const ( + DeploymentProtectionRuleEventRequested DeploymentProtectionRuleEventAction = "requested" +) + // DeploymentStatusEvent represents a deployment status. // The Webhook event name is "deployment_status". // @@ -250,17 +304,23 @@ type DeploymentStatusEvent struct { // // GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#discussion_comment type DiscussionCommentEvent struct { - // Action is the action that was performed on the comment. - // Possible values are: "created", "edited", "deleted". ** check what all can be added - Action *string `json:"action,omitempty"` - Discussion *Discussion `json:"discussion,omitempty"` - Comment *CommentDiscussion `json:"comment,omitempty"` - Repo *Repository `json:"repository,omitempty"` - Org *Organization `json:"organization,omitempty"` - Sender *User `json:"sender,omitempty"` - Installation *Installation `json:"installation,omitempty"` + Action DiscussionCommentEventAction `json:"action,omitempty"` + Discussion *Discussion `json:"discussion,omitempty"` + Comment *CommentDiscussion `json:"comment,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` + Installation *Installation `json:"installation,omitempty"` } +type DiscussionCommentEventAction string + +const ( + DiscussionCommentEventCreated DiscussionCommentEventAction = "created" + DiscussionCommentEventEdited DiscussionCommentEventAction = "edited" + DiscussionCommentEventDeleted DiscussionCommentEventAction = "deleted" +) + // CommentDiscussion represents a comment in a GitHub DiscussionCommentEvent. type CommentDiscussion struct { AuthorAssociation *string `json:"author_association,omitempty"` @@ -283,17 +343,30 @@ type CommentDiscussion struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#discussion type DiscussionEvent struct { - // Action is the action that was performed. Possible values are: - // created, edited, deleted, pinned, unpinned, locked, unlocked, - // transferred, category_changed, answered, or unanswered. - Action *string `json:"action,omitempty"` - Discussion *Discussion `json:"discussion,omitempty"` - Repo *Repository `json:"repository,omitempty"` - Org *Organization `json:"organization,omitempty"` - Sender *User `json:"sender,omitempty"` - Installation *Installation `json:"installation,omitempty"` + Action DiscussionEventAction `json:"action,omitempty"` + Discussion *Discussion `json:"discussion,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` + Installation *Installation `json:"installation,omitempty"` } +type DiscussionEventAction string + +const ( + DiscussionEventCreated DiscussionEventAction = "created" + DiscussionEventEdited DiscussionEventAction = "edited" + DiscussionEventDeleted DiscussionEventAction = "deleted" + DiscussionEventPinned DiscussionEventAction = "pinned" + DiscussionEventUnpinned DiscussionEventAction = "unpinned" + DiscussionEventLocked DiscussionEventAction = "locked" + DiscussionEventUnlocked DiscussionEventAction = "unlocked" + DiscussionEventTransferred DiscussionCommentEventAction = "transferred" + DiscussionEventCategoryChanged DiscussionEventAction = "category_changed" + DiscussionEventAnswered DiscussionEventAction = "answered" + DiscussionEventUnanswered DiscussionEventAction = "unanswered" +) + // Discussion represents a discussion in a GitHub DiscussionEvent. type Discussion struct { RepositoryURL *string `json:"repository_url,omitempty"` @@ -350,14 +423,19 @@ type ForkEvent struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#github_app_authorization type GitHubAppAuthorizationEvent struct { - // The action performed. Possible value is: "revoked". - Action *string `json:"action,omitempty"` + Action GitHubAppAuthorizationEventAction `json:"action,omitempty"` // The following fields are only populated by Webhook events. Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` } +type GitHubAppAuthorizationEventAction string + +const ( + GitHubAppAuthorizationEventRevoked GitHubAppAuthorizationEventAction = "revoked" +) + // Page represents a single Wiki page. type Page struct { PageName *string `json:"page_name,omitempty"` @@ -548,24 +626,41 @@ type InstallationEvent struct { Org *Organization `json:"organization,omitempty"` } +type InstallationEventAction string + +const ( + InstallationEventCreated InstallationEventAction = "created" + InstallationEventDeleted InstallationEventAction = "deleted" + InstallationEventSuspend InstallationEventAction = "suspend" + InstallationEventUnsuspend InstallationEventAction = "unsuspend" + InstallationEventNewPermissionsAccepted InstallationEventAction = "new_permissions_accepted" +) + // InstallationRepositoriesEvent is triggered when a repository is added or // removed from an installation. The Webhook event name is "installation_repositories". // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#installation_repositories type InstallationRepositoriesEvent struct { // The action that was performed. Can be either "added" or "removed". - Action *string `json:"action,omitempty"` - RepositoriesAdded []*Repository `json:"repositories_added,omitempty"` - RepositoriesRemoved []*Repository `json:"repositories_removed,omitempty"` - RepositorySelection *string `json:"repository_selection,omitempty"` - Sender *User `json:"sender,omitempty"` - Installation *Installation `json:"installation,omitempty"` + Action InstallationRepositoriesEventAction `json:"action,omitempty"` + RepositoriesAdded []*Repository `json:"repositories_added,omitempty"` + RepositoriesRemoved []*Repository `json:"repositories_removed,omitempty"` + 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. Org *Organization `json:"organization,omitempty"` } +type InstallationRepositoriesEventAction string + +const ( + InstallationRepositoriesEventAdded InstallationRepositoriesEventAction = "added" + InstallationRepositoriesEventRemoved InstallationRepositoriesEventAction = "removed" +) + // InstallationLoginChange represents a change in login on an installation. type InstallationLoginChange struct { From *string `json:"from,omitempty"` @@ -587,28 +682,32 @@ type InstallationChanges struct { // // GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#installation_target type InstallationTargetEvent struct { - Account *User `json:"account,omitempty"` - Action *string `json:"action,omitempty"` - Changes *InstallationChanges `json:"changes,omitempty"` - Enterprise *Enterprise `json:"enterprise,omitempty"` - Installation *Installation `json:"installation,omitempty"` - Organization *Organization `json:"organization,omitempty"` - Repository *Repository `json:"repository,omitempty"` - Sender *User `json:"sender,omitempty"` - TargetType *string `json:"target_type,omitempty"` + Account *User `json:"account,omitempty"` + Action InstallationTargetEventAction `json:"action,omitempty"` + Changes *InstallationChanges `json:"changes,omitempty"` + Enterprise *Enterprise `json:"enterprise,omitempty"` + Installation *Installation `json:"installation,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Repository *Repository `json:"repository,omitempty"` + Sender *User `json:"sender,omitempty"` + TargetType *string `json:"target_type,omitempty"` } +type InstallationTargetEventAction string + +const ( + InstallationTargetEventRenamed InstallationTargetEventAction = "renamed" +) + // IssueCommentEvent is triggered when an issue comment is created on an issue // or pull request. // The Webhook event name is "issue_comment". // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#issue_comment type IssueCommentEvent struct { - // Action is the action that was performed on the comment. - // Possible values are: "created", "edited", "deleted". - Action *string `json:"action,omitempty"` - Issue *Issue `json:"issue,omitempty"` - Comment *IssueComment `json:"comment,omitempty"` + Action IssueCommentEventAction `json:"action,omitempty"` + Issue *Issue `json:"issue,omitempty"` + Comment *IssueComment `json:"comment,omitempty"` // The following fields are only populated by Webhook events. Changes *EditChange `json:"changes,omitempty"` @@ -621,6 +720,14 @@ type IssueCommentEvent struct { Organization *Organization `json:"organization,omitempty"` } +type IssueCommentEventAction string + +const ( + IssueCommentEventCreated IssueCommentEventAction = "created" + IssueCommentEventDeleted IssueCommentEventAction = "deleted" + IssueCommentEventEdited IssueCommentEventAction = "edited" +) + // IssuesEvent is triggered when an issue is opened, edited, deleted, transferred, // pinned, unpinned, closed, reopened, assigned, unassigned, labeled, unlabeled, // locked, unlocked, milestoned, or demilestoned. @@ -628,14 +735,10 @@ type IssueCommentEvent struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#issues type IssuesEvent struct { - // Action is the action that was performed. Possible values are: "opened", - // "edited", "deleted", "transferred", "pinned", "unpinned", "closed", "reopened", - // "assigned", "unassigned", "labeled", "unlabeled", "locked", "unlocked", - // "milestoned", or "demilestoned". - Action *string `json:"action,omitempty"` - Issue *Issue `json:"issue,omitempty"` - Assignee *User `json:"assignee,omitempty"` - Label *Label `json:"label,omitempty"` + Action IssuesEventAction `json:"action,omitempty"` + Issue *Issue `json:"issue,omitempty"` + Assignee *User `json:"assignee,omitempty"` + Label *Label `json:"label,omitempty"` // The following fields are only populated by Webhook events. Changes *EditChange `json:"changes,omitempty"` @@ -649,16 +752,34 @@ type IssuesEvent struct { Org *Organization `json:"organization,omitempty"` } +type IssuesEventAction string + +const ( + IssuesEventOpened IssuesEventAction = "opened" + IssuesEventEdited IssuesEventAction = "edited" + IssuesEventDeleted IssuesEventAction = "deleted" + IssuesEventTransferred IssuesEventAction = "transferred" + IssuesEventPinned IssuesEventAction = "pinned" + IssuesEventUnpinned IssuesEventAction = "unpinned" + IssuesEventClosed IssuesEventAction = "closed" + IssuesEventReopened IssuesEventAction = "reopened" + IssuesEventAssigned IssuesEventAction = "assigned" + IssuesEventUnassigned IssuesEventAction = "unassigned" + IssuesEventUnlabeled IssuesEventAction = "labeled" + IssuesEventLocked IssuesEventAction = "locked" + IssuesEventUnlocked IssuesEventAction = "unlocked" + IssuesEventMilestoned IssuesEventAction = "milestoned" + IssuesEventDemilestoned IssuesEventAction = "demilestoned" +) + // LabelEvent is triggered when a repository's label is created, edited, or deleted. // The Webhook event name is "label" // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#label type LabelEvent struct { - // Action is the action that was performed. Possible values are: - // "created", "edited", "deleted" - Action *string `json:"action,omitempty"` - Label *Label `json:"label,omitempty"` - Changes *EditChange `json:"changes,omitempty"` + Action LabelEventAction `json:"action,omitempty"` + Label *Label `json:"label,omitempty"` + Changes *EditChange `json:"changes,omitempty"` // The following fields are only populated by Webhook events. Repo *Repository `json:"repository,omitempty"` @@ -667,15 +788,21 @@ type LabelEvent struct { Installation *Installation `json:"installation,omitempty"` } +type LabelEventAction string + +const ( + LabelEventCreated LabelEventAction = "created" + LabelEventEdited LabelEventAction = "edited" + LabelEventDeleted LabelEventAction = "deleted" +) + // MarketplacePurchaseEvent is triggered when a user purchases, cancels, or changes // their GitHub Marketplace plan. // Webhook event name "marketplace_purchase". // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#marketplace_purchase type MarketplacePurchaseEvent struct { - // Action is the action that was performed. Possible values are: - // "purchased", "cancelled", "pending_change", "pending_change_cancelled", "changed". - Action *string `json:"action,omitempty"` + Action MarketplacePurchaseEventAction `json:"action,omitempty"` // The following fields are only populated by Webhook events. EffectiveDate *Timestamp `json:"effective_date,omitempty"` @@ -689,14 +816,23 @@ type MarketplacePurchaseEvent struct { Org *Organization `json:"organization,omitempty"` } +type MarketplacePurchaseEventAction string + +const ( + MarketplacePurchaseEventPurchased MarketplacePurchaseEventAction = "purchased" + MarketplacePurchaseEventCancelled MarketplacePurchaseEventAction = "cancelled" + MarketplacePurchaseEventPendingChange MarketplacePurchaseEventAction = "pending_change" + MarketplacePurchaseEventPendingChangeCancelled MarketplacePurchaseEventAction = "pending_change_cancelled" + MarketplacePurchaseEventChanged MarketplacePurchaseEventAction = "changed" +) + // MemberEvent is triggered when a user is added as a collaborator to a repository. // The Webhook event name is "member". // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#member type MemberEvent struct { - // Action is the action that was performed. Possible value is: "added". - Action *string `json:"action,omitempty"` - Member *User `json:"member,omitempty"` + Action MemberEventAction `json:"action,omitempty"` + Member *User `json:"member,omitempty"` // The following fields are only populated by Webhook events. Repo *Repository `json:"repository,omitempty"` @@ -708,6 +844,12 @@ type MemberEvent struct { Org *Organization `json:"organization,omitempty"` } +type MemberEventAction string + +const ( + MemberEventAdded MemberEventAction = "added" +) + // MembershipEvent is triggered when a user is added or removed from a team. // The Webhook event name is "membership". // @@ -716,8 +858,8 @@ type MemberEvent struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#membership type MembershipEvent struct { - // Action is the action that was performed. Possible values are: "added", "removed". - Action *string `json:"action,omitempty"` + Action MembershipEventAction `json:"action,omitempty"` + // Scope is the scope of the membership. Possible value is: "team". Scope *string `json:"scope,omitempty"` Member *User `json:"member,omitempty"` @@ -729,6 +871,13 @@ type MembershipEvent struct { Installation *Installation `json:"installation,omitempty"` } +type MembershipEventAction string + +const ( + MembershipEventAdded MembershipEventAction = "added" + MembershipEventRemoved MembershipEventAction = "removed" +) + // MergeGroup represents the merge group in a merge queue. type MergeGroup struct { // The SHA of the merge group. @@ -749,7 +898,7 @@ type MergeGroup struct { // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#merge_group type MergeGroupEvent struct { // The action that was performed. Currently, can only be checks_requested. - Action *string `json:"action,omitempty"` + Action MergeGroupEventAction `json:"action,omitempty"` // The merge group. MergeGroup *MergeGroup `json:"merge_group,omitempty"` @@ -760,6 +909,13 @@ type MergeGroupEvent struct { Sender *User `json:"sender,omitempty"` } +type MergeGroupEventAction string + +const ( + MergeGroupEventCheckRequested MergeGroupEventAction = "checks_requested" + MergeGroupEventDestroyed MergeGroupEventAction = "destroyed" +) + // MetaEvent is triggered when the webhook that this event is configured on is deleted. // This event will only listen for changes to the particular hook the event is installed on. // Therefore, it must be selected for each hook that you'd like to receive meta events for. @@ -767,8 +923,7 @@ type MergeGroupEvent struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#meta type MetaEvent struct { - // Action is the action that was performed. Possible value is: "deleted". - Action *string `json:"action,omitempty"` + Action MetaEventAction `json:"action,omitempty"` // The ID of the modified webhook. HookID *int64 `json:"hook_id,omitempty"` // The modified webhook. @@ -783,15 +938,19 @@ type MetaEvent struct { Installation *Installation `json:"installation,omitempty"` } +type MetaEventAction string + +const ( + MetaEventDeleted MetaEventAction = "deleted" +) + // MilestoneEvent is triggered when a milestone is created, closed, opened, edited, or deleted. // The Webhook event name is "milestone". // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#milestone type MilestoneEvent struct { - // Action is the action that was performed. Possible values are: - // "created", "closed", "opened", "edited", "deleted" - Action *string `json:"action,omitempty"` - Milestone *Milestone `json:"milestone,omitempty"` + Action MilestoneEventAction `json:"action,omitempty"` + Milestone *Milestone `json:"milestone,omitempty"` // The following fields are only populated by Webhook events. Changes *EditChange `json:"changes,omitempty"` @@ -801,6 +960,16 @@ type MilestoneEvent struct { Installation *Installation `json:"installation,omitempty"` } +type MilestoneEventAction string + +const ( + MilestoneEventCreated MilestoneEventAction = "created" + MilestoneEventClosed MilestoneEventAction = "closed" + MilestoneEventOpened MilestoneEventAction = "opened" + MilestoneEventEdited MilestoneEventAction = "edited" + MilestoneEventDeleted MilestoneEventAction = "deleted" +) + // OrganizationEvent is triggered when an organization is deleted and renamed, and when a user is added, // removed, or invited to an organization. // Events of this type are not visible in timelines. These events are only used to trigger organization hooks. @@ -808,9 +977,7 @@ type MilestoneEvent struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#organization type OrganizationEvent struct { - // Action is the action that was performed. - // Possible values are: "deleted", "renamed", "member_added", "member_removed", or "member_invited". - Action *string `json:"action,omitempty"` + Action OrganizationEventAction `json:"action,omitempty"` // Invitation is the invitation for the user or email if the action is "member_invited". Invitation *Invitation `json:"invitation,omitempty"` @@ -824,22 +991,37 @@ type OrganizationEvent struct { Installation *Installation `json:"installation,omitempty"` } +type OrganizationEventAction string + +const ( + OrganizationEventDeleted OrganizationEventAction = "deleted" + OrganizationEventRenamed OrganizationEventAction = "renamed" + OrganizationEventMemberAdded OrganizationEventAction = "member_added" + OrganizationEventMemberRemoved OrganizationEventAction = "member_removed" + OrganizationEventMemberInvited OrganizationEventAction = "member_invited" +) + // OrgBlockEvent is triggered when an organization blocks or unblocks a user. // The Webhook event name is "org_block". // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#org_block type OrgBlockEvent struct { - // Action is the action that was performed. - // Can be "blocked" or "unblocked". - Action *string `json:"action,omitempty"` - BlockedUser *User `json:"blocked_user,omitempty"` - Organization *Organization `json:"organization,omitempty"` - Sender *User `json:"sender,omitempty"` + Action OrgBlockEventAction `json:"action,omitempty"` + BlockedUser *User `json:"blocked_user,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` // The following fields are only populated by Webhook events. Installation *Installation `json:"installation,omitempty"` } +type OrgBlockEventAction string + +const ( + OrgBlockEventBlocked OrgBlockEventAction = "blocked" + OrgBlockEventUnblocked OrgBlockEventAction = "unblocked" +) + // PackageEvent represents activity related to GitHub Packages. // The Webhook event name is "package". // @@ -847,18 +1029,23 @@ type OrgBlockEvent struct { // // GitHub API docs: https://developer.github.com/webhooks/event-payloads/#package type PackageEvent struct { - // Action is the action that was performed. - // Can be "published" or "updated". - Action *string `json:"action,omitempty"` - Package *Package `json:"package,omitempty"` - Repo *Repository `json:"repository,omitempty"` - Org *Organization `json:"organization,omitempty"` - Sender *User `json:"sender,omitempty"` + Action PackageEventAction `json:"action,omitempty"` + Package *Package `json:"package,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` // The following fields are only populated by Webhook events. Installation *Installation `json:"installation,omitempty"` } +type PackageEventAction string + +const ( + PackageEventPublished PackageEventAction = "published" + PackageEventUpdated PackageEventAction = "updated" +) + // PageBuildEvent represents an attempted build of a GitHub Pages site, whether // successful or not. // The Webhook event name is "page_build". @@ -892,13 +1079,22 @@ type PageBuildEvent struct { type PersonalAccessTokenRequestEvent struct { // Action is the action that was performed. Possible values are: // "approved", "cancelled", "created" or "denied" - Action *string `json:"action,omitempty"` - PersonalAccessTokenRequest *PersonalAccessTokenRequest `json:"personal_access_token_request,omitempty"` - Org *Organization `json:"organization,omitempty"` - Sender *User `json:"sender,omitempty"` - Installation *Installation `json:"installation,omitempty"` + Action PersonalAccessTokenRequestEventAction `json:"action,omitempty"` + PersonalAccessTokenRequest *PersonalAccessTokenRequest `json:"personal_access_token_request,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` + Installation *Installation `json:"installation,omitempty"` } +type PersonalAccessTokenRequestEventAction string + +const ( + PersonalAccessTokenRequestEventApproved PersonalAccessTokenRequestEventAction = "approved" + PersonalAccessTokenRequestEventCancelled PersonalAccessTokenRequestEventAction = "cancelled" + PersonalAccessTokenRequestEventCreated PersonalAccessTokenRequestEventAction = "created" + PersonalAccessTokenRequestEventDenied PersonalAccessTokenRequestEventAction = "denied" +) + // PersonalAccessTokenRequest contains the details of a PersonalAccessTokenRequestEvent. type PersonalAccessTokenRequest struct { // Unique identifier of the request for access via fine-grained personal @@ -978,9 +1174,9 @@ type PingEvent struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#project type ProjectEvent struct { - Action *string `json:"action,omitempty"` - Changes *ProjectChange `json:"changes,omitempty"` - Project *Project `json:"project,omitempty"` + Action ProjectEventAction `json:"action,omitempty"` + Changes *ProjectChange `json:"changes,omitempty"` + Project *Project `json:"project,omitempty"` // The following fields are only populated by Webhook events. Repo *Repository `json:"repository,omitempty"` @@ -989,15 +1185,25 @@ type ProjectEvent struct { Installation *Installation `json:"installation,omitempty"` } +type ProjectEventAction string + +const ( + ProjectEventClosed ProjectEventAction = "closed" + ProjectEventCreated ProjectEventAction = "created" + ProjectEventDeleted ProjectEventAction = "deleted" + ProjectEventEdited ProjectEventAction = "edited" + ProjectEventReopened ProjectEventAction = "reopened" +) + // ProjectCardEvent is triggered when a project card is created, updated, moved, converted to an issue, or deleted. // The webhook event name is "project_card". // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#project_card type ProjectCardEvent struct { - Action *string `json:"action,omitempty"` - Changes *ProjectCardChange `json:"changes,omitempty"` - AfterID *int64 `json:"after_id,omitempty"` - ProjectCard *ProjectCard `json:"project_card,omitempty"` + Action ProjectCardEventAction `json:"action,omitempty"` + Changes *ProjectCardChange `json:"changes,omitempty"` + AfterID *int64 `json:"after_id,omitempty"` + ProjectCard *ProjectCard `json:"project_card,omitempty"` // The following fields are only populated by Webhook events. Repo *Repository `json:"repository,omitempty"` @@ -1006,15 +1212,25 @@ type ProjectCardEvent struct { Installation *Installation `json:"installation,omitempty"` } +type ProjectCardEventAction string + +const ( + ProjectCardEventConverted ProjectCardEventAction = "converted" + ProjectCardEventCreated ProjectCardEventAction = "created" + ProjectCardEventDeleted ProjectCardEventAction = "deleted" + ProjectCardEventEdited ProjectCardEventAction = "edited" + ProjectCardEventMoved ProjectCardEventAction = "moved" +) + // ProjectColumnEvent is triggered when a project column is created, updated, moved, or deleted. // The webhook event name is "project_column". // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#project_column type ProjectColumnEvent struct { - Action *string `json:"action,omitempty"` - Changes *ProjectColumnChange `json:"changes,omitempty"` - AfterID *int64 `json:"after_id,omitempty"` - ProjectColumn *ProjectColumn `json:"project_column,omitempty"` + Action ProjectColumnEventAction `json:"action,omitempty"` + Changes *ProjectColumnChange `json:"changes,omitempty"` + AfterID *int64 `json:"after_id,omitempty"` + ProjectColumn *ProjectColumn `json:"project_column,omitempty"` // The following fields are only populated by Webhook events. Repo *Repository `json:"repository,omitempty"` @@ -1023,13 +1239,22 @@ type ProjectColumnEvent struct { Installation *Installation `json:"installation,omitempty"` } +type ProjectColumnEventAction string + +const ( + ProjectColumnEventCreated ProjectColumnEventAction = "created" + ProjectColumnEventDeleted ProjectColumnEventAction = "deleted" + ProjectColumnEventEdited ProjectColumnEventAction = "edited" + ProjectColumnEventMoved ProjectColumnEventAction = "moved" +) + // ProjectV2Event is triggered when there is activity relating to an organization-level project. // The Webhook event name is "projects_v2". // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2 type ProjectV2Event struct { - Action *string `json:"action,omitempty"` - ProjectsV2 *ProjectsV2 `json:"projects_v2,omitempty"` + Action ProjectV2EventAction `json:"action,omitempty"` + ProjectsV2 *ProjectsV2 `json:"projects_v2,omitempty"` // The following fields are only populated by Webhook events. Installation *Installation `json:"installation,omitempty"` @@ -1037,6 +1262,16 @@ type ProjectV2Event struct { Sender *User `json:"sender,omitempty"` } +type ProjectV2EventAction string + +const ( + ProjectV2EventClosed ProjectV2EventAction = "closed" + ProjectV2EventCreated ProjectV2EventAction = "created" + ProjectV2EventDeleted ProjectV2EventAction = "deleted" + ProjectV2EventEdited ProjectV2EventAction = "edited" + ProjectV2EventReopened ProjectV2EventAction = "reopened" +) + // ProjectsV2 represents a projects v2 project. type ProjectsV2 struct { ID *int64 `json:"id,omitempty"` @@ -1060,9 +1295,9 @@ type ProjectsV2 struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2_item type ProjectV2ItemEvent struct { - Action *string `json:"action,omitempty"` - Changes *ProjectV2ItemChange `json:"changes,omitempty"` - ProjectV2Item *ProjectV2Item `json:"projects_v2_item,omitempty"` + Action ProjectV2ItemEventAction `json:"action,omitempty"` + Changes *ProjectV2ItemChange `json:"changes,omitempty"` + ProjectV2Item *ProjectV2Item `json:"projects_v2_item,omitempty"` // The following fields are only populated by Webhook events. Installation *Installation `json:"installation,omitempty"` @@ -1070,6 +1305,18 @@ type ProjectV2ItemEvent struct { Sender *User `json:"sender,omitempty"` } +type ProjectV2ItemEventAction string + +const ( + ProjectV2ItemEventArchived ProjectV2ItemEventAction = "archived" + ProjectV2ItemEventConverted ProjectV2ItemEventAction = "converted" + ProjectV2ItemEventCreated ProjectV2ItemEventAction = "created" + ProjectV2ItemEventDeleted ProjectV2ItemEventAction = "deleted" + ProjectV2ItemEventEdited ProjectV2ItemEventAction = "edited" + ProjectV2ItemEventReordered ProjectV2ItemEventAction = "reordered" + ProjectV2ItemEventRestored ProjectV2ItemEventAction = "restored" +) + // ProjectV2ItemChange represents a project v2 item change. type ProjectV2ItemChange struct { ArchivedAt *ArchivedAt `json:"archived_at,omitempty"` @@ -1124,10 +1371,10 @@ type PullRequestEvent struct { // If the action is "closed" and the "merged" key is "true", the pull request was merged. // While webhooks are also triggered when a pull request is synchronized, Events API timelines // don't include pull request events with the "synchronize" action. - Action *string `json:"action,omitempty"` - Assignee *User `json:"assignee,omitempty"` - Number *int `json:"number,omitempty"` - PullRequest *PullRequest `json:"pull_request,omitempty"` + Action PullRequestEventAction `json:"action,omitempty"` + Assignee *User `json:"assignee,omitempty"` + Number *int `json:"number,omitempty"` + PullRequest *PullRequest `json:"pull_request,omitempty"` // The following fields are only populated by Webhook events. Changes *EditChange `json:"changes,omitempty"` @@ -1155,6 +1402,32 @@ type PullRequestEvent struct { PerformedViaGithubApp *App `json:"performed_via_github_app,omitempty"` } +type PullRequestEventAction string + +const ( + PullRequestEventAssigned PullRequestEventAction = "assigned" + PullRequestEventAutoMergeDisabled PullRequestEventAction = "auto_merge_disabled" + PullRequestEventAutoMergeEnabled PullRequestEventAction = "auto_merge_enabled" + PullRequestEventClosed PullRequestEventAction = "closed" + PullRequestEventConvertedToDraft PullRequestEventAction = "converted_to_draft" + PullRequestEventDemilestoned PullRequestEventAction = "demilestoned" + PullRequestEventDequeued PullRequestEventAction = "dequeued" + PullRequestEventEdited PullRequestEventAction = "edited" + PullRequestEventEnqueued PullRequestEventAction = "enqueued" + PullRequestEventLabeled PullRequestEventAction = "labeled" + PullRequestEventLocked PullRequestEventAction = "locked" + PullRequestEventMilestoned PullRequestEventAction = "milestoned" + PullRequestEventOpened PullRequestEventAction = "opened" + PullRequestEventReadyForReview PullRequestEventAction = "ready_for_review" + PullRequestEventReopened PullRequestEventAction = "reopened" + PullRequestEventReviewRequestRemoved PullRequestEventAction = "review_request_removed" + PullRequestEventReviewRequested PullRequestEventAction = "review_requested" + PullRequestEventSynchronize PullRequestEventAction = "synchronize" + PullRequestEventUnassigned PullRequestEventAction = "unassigned" + PullRequestEventUnlabeled PullRequestEventAction = "unlabeled" + PullRequestEventUnlocked PullRequestEventAction = "unlocked" +) + // PullRequestReviewEvent is triggered when a review is submitted on a pull // request. // The Webhook event name is "pull_request_review". @@ -1162,9 +1435,9 @@ type PullRequestEvent struct { // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review type PullRequestReviewEvent struct { // Action is always "submitted". - Action *string `json:"action,omitempty"` - Review *PullRequestReview `json:"review,omitempty"` - PullRequest *PullRequest `json:"pull_request,omitempty"` + Action PullRequestReviewEventAction `json:"action,omitempty"` + Review *PullRequestReview `json:"review,omitempty"` + PullRequest *PullRequest `json:"pull_request,omitempty"` // The following fields are only populated by Webhook events. Repo *Repository `json:"repository,omitempty"` @@ -1176,17 +1449,23 @@ type PullRequestReviewEvent struct { Organization *Organization `json:"organization,omitempty"` } +type PullRequestReviewEventAction string + +const ( + PullRequestReviewEventDismissed PullRequestReviewEventAction = "dismissed" + PullRequestReviewEventEdited PullRequestReviewEventAction = "edited" + PullRequestReviewEventSubmitted PullRequestReviewEventAction = "submitted" +) + // PullRequestReviewCommentEvent is triggered when a comment is created on a // portion of the unified diff of a pull request. // The Webhook event name is "pull_request_review_comment". // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review_comment type PullRequestReviewCommentEvent struct { - // Action is the action that was performed on the comment. - // Possible values are: "created", "edited", "deleted". - Action *string `json:"action,omitempty"` - PullRequest *PullRequest `json:"pull_request,omitempty"` - Comment *PullRequestComment `json:"comment,omitempty"` + Action PullRequestReviewCommentEventAction `json:"action,omitempty"` + PullRequest *PullRequest `json:"pull_request,omitempty"` + Comment *PullRequestComment `json:"comment,omitempty"` // The following fields are only populated by Webhook events. Changes *EditChange `json:"changes,omitempty"` @@ -1199,17 +1478,23 @@ type PullRequestReviewCommentEvent struct { Org *Organization `json:"organization,omitempty"` } +type PullRequestReviewCommentEventAction string + +const ( + PullRequestReviewCommentEventCreated PullRequestReviewCommentEventAction = "created" + PullRequestReviewCommentEventDeleted PullRequestReviewCommentEventAction = "deleted" + PullRequestReviewCommentEventEdited PullRequestReviewCommentEventAction = "edited" +) + // PullRequestReviewThreadEvent is triggered when a comment made as part of a // review of a pull request is marked resolved or unresolved. // The Webhook event name is "pull_request_review_thread". // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review_thread type PullRequestReviewThreadEvent struct { - // Action is the action that was performed on the comment. - // Possible values are: "resolved", "unresolved". - Action *string `json:"action,omitempty"` - Thread *PullRequestThread `json:"thread,omitempty"` - PullRequest *PullRequest `json:"pull_request,omitempty"` + Action PullRequestReviewThreadEventAction `json:"action,omitempty"` + Thread *PullRequestThread `json:"thread,omitempty"` + PullRequest *PullRequest `json:"pull_request,omitempty"` // The following fields are only populated by Webhook events. Repo *Repository `json:"repository,omitempty"` @@ -1221,6 +1506,13 @@ type PullRequestReviewThreadEvent struct { Org *Organization `json:"organization,omitempty"` } +type PullRequestReviewThreadEventAction string + +const ( + PullRequestReviewThreadEventResolved PullRequestReviewThreadEventAction = "resolved" + PullRequestReviewThreadEventUnresolved PullRequestReviewThreadEventAction = "unresolved" +) + // PullRequestTargetEvent is triggered when a pull request is assigned, unassigned, labeled, // unlabeled, opened, edited, closed, reopened, synchronize, ready_for_review, // locked, unlocked, a pull request review is requested, or a review request is removed. @@ -1235,10 +1527,10 @@ type PullRequestTargetEvent struct { // If the action is "closed" and the "merged" key is "true", the pull request was merged. // While webhooks are also triggered when a pull request is synchronized, Events API timelines // don't include pull request events with the "synchronize" action. - Action *string `json:"action,omitempty"` - Assignee *User `json:"assignee,omitempty"` - Number *int `json:"number,omitempty"` - PullRequest *PullRequest `json:"pull_request,omitempty"` + Action PullRequestTargetEventAction `json:"action,omitempty"` + Assignee *User `json:"assignee,omitempty"` + Number *int `json:"number,omitempty"` + PullRequest *PullRequest `json:"pull_request,omitempty"` // The following fields are only populated by Webhook events. Changes *EditChange `json:"changes,omitempty"` @@ -1266,6 +1558,28 @@ type PullRequestTargetEvent struct { PerformedViaGithubApp *App `json:"performed_via_github_app,omitempty"` } +type PullRequestTargetEventAction string + +const ( + PullRequestTargetEventAssigned PullRequestTargetEventAction = "assigned" + PullRequestTargetEventUnassigned PullRequestTargetEventAction = "unassigned" + PullRequestTargetEventLabeled PullRequestTargetEventAction = "labeled" + PullRequestTargetEventUnlabeled PullRequestTargetEventAction = "unlabeled" + PullRequestTargetEventOpened PullRequestTargetEventAction = "opened" + PullRequestTargetEventEdited PullRequestTargetEventAction = "edited" + PullRequestTargetEventClosed PullRequestTargetEventAction = "closed" + PullRequestTargetEventReopened PullRequestTargetEventAction = "reopened" + PullRequestTargetEventSynchronize PullRequestTargetEventAction = "synchronize" + PullRequestTargetEventConvertedToDraft PullRequestTargetEventAction = "converted_to_draft" + PullRequestTargetEventReadyForReview PullRequestTargetEventAction = "ready_for_review" + PullRequestTargetEventLocked PullRequestTargetEventAction = "locked" + PullRequestTargetEventUnlocked PullRequestTargetEventAction = "unlocked" + PullRequestTargetEventReviewRequested PullRequestTargetEventAction = "review_requested" + PullRequestTargetEventReviewRequestRemoved PullRequestTargetEventAction = "review_request_removed" + PullRequestTargetEventAutoMergeDisabled PullRequestTargetEventAction = "auto_merge_disabled" + PullRequestTargetEventAutoMergeEnabled PullRequestTargetEventAction = "auto_merge_enabled" +) + // PushEvent represents a git push to a GitHub repository. // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#push @@ -1379,9 +1693,7 @@ type PushEventRepoOwner struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#release type ReleaseEvent struct { - // Action is the action that was performed. Possible values are: "published", "unpublished", - // "created", "edited", "deleted", or "prereleased". - Action *string `json:"action,omitempty"` + Action ReleaseEventAction `json:"action,omitempty"` Release *RepositoryRelease `json:"release,omitempty"` // The following fields are only populated by Webhook events. @@ -1394,6 +1706,18 @@ type ReleaseEvent struct { Org *Organization `json:"organization,omitempty"` } +type ReleaseEventAction string + +const ( + ReleaseEventCreated ReleaseEventAction = "created" + ReleaseEventDeleted ReleaseEventAction = "deleted" + ReleaseEventEdited ReleaseEventAction = "edited" + ReleaseEventPrereleased ReleaseEventAction = "prereleased" + ReleaseEventPublished ReleaseEventAction = "published" + ReleaseEventReleased ReleaseEventAction = "released" + ReleaseEventUnpublished ReleaseEventAction = "unpublished" +) + // RepositoryEvent is triggered when a repository is created, archived, unarchived, // renamed, edited, transferred, made public, or made private. Organization hooks are // also triggered when a repository is deleted. @@ -1404,11 +1728,8 @@ type ReleaseEvent struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository type RepositoryEvent struct { - // Action is the action that was performed. Possible values are: "created", - // "deleted" (organization hooks only), "archived", "unarchived", "edited", "renamed", - // "transferred", "publicized", or "privatized". - Action *string `json:"action,omitempty"` - Repo *Repository `json:"repository,omitempty"` + Action RepositoryEventAction `json:"action,omitempty"` + Repo *Repository `json:"repository,omitempty"` // The following fields are only populated by Webhook events. Changes *EditChange `json:"changes,omitempty"` @@ -1417,6 +1738,20 @@ type RepositoryEvent struct { Installation *Installation `json:"installation,omitempty"` } +type RepositoryEventAction string + +const ( + RepositoryEventArchived RepositoryEventAction = "archived" + RepositoryEventCreated RepositoryEventAction = "created" + RepositoryEventDeleted RepositoryEventAction = "deleted" // Organization hooks only + RepositoryEventEdited RepositoryEventAction = "edited" + RepositoryEventPrivatized RepositoryEventAction = "privatized" + RepositoryEventPublicized RepositoryEventAction = "publicized" + RepositoryEventRenamed RepositoryEventAction = "renamed" + RepositoryEventTransferred RepositoryEventAction = "transferred" + RepositoryEventUnarchived RepositoryEventAction = "unarchived" +) + // RepositoryDispatchEvent is triggered when a client sends a POST request to the repository dispatch event endpoint. // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository_dispatch @@ -1448,8 +1783,7 @@ type RepositoryImportEvent struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository_vulnerability_alert type RepositoryVulnerabilityAlertEvent struct { - // Action is the action that was performed. Possible values are: "create", "dismiss", "resolve". - Action *string `json:"action,omitempty"` + Action RepositoryVulnerabilityAlertEventAction `json:"action,omitempty"` // The security alert of the vulnerable dependency. Alert *RepositoryVulnerabilityAlert `json:"alert,omitempty"` @@ -1468,6 +1802,15 @@ type RepositoryVulnerabilityAlertEvent struct { Org *Organization `json:"organization,omitempty"` } +type RepositoryVulnerabilityAlertEventAction string + +const ( + RepositoryVulnerabilityAlertEventCreate RepositoryVulnerabilityAlertEventAction = "create" + RepositoryVulnerabilityAlertEventDismiss RepositoryVulnerabilityAlertEventAction = "dismiss" + RepositoryVulnerabilityAlertEventReopen RepositoryVulnerabilityAlertEventAction = "reopen" + RepositoryVulnerabilityAlertEventResolve RepositoryVulnerabilityAlertEventAction = "resolve" +) + // RepositoryVulnerabilityAlert represents a repository security alert. type RepositoryVulnerabilityAlert struct { ID *int64 `json:"id,omitempty"` @@ -1489,8 +1832,7 @@ type RepositoryVulnerabilityAlert struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#secret_scanning_alert type SecretScanningAlertEvent struct { - // Action is the action that was performed. Possible values are: "created", "resolved", or "reopened". - Action *string `json:"action,omitempty"` + Action SecretScanningAlertEventAction `json:"action,omitempty"` // Alert is the secret scanning alert involved in the event. Alert *SecretScanningAlert `json:"alert,omitempty"` @@ -1504,6 +1846,16 @@ type SecretScanningAlertEvent struct { Installation *Installation `json:"installation,omitempty"` } +type SecretScanningAlertEventAction string + +const ( + SecretScanningAlertEventCreated SecretScanningAlertEventAction = "created" + SecretScanningAlertEventReopened SecretScanningAlertEventAction = "reopened" + SecretScanningAlertEventResolved SecretScanningAlertEventAction = "resolved" + SecretScanningAlertEventRevoked SecretScanningAlertEventAction = "revoked" + SecretScanningAlertEventValidated SecretScanningAlertEventAction = "validated" +) + // SecurityAndAnalysisEvent is triggered when code security and analysis features // are enabled or disabled for a repository. // @@ -1534,8 +1886,7 @@ type SecurityAndAnalysisChangeFrom struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#star type StarEvent struct { - // Action is the action that was performed. Possible values are: "created" or "deleted". - Action *string `json:"action,omitempty"` + Action StarEventAction `json:"action,omitempty"` // StarredAt is the time the star was created. It will be null for the "deleted" action. StarredAt *Timestamp `json:"starred_at,omitempty"` @@ -1547,6 +1898,13 @@ type StarEvent struct { Installation *Installation `json:"installation,omitempty"` } +type StarEventAction string + +const ( + StarEventCreated StarEventAction = "created" + StarEventDeleted StarEventAction = "deleted" +) + // StatusEvent is triggered when the status of a Git commit changes. // The Webhook event name is "status". // @@ -1586,10 +1944,10 @@ type StatusEvent struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#team type TeamEvent struct { - Action *string `json:"action,omitempty"` - Team *Team `json:"team,omitempty"` - Changes *TeamChange `json:"changes,omitempty"` - Repo *Repository `json:"repository,omitempty"` + Action TeamEventAction `json:"action,omitempty"` + Team *Team `json:"team,omitempty"` + Changes *TeamChange `json:"changes,omitempty"` + Repo *Repository `json:"repository,omitempty"` // The following fields are only populated by Webhook events. Org *Organization `json:"organization,omitempty"` @@ -1597,6 +1955,16 @@ type TeamEvent struct { Installation *Installation `json:"installation,omitempty"` } +type TeamEventAction string + +const ( + TeamEventAddedToRepository TeamEventAction = "added_to_repository" + TeamEventCreated TeamEventAction = "created" + TeamEventDeleted TeamEventAction = "deleted" + TeamEventEdited TeamEventAction = "edited" + TeamEventRemovedFromRepository TeamEventAction = "removed_from_repository" +) + // TeamAddEvent is triggered when a repository is added to a team. // The Webhook event name is "team_add". // @@ -1621,16 +1989,22 @@ type TeamAddEvent struct { // // GitHub API docs: https://developer.github.com/enterprise/v3/activity/events/types/#userevent-enterprise type UserEvent struct { - User *User `json:"user,omitempty"` - // The action performed. Possible values are: "created" or "deleted". - Action *string `json:"action,omitempty"` - Enterprise *Enterprise `json:"enterprise,omitempty"` - Sender *User `json:"sender,omitempty"` + User *User `json:"user,omitempty"` + Action UserEventAction `json:"action,omitempty"` + Enterprise *Enterprise `json:"enterprise,omitempty"` + Sender *User `json:"sender,omitempty"` // The following fields are only populated by Webhook events. Installation *Installation `json:"installation,omitempty"` } +type UserEventAction string + +const ( + UserEventCreated UserEventAction = "created" + UserEventDeleted UserEventAction = "deleted" +) + // WatchEvent is related to starring a repository, not watching. See this API // blog post for an explanation: https://developer.github.com/changes/2012-09-05-watcher-api/ // @@ -1639,8 +2013,7 @@ type UserEvent struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#watch type WatchEvent struct { - // Action is the action that was performed. Possible value is: "started". - Action *string `json:"action,omitempty"` + Action WatchEventAction `json:"action,omitempty"` // The following fields are only populated by Webhook events. Repo *Repository `json:"repository,omitempty"` @@ -1652,6 +2025,12 @@ type WatchEvent struct { Org *Organization `json:"organization,omitempty"` } +type WatchEventAction string + +const ( + WatchEventStarted WatchEventAction = "started" +) + // WorkflowDispatchEvent is triggered when someone triggers a workflow run on GitHub or // sends a POST request to the create a workflow dispatch event endpoint. // @@ -1674,7 +2053,7 @@ type WorkflowDispatchEvent struct { type WorkflowJobEvent struct { WorkflowJob *WorkflowJob `json:"workflow_job,omitempty"` - Action *string `json:"action,omitempty"` + Action WorkflowJobEventAction `json:"action,omitempty"` // The following fields are only populated by Webhook events. @@ -1686,13 +2065,22 @@ type WorkflowJobEvent struct { Installation *Installation `json:"installation,omitempty"` } +type WorkflowJobEventAction string + +const ( + WorkflowJobEventCompleted WorkflowJobEventAction = "completed" + WorkflowJobEventInProgress WorkflowJobEventAction = "in_progress" + WorkflowJobEventQueued WorkflowJobEventAction = "queued" + WorkflowJobEventWaiting WorkflowJobEventAction = "waiting" +) + // WorkflowRunEvent is triggered when a GitHub Actions workflow run is requested or completed. // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#workflow_run type WorkflowRunEvent struct { - Action *string `json:"action,omitempty"` - Workflow *Workflow `json:"workflow,omitempty"` - WorkflowRun *WorkflowRun `json:"workflow_run,omitempty"` + Action WorkflowRunEventAction `json:"action,omitempty"` + Workflow *Workflow `json:"workflow,omitempty"` + WorkflowRun *WorkflowRun `json:"workflow_run,omitempty"` // The following fields are only populated by Webhook events. Org *Organization `json:"organization,omitempty"` @@ -1701,6 +2089,15 @@ type WorkflowRunEvent struct { Installation *Installation `json:"installation,omitempty"` } +type WorkflowRunEventAction string + +const ( + WorkflowRunEventCompleted WorkflowRunEventAction = "completed" + WorkflowRunEventInProgress WorkflowJobEventAction = "in_progress" + WorkflowRunEventQueued WorkflowJobEventAction = "queued" + WorkflowRunEventWaiting WorkflowJobEventAction = "waiting" +) + // SecurityAdvisory represents the advisory object in SecurityAdvisoryEvent payload. // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory @@ -1774,8 +2171,8 @@ type FirstPatchedVersion struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory type SecurityAdvisoryEvent struct { - Action *string `json:"action,omitempty"` - SecurityAdvisory *SecurityAdvisory `json:"security_advisory,omitempty"` + Action SecurityAdvisoryEventAction `json:"action,omitempty"` + SecurityAdvisory *SecurityAdvisory `json:"security_advisory,omitempty"` // The following fields are only populated by Webhook events. Enterprise *Enterprise `json:"enterprise,omitempty"` @@ -1785,13 +2182,21 @@ type SecurityAdvisoryEvent struct { Sender *User `json:"sender,omitempty"` } +type SecurityAdvisoryEventAction string + +const ( + SecurityAdvisoryEventPublished SecurityAdvisoryEventAction = "published" + SecurityAdvisoryEventUpdated SecurityAdvisoryEventAction = "updated" + SecurityAdvisoryEventWithdrawn SecurityAdvisoryEventAction = "withdrawn" +) + // CodeScanningAlertEvent is triggered when a code scanning finds a potential vulnerability or error in your code. // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#code_scanning_alert type CodeScanningAlertEvent struct { - Action *string `json:"action,omitempty"` - Alert *Alert `json:"alert,omitempty"` - Ref *string `json:"ref,omitempty"` + Action CodeScanningAlertEventAction `json:"action,omitempty"` + Alert *Alert `json:"alert,omitempty"` + Ref *string `json:"ref,omitempty"` // CommitOID is the commit SHA of the code scanning alert CommitOID *string `json:"commit_oid,omitempty"` Repo *Repository `json:"repository,omitempty"` @@ -1800,3 +2205,14 @@ type CodeScanningAlertEvent struct { Installation *Installation `json:"installation,omitempty"` } + +type CodeScanningAlertEventAction string + +const ( + CodeScanningAlertEventAppearedInBranch CodeScanningAlertEventAction = "appeared_in_branch" + CodeScanningAlertEventClosedByUser CodeScanningAlertEventAction = "closed_by_user" + CodeScanningAlertEventCreated CodeScanningAlertEventAction = "created" + CodeScanningAlertEventFixed CodeScanningAlertEventAction = "fixed" + CodeScanningAlertEventReopened CodeScanningAlertEventAction = "reopened" + CodeScanningAlertEventReopenedByUser CodeScanningAlertEventAction = "reopened_by_user" +) diff --git a/github/event_types_test.go b/github/event_types_test.go index b00e94a34e4..29e28459920 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -611,7 +611,7 @@ func TestStarEvent_Marshal(t *testing.T) { testJSONMarshal(t, &StarEvent{}, "{}") u := &StarEvent{ - Action: String("a"), + Action: StarEventCreated, StarredAt: &Timestamp{referenceTime}, Org: &Organization{ BillingEmail: String("be"), @@ -652,7 +652,7 @@ func TestStarEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "created", "starred_at": ` + referenceTimeStr + `, "organization": { "name": "n", @@ -699,7 +699,7 @@ func TestTeamEvent_Marshal(t *testing.T) { testJSONMarshal(t, &TeamEvent{}, "{}") u := &TeamEvent{ - Action: String("a"), + Action: TeamEventCreated, Team: &Team{ ID: Int64(1), NodeID: String("n"), @@ -891,7 +891,7 @@ func TestTeamEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "created", "team": { "id": 1, "node_id": "n", @@ -1093,7 +1093,7 @@ func TestInstallationRepositoriesEvent_Marshal(t *testing.T) { testJSONMarshal(t, &InstallationRepositoriesEvent{}, "{}") u := &InstallationRepositoriesEvent{ - Action: String("a"), + Action: InstallationRepositoriesEventAdded, RepositoriesAdded: []*Repository{ { ID: Int64(1), @@ -1214,7 +1214,7 @@ func TestInstallationRepositoriesEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "added", "repositories_added": [ { "id": 1, @@ -1354,7 +1354,7 @@ func TestInstallationTargetEvent_Marshal(t *testing.T) { EventsURL: String("e"), AvatarURL: String("l"), }, - Action: String("a"), + Action: InstallationTargetEventRenamed, Changes: &InstallationChanges{ Login: &InstallationLoginChange{ From: String("p"), @@ -1517,7 +1517,7 @@ func TestInstallationTargetEvent_Marshal(t *testing.T) { "events_url": "e", "repos_url": "r" }, - "action": "a", + "action": "renamed", "changes": { "login": { "from": "p" @@ -2043,7 +2043,7 @@ func TestIssueCommentEvent_Marshal(t *testing.T) { testJSONMarshal(t, &IssueCommentEvent{}, "{}") u := &IssueCommentEvent{ - Action: String("a"), + Action: IssueCommentEventCreated, Issue: &Issue{ID: Int64(1)}, Comment: &IssueComment{ID: Int64(1)}, Changes: &EditChange{ @@ -2194,7 +2194,7 @@ func TestIssueCommentEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "created", "issue": { "id": 1 }, @@ -2359,7 +2359,7 @@ func TestIssuesEvent_Marshal(t *testing.T) { testJSONMarshal(t, &IssuesEvent{}, "{}") u := &IssuesEvent{ - Action: String("a"), + Action: IssuesEventAssigned, Issue: &Issue{ID: Int64(1)}, Assignee: &User{ Login: String("l"), @@ -2497,7 +2497,7 @@ func TestIssuesEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "assigned", "issue": { "id": 1 }, @@ -2649,7 +2649,7 @@ func TestLabelEvent_Marshal(t *testing.T) { testJSONMarshal(t, &LabelEvent{}, "{}") u := &LabelEvent{ - Action: String("a"), + Action: LabelEventCreated, Label: &Label{ID: Int64(1)}, Changes: &EditChange{ Title: &EditTitle{ @@ -2790,7 +2790,7 @@ func TestLabelEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "created", "label": { "id": 1 }, @@ -2943,7 +2943,7 @@ func TestMilestoneEvent_Marshal(t *testing.T) { testJSONMarshal(t, &MilestoneEvent{}, "{}") u := &MilestoneEvent{ - Action: String("a"), + Action: MilestoneEventCreated, Milestone: &Milestone{ID: Int64(1)}, Changes: &EditChange{ Title: &EditTitle{ @@ -3093,7 +3093,7 @@ func TestMilestoneEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "created", "milestone": { "id": 1 }, @@ -3485,7 +3485,7 @@ func TestPullRequestReviewEvent_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestReviewEvent{}, "{}") u := &PullRequestReviewEvent{ - Action: String("a"), + Action: PullRequestReviewEventDismissed, Review: &PullRequestReview{ID: Int64(1)}, PullRequest: &PullRequest{ID: Int64(1)}, Repo: &Repository{ @@ -3620,7 +3620,7 @@ func TestPullRequestReviewEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "dismissed", "review": { "id": 1 }, @@ -4343,7 +4343,7 @@ func TestMarketplacePurchaseEvent_Marshal(t *testing.T) { testJSONMarshal(t, &MarketplacePurchaseEvent{}, "{}") u := &MarketplacePurchaseEvent{ - Action: String("a"), + Action: MarketplacePurchaseEventPurchased, EffectiveDate: &Timestamp{referenceTime}, MarketplacePurchase: &MarketplacePurchase{ BillingCycle: String("bc"), @@ -4496,7 +4496,7 @@ func TestMarketplacePurchaseEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "purchased", "effective_date": ` + referenceTimeStr + `, "marketplace_purchase": { "billing_cycle": "bc", @@ -4663,7 +4663,7 @@ func TestOrganizationEvent_Marshal(t *testing.T) { testJSONMarshal(t, &OrganizationEvent{}, "{}") u := &OrganizationEvent{ - Action: String("a"), + Action: OrganizationEventDeleted, Invitation: &Invitation{ID: Int64(1)}, Membership: &Membership{ URL: String("url"), @@ -4829,7 +4829,7 @@ func TestOrganizationEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "deleted", "invitation": { "id": 1 }, @@ -5276,7 +5276,7 @@ func TestCommitCommentEvent_Marshal(t *testing.T) { Path: String("path"), Position: Int(1), }, - Action: String("a"), + Action: CommitCommentEventCreated, Repo: &Repository{ ID: Int64(1), URL: String("s"), @@ -5420,7 +5420,7 @@ func TestCommitCommentEvent_Marshal(t *testing.T) { "path": "path", "position": 1 }, - "action": "a", + "action": "created", "repository": { "id": 1, "name": "n", @@ -6015,7 +6015,7 @@ func TestDeploymentProtectionRuleEvent_Marshal(t *testing.T) { jsonMsg, _ := json.Marshal(&l) u := &DeploymentProtectionRuleEvent{ - Action: String("a"), + Action: DeploymentProtectionRuleEventRequested, Environment: String("e"), DeploymentCallbackURL: String("b"), Deployment: &Deployment{ @@ -6199,7 +6199,7 @@ func TestDeploymentProtectionRuleEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "requested", "environment": "e", "deployment_callback_url": "b", "deployment": { @@ -7488,7 +7488,7 @@ func TestPackageEvent_Marshal(t *testing.T) { testJSONMarshal(t, &PackageEvent{}, "{}") u := &PackageEvent{ - Action: String("a"), + Action: PackageEventPublished, Package: &Package{ ID: Int64(1), Name: String("n"), @@ -7547,7 +7547,7 @@ func TestPackageEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "published", "package": { "id": 1, "name": "n", @@ -7616,7 +7616,7 @@ func TestPersonalAccessTokenRequestEvent_Marshal(t *testing.T) { testJSONMarshal(t, &PersonalAccessTokenRequestEvent{}, "{}") event := &PersonalAccessTokenRequestEvent{ - Action: String("a"), + Action: PersonalAccessTokenRequestEventApproved, PersonalAccessTokenRequest: &PersonalAccessTokenRequest{ ID: Int64(1), Owner: &User{Login: String("l")}, @@ -7646,7 +7646,7 @@ func TestPersonalAccessTokenRequestEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "approved", "personal_access_token_request": { "id": 1, "owner": { @@ -8308,7 +8308,7 @@ func TestRepositoryEvent_Marshal(t *testing.T) { testJSONMarshal(t, &RepositoryEvent{}, "{}") u := &RepositoryEvent{ - Action: String("a"), + Action: RepositoryEventCreated, Repo: &Repository{ ID: Int64(1), URL: String("s"), @@ -8441,7 +8441,7 @@ func TestRepositoryEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "created", "repository": { "id": 1, "name": "n", @@ -8584,7 +8584,7 @@ func TestReleaseEvent_Marshal(t *testing.T) { testJSONMarshal(t, &ReleaseEvent{}, "{}") u := &ReleaseEvent{ - Action: String("a"), + Action: ReleaseEventCreated, Release: &RepositoryRelease{ Name: String("n"), DiscussionCategoryName: String("dcn"), @@ -8711,7 +8711,7 @@ func TestReleaseEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "created", "release": { "name": "n", "discussion_category_name": "dcn", @@ -9096,7 +9096,7 @@ func TestMemberEvent_Marshal(t *testing.T) { testJSONMarshal(t, &MemberEvent{}, "{}") u := &MemberEvent{ - Action: String("a"), + Action: MemberEventAdded, Member: &User{ Login: String("l"), ID: Int64(1), @@ -9216,7 +9216,7 @@ func TestMemberEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "added", "member": { "login": "l", "id": 1, @@ -9346,7 +9346,7 @@ func TestMembershipEvent_Marshal(t *testing.T) { testJSONMarshal(t, &MembershipEvent{}, "{}") u := &MembershipEvent{ - Action: String("a"), + Action: MembershipEventAdded, Scope: String("s"), Member: &User{ Login: String("l"), @@ -9523,7 +9523,7 @@ func TestMembershipEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "added", "scope": "s", "member": { "login": "l", @@ -9710,7 +9710,7 @@ func TestMergeGroupEvent_Marshal(t *testing.T) { testJSONMarshal(t, &MergeGroupEvent{}, "{}") u := &MergeGroupEvent{ - Action: String("a"), + Action: MergeGroupEventDestroyed, MergeGroup: &MergeGroup{ HeadSHA: String("hs"), HeadRef: String("hr"), @@ -9850,7 +9850,7 @@ func TestMergeGroupEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "destroyed", "merge_group": { "head_sha": "hs", "head_ref": "hr", @@ -10002,7 +10002,7 @@ func TestOrgBlockEvent_Marshal(t *testing.T) { testJSONMarshal(t, &OrgBlockEvent{}, "{}") u := &OrgBlockEvent{ - Action: String("a"), + Action: OrgBlockEventBlocked, BlockedUser: &User{ Login: String("l"), ID: Int64(1), @@ -10139,7 +10139,7 @@ func TestOrgBlockEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "blocked", "blocked_user": { "login": "l", "id": 1, @@ -10536,7 +10536,7 @@ func TestWorkflowRunEvent_Marshal(t *testing.T) { testJSONMarshal(t, &WorkflowRunEvent{}, "{}") u := &WorkflowRunEvent{ - Action: String("a"), + Action: WorkflowRunEventCompleted, Workflow: &Workflow{ ID: Int64(1), NodeID: String("nid"), @@ -10668,7 +10668,7 @@ func TestWorkflowRunEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "completed", "workflow": { "id": 1, "node_id": "nid", @@ -10902,7 +10902,7 @@ func TestWatchEvent_Marshal(t *testing.T) { testJSONMarshal(t, &WatchEvent{}, "{}") u := &WatchEvent{ - Action: String("a"), + Action: WatchEventStarted, Repo: &Repository{ ID: Int64(1), URL: String("s"), @@ -11013,7 +11013,7 @@ func TestWatchEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "started", "repository": { "id": 1, "name": "n", @@ -11144,7 +11144,7 @@ func TestUserEvent_Marshal(t *testing.T) { AvatarURL: String("a"), }, // The action performed. Possible values are: "created" or "deleted". - Action: String("a"), + Action: UserEventCreated, Enterprise: &Enterprise{ ID: Int(1), Slug: String("s"), @@ -11178,7 +11178,7 @@ func TestUserEvent_Marshal(t *testing.T) { "events_url": "e", "repos_url": "r" }, - "action": "a", + "action": "created", "enterprise": { "id": 1, "slug": "s", @@ -11295,7 +11295,7 @@ func TestCheckRunEvent_Marshal(t *testing.T) { }, }, }, - Action: String("a"), + Action: CheckRunEventActionCreated, Repo: &Repository{ ID: Int64(1), URL: String("s"), @@ -11517,7 +11517,7 @@ func TestCheckRunEvent_Marshal(t *testing.T) { } ] }, - "action": "a", + "action": "created", "repository": { "id": 1, "name": "n", @@ -11724,7 +11724,7 @@ func TestCheckSuiteEvent_Marshal(t *testing.T) { SHA: String("s"), }, }, - Action: String("a"), + Action: CheckSuiteEventCompleted, Repo: &Repository{ ID: Int64(1), URL: String("s"), @@ -11918,7 +11918,7 @@ func TestCheckSuiteEvent_Marshal(t *testing.T) { "sha": "s" } }, - "action": "a", + "action": "completed", "repository": { "id": 1, "name": "n", @@ -12061,7 +12061,7 @@ func TestDeployKeyEvent_Marshal(t *testing.T) { testJSONMarshal(t, &DeployKeyEvent{}, "{}") u := &DeployKeyEvent{ - Action: String("a"), + Action: DeployKeyEventCreated, Key: &Key{ ID: Int64(1), Key: String("k"), @@ -12110,7 +12110,7 @@ func TestDeployKeyEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "created", "key": { "id": 1, "key": "k", @@ -12171,7 +12171,7 @@ func TestMetaEvent_Marshal(t *testing.T) { } u := &MetaEvent{ - Action: String("a"), + Action: MetaEventDeleted, HookID: Int64(1), Hook: &Hook{ CreatedAt: &Timestamp{referenceTime}, @@ -12190,7 +12190,7 @@ func TestMetaEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "deleted", "hook_id": 1, "hook": { "created_at": ` + referenceTimeStr + `, @@ -12711,7 +12711,7 @@ func TestDependabotAlertEvent_Marshal(t *testing.T) { testJSONMarshal(t, &DependabotAlertEvent{}, "{}") e := &DependabotAlertEvent{ - Action: String("a"), + Action: DependabotAlertEventAutoDismissed, Alert: &DependabotAlert{ Number: Int(1), State: String("s"), @@ -12936,7 +12936,7 @@ func TestDependabotAlertEvent_Marshal(t *testing.T) { }, } want := `{ - "action": "a", + "action": "auto_dismissed", "alert": { "number": 1, "state": "s", @@ -13412,7 +13412,7 @@ func TestGitHubAppAuthorizationEvent_Marshal(t *testing.T) { testJSONMarshal(t, &GitHubAppAuthorizationEvent{}, "{}") u := &GitHubAppAuthorizationEvent{ - Action: String("a"), + Action: GitHubAppAuthorizationEventRevoked, Sender: &User{ Login: String("l"), ID: Int64(1), @@ -13425,7 +13425,7 @@ func TestGitHubAppAuthorizationEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "revoked", "sender": { "login": "l", "id": 1, @@ -13877,7 +13877,7 @@ func TestProjectEvent_Marshal(t *testing.T) { u := &ProjectEvent{ Project: &Project{ID: Int64(1)}, - Action: String("a"), + Action: ProjectEventClosed, Changes: &ProjectChange{ Name: &ProjectName{From: String("NameFrom")}, Body: &ProjectBody{From: String("BodyFrom")}, @@ -14014,7 +14014,7 @@ func TestProjectEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "closed", "changes": { "name": { "from": "NameFrom" @@ -14168,7 +14168,7 @@ func TestProjectCardEvent_Marshal(t *testing.T) { testJSONMarshal(t, &ProjectCardEvent{}, "{}") u := &ProjectCardEvent{ - Action: String("a"), + Action: ProjectCardEventCreated, Changes: &ProjectCardChange{ Note: &ProjectCardNote{From: String("NoteFrom")}, }, @@ -14306,7 +14306,7 @@ func TestProjectCardEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "created", "changes": { "note": { "from": "NoteFrom" @@ -14458,7 +14458,7 @@ func TestProjectColumnEvent_Marshal(t *testing.T) { testJSONMarshal(t, &ProjectColumnEvent{}, "{}") u := &ProjectColumnEvent{ - Action: String("a"), + Action: ProjectColumnEventCreated, Changes: &ProjectColumnChange{ Name: &ProjectColumnName{From: String("NameFrom")}, }, @@ -14596,7 +14596,7 @@ func TestProjectColumnEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "created", "changes": { "name": { "from": "NameFrom" @@ -14748,7 +14748,7 @@ func TestProjectV2Event_Marshal(t *testing.T) { testJSONMarshal(t, &ProjectV2Event{}, "{}") u := &ProjectV2Event{ - Action: String("a"), + Action: ProjectV2EventCreated, ProjectsV2: &ProjectsV2{ ID: Int64(1), NodeID: String("nid"), @@ -14850,7 +14850,7 @@ func TestProjectV2Event_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "created", "projects_v2": { "id": 1, "node_id": "nid", @@ -14958,7 +14958,7 @@ func TestProjectV2ItemEvent_Marshal(t *testing.T) { testJSONMarshal(t, &ProjectV2ItemEvent{}, "{}") u := &ProjectV2ItemEvent{ - Action: String("a"), + Action: ProjectV2ItemEventCreated, Changes: &ProjectV2ItemChange{ ArchivedAt: &ArchivedAt{ From: &Timestamp{referenceTime}, @@ -15045,7 +15045,7 @@ func TestProjectV2ItemEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "created", "changes": { "archived_at": { "from": ` + referenceTimeStr + `, @@ -15138,7 +15138,7 @@ func TestPullRequestEvent_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestEvent{}, "{}") u := &PullRequestEvent{ - Action: String("a"), + Action: PullRequestEventClosed, Assignee: &User{ Login: String("l"), ID: Int64(1), @@ -15320,7 +15320,7 @@ func TestPullRequestEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "closed", "assignee": { "login": "l", "id": 1, @@ -15518,7 +15518,7 @@ func TestPullRequestReviewCommentEvent_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestReviewCommentEvent{}, "{}") u := &PullRequestReviewCommentEvent{ - Action: String("a"), + Action: PullRequestReviewCommentEventCreated, PullRequest: &PullRequest{ID: Int64(1)}, Comment: &PullRequestComment{ID: Int64(1)}, Changes: &EditChange{ @@ -15647,7 +15647,7 @@ func TestPullRequestReviewCommentEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "created", "pull_request": { "id": 1 }, @@ -15790,7 +15790,7 @@ func TestPullRequestReviewThreadEvent_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestReviewThreadEvent{}, "{}") u := &PullRequestReviewThreadEvent{ - Action: String("a"), + Action: PullRequestReviewThreadEventResolved, PullRequest: &PullRequest{ID: Int64(1)}, Thread: &PullRequestThread{ Comments: []*PullRequestComment{{ID: Int64(1)}, {ID: Int64(2)}}, @@ -15905,7 +15905,7 @@ func TestPullRequestReviewThreadEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "resolved", "pull_request": { "id": 1 }, @@ -16039,7 +16039,7 @@ func TestPullRequestTargetEvent_Marshal(t *testing.T) { testJSONMarshal(t, &PullRequestTargetEvent{}, "{}") u := &PullRequestTargetEvent{ - Action: String("a"), + Action: PullRequestTargetEventOpened, Assignee: &User{ Login: String("l"), ID: Int64(1), @@ -16221,7 +16221,7 @@ func TestPullRequestTargetEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "opened", "assignee": { "login": "l", "id": 1, @@ -16419,7 +16419,7 @@ func TestRepositoryVulnerabilityAlertEvent_Marshal(t *testing.T) { testJSONMarshal(t, &RepositoryVulnerabilityAlertEvent{}, "{}") u := &RepositoryVulnerabilityAlertEvent{ - Action: String("a"), + Action: RepositoryVulnerabilityAlertEventCreate, Alert: &RepositoryVulnerabilityAlert{ ID: Int64(1), AffectedRange: String("ar"), @@ -16447,7 +16447,7 @@ func TestRepositoryVulnerabilityAlertEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "create", "alert": { "id": 1, "affected_range": "ar", @@ -16481,7 +16481,7 @@ func TestSecretScanningAlertEvent_Marshal(t *testing.T) { testJSONMarshal(t, &SecretScanningAlertEvent{}, "{}") u := &SecretScanningAlertEvent{ - Action: String("a"), + Action: SecretScanningAlertEventCreated, Alert: &SecretScanningAlert{ Number: Int(1), SecretType: String("t"), @@ -16641,7 +16641,7 @@ func TestSecretScanningAlertEvent_Marshal(t *testing.T) { } want := `{ - "action": "a", + "action": "created", "alert": { "number": 1, "secret_type": "t", @@ -16810,7 +16810,7 @@ func TestSecretScanningAlertEvent_Marshal(t *testing.T) { func TestSecurityAdvisoryEvent_Marshal(t *testing.T) { testJSONMarshal(t, &SecurityAdvisoryEvent{}, "{}") u := &SecurityAdvisoryEvent{ - Action: String("published"), + Action: SecurityAdvisoryEventPublished, SecurityAdvisory: &SecurityAdvisory{ CVSS: &AdvisoryCVSS{ Score: Float64(1.0), @@ -17531,7 +17531,7 @@ func TestCodeScanningAlertEvent_Marshal(t *testing.T) { testJSONMarshal(t, &CodeScanningAlertEvent{}, "{}") u := &CodeScanningAlertEvent{ - Action: String("reopened"), + Action: CodeScanningAlertEventReopened, Alert: &Alert{ Number: Int(10), Rule: &Rule{ diff --git a/github/github-accessors.go b/github/github-accessors.go index 57a7165f7ff..dedb3e1877c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1806,12 +1806,12 @@ func (b *BranchProtectionRule) GetUpdatedAt() Timestamp { return *b.UpdatedAt } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (b *BranchProtectionRuleEvent) GetAction() string { - if b == nil || b.Action == nil { - return "" +// GetAction returns the Action field. +func (b *BranchProtectionRuleEvent) GetAction() *BranchProtectionRuleEventAction { + if b == nil { + return nil } - return *b.Action + return b.Action } // GetChanges returns the Changes field. @@ -2078,14 +2078,6 @@ func (c *CheckRunAnnotation) GetTitle() string { return *c.Title } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (c *CheckRunEvent) GetAction() string { - if c == nil || c.Action == nil { - return "" - } - return *c.Action -} - // GetCheckRun returns the CheckRun field. func (c *CheckRunEvent) GetCheckRun() *CheckRun { if c == nil { @@ -2310,14 +2302,6 @@ func (c *CheckSuite) GetURL() string { return *c.URL } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (c *CheckSuiteEvent) GetAction() string { - if c == nil || c.Action == nil { - return "" - } - return *c.Action -} - // GetCheckSuite returns the CheckSuite field. func (c *CheckSuiteEvent) GetCheckSuite() *CheckSuite { if c == nil { @@ -2526,14 +2510,6 @@ func (c *CodeResult) GetSHA() string { return *c.SHA } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (c *CodeScanningAlertEvent) GetAction() string { - if c == nil || c.Action == nil { - return "" - } - return *c.Action -} - // GetAlert returns the Alert field. func (c *CodeScanningAlertEvent) GetAlert() *Alert { if c == nil { @@ -3334,14 +3310,6 @@ func (c *CommitAuthor) GetName() string { return *c.Name } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (c *CommitCommentEvent) GetAction() string { - if c == nil || c.Action == nil { - return "" - } - return *c.Action -} - // GetComment returns the Comment field. func (c *CommitCommentEvent) GetComment() *RepositoryComment { if c == nil { @@ -5030,14 +4998,6 @@ func (d *DependabotAlert) GetURL() string { return *d.URL } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (d *DependabotAlertEvent) GetAction() string { - if d == nil || d.Action == nil { - return "" - } - return *d.Action -} - // GetAlert returns the Alert field. func (d *DependabotAlertEvent) GetAlert() *DependabotAlert { if d == nil { @@ -5206,14 +5166,6 @@ func (d *Dependency) GetScope() string { return *d.Scope } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (d *DeployKeyEvent) GetAction() string { - if d == nil || d.Action == nil { - return "" - } - return *d.Action -} - // GetInstallation returns the Installation field. func (d *DeployKeyEvent) GetInstallation() *Installation { if d == nil { @@ -5470,14 +5422,6 @@ func (d *DeploymentEvent) GetWorkflowRun() *WorkflowRun { return d.WorkflowRun } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (d *DeploymentProtectionRuleEvent) GetAction() string { - if d == nil || d.Action == nil { - return "" - } - return *d.Action -} - // GetDeployment returns the Deployment field. func (d *DeploymentProtectionRuleEvent) GetDeployment() *Deployment { if d == nil { @@ -6150,14 +6094,6 @@ func (d *DiscussionComment) GetURL() string { return *d.URL } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (d *DiscussionCommentEvent) GetAction() string { - if d == nil || d.Action == nil { - return "" - } - return *d.Action -} - // GetComment returns the Comment field. func (d *DiscussionCommentEvent) GetComment() *CommentDiscussion { if d == nil { @@ -6206,14 +6142,6 @@ func (d *DiscussionCommentEvent) GetSender() *User { return d.Sender } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (d *DiscussionEvent) GetAction() string { - if d == nil || d.Action == nil { - return "" - } - return *d.Action -} - // GetDiscussion returns the Discussion field. func (d *DiscussionEvent) GetDiscussion() *Discussion { if d == nil { @@ -7510,14 +7438,6 @@ func (g *GistStats) GetTotalGists() int { return *g.TotalGists } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (g *GitHubAppAuthorizationEvent) GetAction() string { - if g == nil || g.Action == nil { - return "" - } - return *g.Action -} - // GetInstallation returns the Installation field. func (g *GitHubAppAuthorizationEvent) GetInstallation() *Installation { if g == nil { @@ -8878,14 +8798,6 @@ func (i *InstallationPermissions) GetWorkflows() string { return *i.Workflows } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (i *InstallationRepositoriesEvent) GetAction() string { - if i == nil || i.Action == nil { - return "" - } - return *i.Action -} - // GetInstallation returns the Installation field. func (i *InstallationRepositoriesEvent) GetInstallation() *Installation { if i == nil { @@ -8974,14 +8886,6 @@ func (i *InstallationTargetEvent) GetAccount() *User { return i.Account } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (i *InstallationTargetEvent) GetAction() string { - if i == nil || i.Action == nil { - return "" - } - return *i.Action -} - // GetChanges returns the Changes field. func (i *InstallationTargetEvent) GetChanges() *InstallationChanges { if i == nil { @@ -9494,14 +9398,6 @@ func (i *IssueComment) GetUser() *User { return i.User } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (i *IssueCommentEvent) GetAction() string { - if i == nil || i.Action == nil { - return "" - } - return *i.Action -} - // GetChanges returns the Changes field. func (i *IssueCommentEvent) GetChanges() *EditChange { if i == nil { @@ -9966,14 +9862,6 @@ func (i *IssueRequest) GetTitle() string { return *i.Title } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (i *IssuesEvent) GetAction() string { - if i == nil || i.Action == nil { - return "" - } - return *i.Action -} - // GetAssignee returns the Assignee field. func (i *IssuesEvent) GetAssignee() *User { if i == nil { @@ -10238,14 +10126,6 @@ func (l *Label) GetURL() string { return *l.URL } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (l *LabelEvent) GetAction() string { - if l == nil || l.Action == nil { - return "" - } - return *l.Action -} - // GetChanges returns the Changes field. func (l *LabelEvent) GetChanges() *EditChange { if l == nil { @@ -11142,14 +11022,6 @@ func (m *MarketplacePurchaseAccount) GetURL() string { return *m.URL } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (m *MarketplacePurchaseEvent) GetAction() string { - if m == nil || m.Action == nil { - return "" - } - return *m.Action -} - // GetEffectiveDate returns the EffectiveDate field if it's non-nil, zero value otherwise. func (m *MarketplacePurchaseEvent) GetEffectiveDate() Timestamp { if m == nil || m.EffectiveDate == nil { @@ -11206,14 +11078,6 @@ func (m *Match) GetText() string { return *m.Text } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (m *MemberEvent) GetAction() string { - if m == nil || m.Action == nil { - return "" - } - return *m.Action -} - // GetInstallation returns the Installation field. func (m *MemberEvent) GetInstallation() *Installation { if m == nil { @@ -11302,14 +11166,6 @@ func (m *Membership) GetUser() *User { return m.User } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (m *MembershipEvent) GetAction() string { - if m == nil || m.Action == nil { - return "" - } - return *m.Action -} - // GetInstallation returns the Installation field. func (m *MembershipEvent) GetInstallation() *Installation { if m == nil { @@ -11398,14 +11254,6 @@ func (m *MergeGroup) GetHeadSHA() string { return *m.HeadSHA } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (m *MergeGroupEvent) GetAction() string { - if m == nil || m.Action == nil { - return "" - } - return *m.Action -} - // GetInstallation returns the Installation field. func (m *MergeGroupEvent) GetInstallation() *Installation { if m == nil { @@ -11454,14 +11302,6 @@ func (m *Message) GetText() string { return *m.Text } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (m *MetaEvent) GetAction() string { - if m == nil || m.Action == nil { - return "" - } - return *m.Action -} - // GetHook returns the Hook field. func (m *MetaEvent) GetHook() *Hook { if m == nil { @@ -11750,14 +11590,6 @@ func (m *Milestone) GetURL() string { return *m.URL } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (m *MilestoneEvent) GetAction() string { - if m == nil || m.Action == nil { - return "" - } - return *m.Action -} - // GetChanges returns the Changes field. func (m *MilestoneEvent) GetChanges() *EditChange { if m == nil { @@ -12598,14 +12430,6 @@ func (o *OrganizationCustomRepoRoles) GetTotalCount() int { return *o.TotalCount } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (o *OrganizationEvent) GetAction() string { - if o == nil || o.Action == nil { - return "" - } - return *o.Action -} - // GetInstallation returns the Installation field. func (o *OrganizationEvent) GetInstallation() *Installation { if o == nil { @@ -12654,14 +12478,6 @@ func (o *OrganizationInstallations) GetTotalCount() int { return *o.TotalCount } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (o *OrgBlockEvent) GetAction() string { - if o == nil || o.Action == nil { - return "" - } - return *o.Action -} - // GetBlockedUser returns the BlockedUser field. func (o *OrgBlockEvent) GetBlockedUser() *User { if o == nil { @@ -12934,14 +12750,6 @@ func (p *Package) GetVisibility() string { return *p.Visibility } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *PackageEvent) GetAction() string { - if p == nil || p.Action == nil { - return "" - } - return *p.Action -} - // GetInstallation returns the Installation field. func (p *PackageEvent) GetInstallation() *Installation { if p == nil { @@ -14110,14 +13918,6 @@ func (p *PersonalAccessTokenRequest) GetTokenLastUsedAt() Timestamp { return *p.TokenLastUsedAt } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *PersonalAccessTokenRequestEvent) GetAction() string { - if p == nil || p.Action == nil { - return "" - } - return *p.Action -} - // GetInstallation returns the Installation field. func (p *PersonalAccessTokenRequestEvent) GetInstallation() *Installation { if p == nil { @@ -14614,14 +14414,6 @@ func (p *ProjectCardChange) GetNote() *ProjectCardNote { return p.Note } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *ProjectCardEvent) GetAction() string { - if p == nil || p.Action == nil { - return "" - } - return *p.Action -} - // GetAfterID returns the AfterID field if it's non-nil, zero value otherwise. func (p *ProjectCardEvent) GetAfterID() int64 { if p == nil || p.AfterID == nil { @@ -14798,14 +14590,6 @@ func (p *ProjectColumnChange) GetName() *ProjectColumnName { return p.Name } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *ProjectColumnEvent) GetAction() string { - if p == nil || p.Action == nil { - return "" - } - return *p.Action -} - // GetAfterID returns the AfterID field if it's non-nil, zero value otherwise. func (p *ProjectColumnEvent) GetAfterID() int64 { if p == nil || p.AfterID == nil { @@ -14870,14 +14654,6 @@ func (p *ProjectColumnName) GetFrom() string { return *p.From } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *ProjectEvent) GetAction() string { - if p == nil || p.Action == nil { - return "" - } - return *p.Action -} - // GetChanges returns the Changes field. func (p *ProjectEvent) GetChanges() *ProjectChange { if p == nil { @@ -15102,14 +14878,6 @@ func (p *ProjectsV2) GetUpdatedAt() Timestamp { return *p.UpdatedAt } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *ProjectV2Event) GetAction() string { - if p == nil || p.Action == nil { - return "" - } - return *p.Action -} - // GetInstallation returns the Installation field. func (p *ProjectV2Event) GetInstallation() *Installation { if p == nil { @@ -15222,14 +14990,6 @@ func (p *ProjectV2ItemChange) GetArchivedAt() *ArchivedAt { return p.ArchivedAt } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *ProjectV2ItemEvent) GetAction() string { - if p == nil || p.Action == nil { - return "" - } - return *p.Action -} - // GetChanges returns the Changes field. func (p *ProjectV2ItemEvent) GetChanges() *ProjectV2ItemChange { if p == nil { @@ -16318,14 +16078,6 @@ func (p *PullRequestComment) GetUser() *User { return p.User } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *PullRequestEvent) GetAction() string { - if p == nil || p.Action == nil { - return "" - } - return *p.Action -} - // GetAfter returns the After field if it's non-nil, zero value otherwise. func (p *PullRequestEvent) GetAfter() string { if p == nil || p.After == nil { @@ -16582,14 +16334,6 @@ func (p *PullRequestReview) GetUser() *User { return p.User } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *PullRequestReviewCommentEvent) GetAction() string { - if p == nil || p.Action == nil { - return "" - } - return *p.Action -} - // GetChanges returns the Changes field. func (p *PullRequestReviewCommentEvent) GetChanges() *EditChange { if p == nil { @@ -16654,14 +16398,6 @@ func (p *PullRequestReviewDismissalRequest) GetMessage() string { return *p.Message } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *PullRequestReviewEvent) GetAction() string { - if p == nil || p.Action == nil { - return "" - } - return *p.Action -} - // GetInstallation returns the Installation field. func (p *PullRequestReviewEvent) GetInstallation() *Installation { if p == nil { @@ -16830,14 +16566,6 @@ func (p *PullRequestReviewsEnforcementUpdate) GetRequireLastPushApproval() bool return *p.RequireLastPushApproval } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *PullRequestReviewThreadEvent) GetAction() string { - if p == nil || p.Action == nil { - return "" - } - return *p.Action -} - // GetInstallation returns the Installation field. func (p *PullRequestReviewThreadEvent) GetInstallation() *Installation { if p == nil { @@ -16886,14 +16614,6 @@ func (p *PullRequestReviewThreadEvent) GetThread() *PullRequestThread { return p.Thread } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *PullRequestTargetEvent) GetAction() string { - if p == nil || p.Action == nil { - return "" - } - return *p.Action -} - // GetAfter returns the After field if it's non-nil, zero value otherwise. func (p *PullRequestTargetEvent) GetAfter() string { if p == nil || p.After == nil { @@ -17926,14 +17646,6 @@ func (r *ReleaseAsset) GetURL() string { return *r.URL } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (r *ReleaseEvent) GetAction() string { - if r == nil || r.Action == nil { - return "" - } - return *r.Action -} - // GetInstallation returns the Installation field. func (r *ReleaseEvent) GetInstallation() *Installation { if r == nil { @@ -19486,14 +19198,6 @@ func (r *RepositoryDispatchEvent) GetSender() *User { return r.Sender } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (r *RepositoryEvent) GetAction() string { - if r == nil || r.Action == nil { - return "" - } - return *r.Action -} - // GetChanges returns the Changes field. func (r *RepositoryEvent) GetChanges() *EditChange { if r == nil { @@ -20062,14 +19766,6 @@ func (r *RepositoryVulnerabilityAlert) GetSeverity() string { return *r.Severity } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (r *RepositoryVulnerabilityAlertEvent) GetAction() string { - if r == nil || r.Action == nil { - return "" - } - return *r.Action -} - // GetAlert returns the Alert field. func (r *RepositoryVulnerabilityAlertEvent) GetAlert() *RepositoryVulnerabilityAlert { if r == nil { @@ -21278,14 +20974,6 @@ func (s *SecretScanningAlert) GetURL() string { return *s.URL } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (s *SecretScanningAlertEvent) GetAction() string { - if s == nil || s.Action == nil { - return "" - } - return *s.Action -} - // GetAlert returns the Alert field. func (s *SecretScanningAlertEvent) GetAlert() *SecretScanningAlert { if s == nil { @@ -21590,14 +21278,6 @@ func (s *SecurityAdvisory) GetWithdrawnAt() Timestamp { return *s.WithdrawnAt } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (s *SecurityAdvisoryEvent) GetAction() string { - if s == nil || s.Action == nil { - return "" - } - return *s.Action -} - // GetEnterprise returns the Enterprise field. func (s *SecurityAdvisoryEvent) GetEnterprise() *Enterprise { if s == nil { @@ -21950,14 +21630,6 @@ func (s *SSHSigningKey) GetTitle() string { return *s.Title } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (s *StarEvent) GetAction() string { - if s == nil || s.Action == nil { - return "" - } - return *s.Action -} - // GetInstallation returns the Installation field. func (s *StarEvent) GetInstallation() *Installation { if s == nil { @@ -22686,14 +22358,6 @@ func (t *TeamDiscussion) GetURL() string { return *t.URL } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (t *TeamEvent) GetAction() string { - if t == nil || t.Action == nil { - return "" - } - return *t.Action -} - // GetChanges returns the Changes field. func (t *TeamEvent) GetChanges() *TeamChange { if t == nil { @@ -24102,14 +23766,6 @@ func (u *UserEmail) GetVisibility() string { return *u.Visibility } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (u *UserEvent) GetAction() string { - if u == nil || u.Action == nil { - return "" - } - return *u.Action -} - // GetEnterprise returns the Enterprise field. func (u *UserEvent) GetEnterprise() *Enterprise { if u == nil { @@ -24406,14 +24062,6 @@ func (v *VulnerabilityPackage) GetName() string { return *v.Name } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (w *WatchEvent) GetAction() string { - if w == nil || w.Action == nil { - return "" - } - return *w.Action -} - // GetInstallation returns the Installation field. func (w *WatchEvent) GetInstallation() *Installation { if w == nil { @@ -24798,14 +24446,6 @@ func (w *WorkflowJob) GetWorkflowName() string { return *w.WorkflowName } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (w *WorkflowJobEvent) GetAction() string { - if w == nil || w.Action == nil { - return "" - } - return *w.Action -} - // GetInstallation returns the Installation field. func (w *WorkflowJobEvent) GetInstallation() *Installation { if w == nil { @@ -25126,14 +24766,6 @@ func (w *WorkflowRunBill) GetTotalMS() int64 { return *w.TotalMS } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (w *WorkflowRunEvent) GetAction() string { - if w == nil || w.Action == nil { - return "" - } - return *w.Action -} - // GetInstallation returns the Installation field. func (w *WorkflowRunEvent) GetInstallation() *Installation { if w == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index bbf9fb8422c..60a6c068b50 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -2166,10 +2166,7 @@ func TestBranchProtectionRule_GetUpdatedAt(tt *testing.T) { } func TestBranchProtectionRuleEvent_GetAction(tt *testing.T) { - var zeroValue string - b := &BranchProtectionRuleEvent{Action: &zeroValue} - b.GetAction() - b = &BranchProtectionRuleEvent{} + b := &BranchProtectionRuleEvent{} b.GetAction() b = nil b.GetAction() @@ -2478,16 +2475,6 @@ func TestCheckRunAnnotation_GetTitle(tt *testing.T) { c.GetTitle() } -func TestCheckRunEvent_GetAction(tt *testing.T) { - var zeroValue string - c := &CheckRunEvent{Action: &zeroValue} - c.GetAction() - c = &CheckRunEvent{} - c.GetAction() - c = nil - c.GetAction() -} - func TestCheckRunEvent_GetCheckRun(tt *testing.T) { c := &CheckRunEvent{} c.GetCheckRun() @@ -2741,16 +2728,6 @@ func TestCheckSuite_GetURL(tt *testing.T) { c.GetURL() } -func TestCheckSuiteEvent_GetAction(tt *testing.T) { - var zeroValue string - c := &CheckSuiteEvent{Action: &zeroValue} - c.GetAction() - c = &CheckSuiteEvent{} - c.GetAction() - c = nil - c.GetAction() -} - func TestCheckSuiteEvent_GetCheckSuite(tt *testing.T) { c := &CheckSuiteEvent{} c.GetCheckSuite() @@ -2984,16 +2961,6 @@ func TestCodeResult_GetSHA(tt *testing.T) { c.GetSHA() } -func TestCodeScanningAlertEvent_GetAction(tt *testing.T) { - var zeroValue string - c := &CodeScanningAlertEvent{Action: &zeroValue} - c.GetAction() - c = &CodeScanningAlertEvent{} - c.GetAction() - c = nil - c.GetAction() -} - func TestCodeScanningAlertEvent_GetAlert(tt *testing.T) { c := &CodeScanningAlertEvent{} c.GetAlert() @@ -3931,16 +3898,6 @@ func TestCommitAuthor_GetName(tt *testing.T) { c.GetName() } -func TestCommitCommentEvent_GetAction(tt *testing.T) { - var zeroValue string - c := &CommitCommentEvent{Action: &zeroValue} - c.GetAction() - c = &CommitCommentEvent{} - c.GetAction() - c = nil - c.GetAction() -} - func TestCommitCommentEvent_GetComment(tt *testing.T) { c := &CommitCommentEvent{} c.GetComment() @@ -5916,16 +5873,6 @@ func TestDependabotAlert_GetURL(tt *testing.T) { d.GetURL() } -func TestDependabotAlertEvent_GetAction(tt *testing.T) { - var zeroValue string - d := &DependabotAlertEvent{Action: &zeroValue} - d.GetAction() - d = &DependabotAlertEvent{} - d.GetAction() - d = nil - d.GetAction() -} - func TestDependabotAlertEvent_GetAlert(tt *testing.T) { d := &DependabotAlertEvent{} d.GetAlert() @@ -6112,16 +6059,6 @@ func TestDependency_GetScope(tt *testing.T) { d.GetScope() } -func TestDeployKeyEvent_GetAction(tt *testing.T) { - var zeroValue string - d := &DeployKeyEvent{Action: &zeroValue} - d.GetAction() - d = &DeployKeyEvent{} - d.GetAction() - d = nil - d.GetAction() -} - func TestDeployKeyEvent_GetInstallation(tt *testing.T) { d := &DeployKeyEvent{} d.GetInstallation() @@ -6403,16 +6340,6 @@ func TestDeploymentEvent_GetWorkflowRun(tt *testing.T) { d.GetWorkflowRun() } -func TestDeploymentProtectionRuleEvent_GetAction(tt *testing.T) { - var zeroValue string - d := &DeploymentProtectionRuleEvent{Action: &zeroValue} - d.GetAction() - d = &DeploymentProtectionRuleEvent{} - d.GetAction() - d = nil - d.GetAction() -} - func TestDeploymentProtectionRuleEvent_GetDeployment(tt *testing.T) { d := &DeploymentProtectionRuleEvent{} d.GetDeployment() @@ -7205,16 +7132,6 @@ func TestDiscussionComment_GetURL(tt *testing.T) { d.GetURL() } -func TestDiscussionCommentEvent_GetAction(tt *testing.T) { - var zeroValue string - d := &DiscussionCommentEvent{Action: &zeroValue} - d.GetAction() - d = &DiscussionCommentEvent{} - d.GetAction() - d = nil - d.GetAction() -} - func TestDiscussionCommentEvent_GetComment(tt *testing.T) { d := &DiscussionCommentEvent{} d.GetComment() @@ -7257,16 +7174,6 @@ func TestDiscussionCommentEvent_GetSender(tt *testing.T) { d.GetSender() } -func TestDiscussionEvent_GetAction(tt *testing.T) { - var zeroValue string - d := &DiscussionEvent{Action: &zeroValue} - d.GetAction() - d = &DiscussionEvent{} - d.GetAction() - d = nil - d.GetAction() -} - func TestDiscussionEvent_GetDiscussion(tt *testing.T) { d := &DiscussionEvent{} d.GetDiscussion() @@ -8776,16 +8683,6 @@ func TestGistStats_GetTotalGists(tt *testing.T) { g.GetTotalGists() } -func TestGitHubAppAuthorizationEvent_GetAction(tt *testing.T) { - var zeroValue string - g := &GitHubAppAuthorizationEvent{Action: &zeroValue} - g.GetAction() - g = &GitHubAppAuthorizationEvent{} - g.GetAction() - g = nil - g.GetAction() -} - func TestGitHubAppAuthorizationEvent_GetInstallation(tt *testing.T) { g := &GitHubAppAuthorizationEvent{} g.GetInstallation() @@ -10417,16 +10314,6 @@ func TestInstallationPermissions_GetWorkflows(tt *testing.T) { i.GetWorkflows() } -func TestInstallationRepositoriesEvent_GetAction(tt *testing.T) { - var zeroValue string - i := &InstallationRepositoriesEvent{Action: &zeroValue} - i.GetAction() - i = &InstallationRepositoriesEvent{} - i.GetAction() - i = nil - i.GetAction() -} - func TestInstallationRepositoriesEvent_GetInstallation(tt *testing.T) { i := &InstallationRepositoriesEvent{} i.GetInstallation() @@ -10519,16 +10406,6 @@ func TestInstallationTargetEvent_GetAccount(tt *testing.T) { i.GetAccount() } -func TestInstallationTargetEvent_GetAction(tt *testing.T) { - var zeroValue string - i := &InstallationTargetEvent{Action: &zeroValue} - i.GetAction() - i = &InstallationTargetEvent{} - i.GetAction() - i = nil - i.GetAction() -} - func TestInstallationTargetEvent_GetChanges(tt *testing.T) { i := &InstallationTargetEvent{} i.GetChanges() @@ -11115,16 +10992,6 @@ func TestIssueComment_GetUser(tt *testing.T) { i.GetUser() } -func TestIssueCommentEvent_GetAction(tt *testing.T) { - var zeroValue string - i := &IssueCommentEvent{Action: &zeroValue} - i.GetAction() - i = &IssueCommentEvent{} - i.GetAction() - i = nil - i.GetAction() -} - func TestIssueCommentEvent_GetChanges(tt *testing.T) { i := &IssueCommentEvent{} i.GetChanges() @@ -11642,16 +11509,6 @@ func TestIssueRequest_GetTitle(tt *testing.T) { i.GetTitle() } -func TestIssuesEvent_GetAction(tt *testing.T) { - var zeroValue string - i := &IssuesEvent{Action: &zeroValue} - i.GetAction() - i = &IssuesEvent{} - i.GetAction() - i = nil - i.GetAction() -} - func TestIssuesEvent_GetAssignee(tt *testing.T) { i := &IssuesEvent{} i.GetAssignee() @@ -11952,16 +11809,6 @@ func TestLabel_GetURL(tt *testing.T) { l.GetURL() } -func TestLabelEvent_GetAction(tt *testing.T) { - var zeroValue string - l := &LabelEvent{Action: &zeroValue} - l.GetAction() - l = &LabelEvent{} - l.GetAction() - l = nil - l.GetAction() -} - func TestLabelEvent_GetChanges(tt *testing.T) { l := &LabelEvent{} l.GetChanges() @@ -13046,16 +12893,6 @@ func TestMarketplacePurchaseAccount_GetURL(tt *testing.T) { m.GetURL() } -func TestMarketplacePurchaseEvent_GetAction(tt *testing.T) { - var zeroValue string - m := &MarketplacePurchaseEvent{Action: &zeroValue} - m.GetAction() - m = &MarketplacePurchaseEvent{} - m.GetAction() - m = nil - m.GetAction() -} - func TestMarketplacePurchaseEvent_GetEffectiveDate(tt *testing.T) { var zeroValue Timestamp m := &MarketplacePurchaseEvent{EffectiveDate: &zeroValue} @@ -13111,16 +12948,6 @@ func TestMatch_GetText(tt *testing.T) { m.GetText() } -func TestMemberEvent_GetAction(tt *testing.T) { - var zeroValue string - m := &MemberEvent{Action: &zeroValue} - m.GetAction() - m = &MemberEvent{} - m.GetAction() - m = nil - m.GetAction() -} - func TestMemberEvent_GetInstallation(tt *testing.T) { m := &MemberEvent{} m.GetInstallation() @@ -13210,16 +13037,6 @@ func TestMembership_GetUser(tt *testing.T) { m.GetUser() } -func TestMembershipEvent_GetAction(tt *testing.T) { - var zeroValue string - m := &MembershipEvent{Action: &zeroValue} - m.GetAction() - m = &MembershipEvent{} - m.GetAction() - m = nil - m.GetAction() -} - func TestMembershipEvent_GetInstallation(tt *testing.T) { m := &MembershipEvent{} m.GetInstallation() @@ -13312,16 +13129,6 @@ func TestMergeGroup_GetHeadSHA(tt *testing.T) { m.GetHeadSHA() } -func TestMergeGroupEvent_GetAction(tt *testing.T) { - var zeroValue string - m := &MergeGroupEvent{Action: &zeroValue} - m.GetAction() - m = &MergeGroupEvent{} - m.GetAction() - m = nil - m.GetAction() -} - func TestMergeGroupEvent_GetInstallation(tt *testing.T) { m := &MergeGroupEvent{} m.GetInstallation() @@ -13367,16 +13174,6 @@ func TestMessage_GetText(tt *testing.T) { m.GetText() } -func TestMetaEvent_GetAction(tt *testing.T) { - var zeroValue string - m := &MetaEvent{Action: &zeroValue} - m.GetAction() - m = &MetaEvent{} - m.GetAction() - m = nil - m.GetAction() -} - func TestMetaEvent_GetHook(tt *testing.T) { m := &MetaEvent{} m.GetHook() @@ -13719,16 +13516,6 @@ func TestMilestone_GetURL(tt *testing.T) { m.GetURL() } -func TestMilestoneEvent_GetAction(tt *testing.T) { - var zeroValue string - m := &MilestoneEvent{Action: &zeroValue} - m.GetAction() - m = &MilestoneEvent{} - m.GetAction() - m = nil - m.GetAction() -} - func TestMilestoneEvent_GetChanges(tt *testing.T) { m := &MilestoneEvent{} m.GetChanges() @@ -14746,16 +14533,6 @@ func TestOrganizationCustomRepoRoles_GetTotalCount(tt *testing.T) { o.GetTotalCount() } -func TestOrganizationEvent_GetAction(tt *testing.T) { - var zeroValue string - o := &OrganizationEvent{Action: &zeroValue} - o.GetAction() - o = &OrganizationEvent{} - o.GetAction() - o = nil - o.GetAction() -} - func TestOrganizationEvent_GetInstallation(tt *testing.T) { o := &OrganizationEvent{} o.GetInstallation() @@ -14801,16 +14578,6 @@ func TestOrganizationInstallations_GetTotalCount(tt *testing.T) { o.GetTotalCount() } -func TestOrgBlockEvent_GetAction(tt *testing.T) { - var zeroValue string - o := &OrgBlockEvent{Action: &zeroValue} - o.GetAction() - o = &OrgBlockEvent{} - o.GetAction() - o = nil - o.GetAction() -} - func TestOrgBlockEvent_GetBlockedUser(tt *testing.T) { o := &OrgBlockEvent{} o.GetBlockedUser() @@ -15118,16 +14885,6 @@ func TestPackage_GetVisibility(tt *testing.T) { p.GetVisibility() } -func TestPackageEvent_GetAction(tt *testing.T) { - var zeroValue string - p := &PackageEvent{Action: &zeroValue} - p.GetAction() - p = &PackageEvent{} - p.GetAction() - p = nil - p.GetAction() -} - func TestPackageEvent_GetInstallation(tt *testing.T) { p := &PackageEvent{} p.GetInstallation() @@ -16504,16 +16261,6 @@ func TestPersonalAccessTokenRequest_GetTokenLastUsedAt(tt *testing.T) { p.GetTokenLastUsedAt() } -func TestPersonalAccessTokenRequestEvent_GetAction(tt *testing.T) { - var zeroValue string - p := &PersonalAccessTokenRequestEvent{Action: &zeroValue} - p.GetAction() - p = &PersonalAccessTokenRequestEvent{} - p.GetAction() - p = nil - p.GetAction() -} - func TestPersonalAccessTokenRequestEvent_GetInstallation(tt *testing.T) { p := &PersonalAccessTokenRequestEvent{} p.GetInstallation() @@ -17074,16 +16821,6 @@ func TestProjectCardChange_GetNote(tt *testing.T) { p.GetNote() } -func TestProjectCardEvent_GetAction(tt *testing.T) { - var zeroValue string - p := &ProjectCardEvent{Action: &zeroValue} - p.GetAction() - p = &ProjectCardEvent{} - p.GetAction() - p = nil - p.GetAction() -} - func TestProjectCardEvent_GetAfterID(tt *testing.T) { var zeroValue int64 p := &ProjectCardEvent{AfterID: &zeroValue} @@ -17277,16 +17014,6 @@ func TestProjectColumnChange_GetName(tt *testing.T) { p.GetName() } -func TestProjectColumnEvent_GetAction(tt *testing.T) { - var zeroValue string - p := &ProjectColumnEvent{Action: &zeroValue} - p.GetAction() - p = &ProjectColumnEvent{} - p.GetAction() - p = nil - p.GetAction() -} - func TestProjectColumnEvent_GetAfterID(tt *testing.T) { var zeroValue int64 p := &ProjectColumnEvent{AfterID: &zeroValue} @@ -17349,16 +17076,6 @@ func TestProjectColumnName_GetFrom(tt *testing.T) { p.GetFrom() } -func TestProjectEvent_GetAction(tt *testing.T) { - var zeroValue string - p := &ProjectEvent{Action: &zeroValue} - p.GetAction() - p = &ProjectEvent{} - p.GetAction() - p = nil - p.GetAction() -} - func TestProjectEvent_GetChanges(tt *testing.T) { p := &ProjectEvent{} p.GetChanges() @@ -17609,16 +17326,6 @@ func TestProjectsV2_GetUpdatedAt(tt *testing.T) { p.GetUpdatedAt() } -func TestProjectV2Event_GetAction(tt *testing.T) { - var zeroValue string - p := &ProjectV2Event{Action: &zeroValue} - p.GetAction() - p = &ProjectV2Event{} - p.GetAction() - p = nil - p.GetAction() -} - func TestProjectV2Event_GetInstallation(tt *testing.T) { p := &ProjectV2Event{} p.GetInstallation() @@ -17741,16 +17448,6 @@ func TestProjectV2ItemChange_GetArchivedAt(tt *testing.T) { p.GetArchivedAt() } -func TestProjectV2ItemEvent_GetAction(tt *testing.T) { - var zeroValue string - p := &ProjectV2ItemEvent{Action: &zeroValue} - p.GetAction() - p = &ProjectV2ItemEvent{} - p.GetAction() - p = nil - p.GetAction() -} - func TestProjectV2ItemEvent_GetChanges(tt *testing.T) { p := &ProjectV2ItemEvent{} p.GetChanges() @@ -18955,16 +18652,6 @@ func TestPullRequestComment_GetUser(tt *testing.T) { p.GetUser() } -func TestPullRequestEvent_GetAction(tt *testing.T) { - var zeroValue string - p := &PullRequestEvent{Action: &zeroValue} - p.GetAction() - p = &PullRequestEvent{} - p.GetAction() - p = nil - p.GetAction() -} - func TestPullRequestEvent_GetAfter(tt *testing.T) { var zeroValue string p := &PullRequestEvent{After: &zeroValue} @@ -19249,16 +18936,6 @@ func TestPullRequestReview_GetUser(tt *testing.T) { p.GetUser() } -func TestPullRequestReviewCommentEvent_GetAction(tt *testing.T) { - var zeroValue string - p := &PullRequestReviewCommentEvent{Action: &zeroValue} - p.GetAction() - p = &PullRequestReviewCommentEvent{} - p.GetAction() - p = nil - p.GetAction() -} - func TestPullRequestReviewCommentEvent_GetChanges(tt *testing.T) { p := &PullRequestReviewCommentEvent{} p.GetChanges() @@ -19318,16 +18995,6 @@ func TestPullRequestReviewDismissalRequest_GetMessage(tt *testing.T) { p.GetMessage() } -func TestPullRequestReviewEvent_GetAction(tt *testing.T) { - var zeroValue string - p := &PullRequestReviewEvent{Action: &zeroValue} - p.GetAction() - p = &PullRequestReviewEvent{} - p.GetAction() - p = nil - p.GetAction() -} - func TestPullRequestReviewEvent_GetInstallation(tt *testing.T) { p := &PullRequestReviewEvent{} p.GetInstallation() @@ -19502,16 +19169,6 @@ func TestPullRequestReviewsEnforcementUpdate_GetRequireLastPushApproval(tt *test p.GetRequireLastPushApproval() } -func TestPullRequestReviewThreadEvent_GetAction(tt *testing.T) { - var zeroValue string - p := &PullRequestReviewThreadEvent{Action: &zeroValue} - p.GetAction() - p = &PullRequestReviewThreadEvent{} - p.GetAction() - p = nil - p.GetAction() -} - func TestPullRequestReviewThreadEvent_GetInstallation(tt *testing.T) { p := &PullRequestReviewThreadEvent{} p.GetInstallation() @@ -19554,16 +19211,6 @@ func TestPullRequestReviewThreadEvent_GetThread(tt *testing.T) { p.GetThread() } -func TestPullRequestTargetEvent_GetAction(tt *testing.T) { - var zeroValue string - p := &PullRequestTargetEvent{Action: &zeroValue} - p.GetAction() - p = &PullRequestTargetEvent{} - p.GetAction() - p = nil - p.GetAction() -} - func TestPullRequestTargetEvent_GetAfter(tt *testing.T) { var zeroValue string p := &PullRequestTargetEvent{After: &zeroValue} @@ -20758,16 +20405,6 @@ func TestReleaseAsset_GetURL(tt *testing.T) { r.GetURL() } -func TestReleaseEvent_GetAction(tt *testing.T) { - var zeroValue string - r := &ReleaseEvent{Action: &zeroValue} - r.GetAction() - r = &ReleaseEvent{} - r.GetAction() - r = nil - r.GetAction() -} - func TestReleaseEvent_GetInstallation(tt *testing.T) { r := &ReleaseEvent{} r.GetInstallation() @@ -22624,16 +22261,6 @@ func TestRepositoryDispatchEvent_GetSender(tt *testing.T) { r.GetSender() } -func TestRepositoryEvent_GetAction(tt *testing.T) { - var zeroValue string - r := &RepositoryEvent{Action: &zeroValue} - r.GetAction() - r = &RepositoryEvent{} - r.GetAction() - r = nil - r.GetAction() -} - func TestRepositoryEvent_GetChanges(tt *testing.T) { r := &RepositoryEvent{} r.GetChanges() @@ -23296,16 +22923,6 @@ func TestRepositoryVulnerabilityAlert_GetSeverity(tt *testing.T) { r.GetSeverity() } -func TestRepositoryVulnerabilityAlertEvent_GetAction(tt *testing.T) { - var zeroValue string - r := &RepositoryVulnerabilityAlertEvent{Action: &zeroValue} - r.GetAction() - r = &RepositoryVulnerabilityAlertEvent{} - r.GetAction() - r = nil - r.GetAction() -} - func TestRepositoryVulnerabilityAlertEvent_GetAlert(tt *testing.T) { r := &RepositoryVulnerabilityAlertEvent{} r.GetAlert() @@ -24759,16 +24376,6 @@ func TestSecretScanningAlert_GetURL(tt *testing.T) { s.GetURL() } -func TestSecretScanningAlertEvent_GetAction(tt *testing.T) { - var zeroValue string - s := &SecretScanningAlertEvent{Action: &zeroValue} - s.GetAction() - s = &SecretScanningAlertEvent{} - s.GetAction() - s = nil - s.GetAction() -} - func TestSecretScanningAlertEvent_GetAlert(tt *testing.T) { s := &SecretScanningAlertEvent{} s.GetAlert() @@ -25113,16 +24720,6 @@ func TestSecurityAdvisory_GetWithdrawnAt(tt *testing.T) { s.GetWithdrawnAt() } -func TestSecurityAdvisoryEvent_GetAction(tt *testing.T) { - var zeroValue string - s := &SecurityAdvisoryEvent{Action: &zeroValue} - s.GetAction() - s = &SecurityAdvisoryEvent{} - s.GetAction() - s = nil - s.GetAction() -} - func TestSecurityAdvisoryEvent_GetEnterprise(tt *testing.T) { s := &SecurityAdvisoryEvent{} s.GetEnterprise() @@ -25500,16 +25097,6 @@ func TestSSHSigningKey_GetTitle(tt *testing.T) { s.GetTitle() } -func TestStarEvent_GetAction(tt *testing.T) { - var zeroValue string - s := &StarEvent{Action: &zeroValue} - s.GetAction() - s = &StarEvent{} - s.GetAction() - s = nil - s.GetAction() -} - func TestStarEvent_GetInstallation(tt *testing.T) { s := &StarEvent{} s.GetInstallation() @@ -26339,16 +25926,6 @@ func TestTeamDiscussion_GetURL(tt *testing.T) { t.GetURL() } -func TestTeamEvent_GetAction(tt *testing.T) { - var zeroValue string - t := &TeamEvent{Action: &zeroValue} - t.GetAction() - t = &TeamEvent{} - t.GetAction() - t = nil - t.GetAction() -} - func TestTeamEvent_GetChanges(tt *testing.T) { t := &TeamEvent{} t.GetChanges() @@ -28028,16 +27605,6 @@ func TestUserEmail_GetVisibility(tt *testing.T) { u.GetVisibility() } -func TestUserEvent_GetAction(tt *testing.T) { - var zeroValue string - u := &UserEvent{Action: &zeroValue} - u.GetAction() - u = &UserEvent{} - u.GetAction() - u = nil - u.GetAction() -} - func TestUserEvent_GetEnterprise(tt *testing.T) { u := &UserEvent{} u.GetEnterprise() @@ -28396,16 +27963,6 @@ func TestVulnerabilityPackage_GetName(tt *testing.T) { v.GetName() } -func TestWatchEvent_GetAction(tt *testing.T) { - var zeroValue string - w := &WatchEvent{Action: &zeroValue} - w.GetAction() - w = &WatchEvent{} - w.GetAction() - w = nil - w.GetAction() -} - func TestWatchEvent_GetInstallation(tt *testing.T) { w := &WatchEvent{} w.GetInstallation() @@ -28862,16 +28419,6 @@ func TestWorkflowJob_GetWorkflowName(tt *testing.T) { w.GetWorkflowName() } -func TestWorkflowJobEvent_GetAction(tt *testing.T) { - var zeroValue string - w := &WorkflowJobEvent{Action: &zeroValue} - w.GetAction() - w = &WorkflowJobEvent{} - w.GetAction() - w = nil - w.GetAction() -} - func TestWorkflowJobEvent_GetInstallation(tt *testing.T) { w := &WorkflowJobEvent{} w.GetInstallation() @@ -29242,16 +28789,6 @@ func TestWorkflowRunBill_GetTotalMS(tt *testing.T) { w.GetTotalMS() } -func TestWorkflowRunEvent_GetAction(tt *testing.T) { - var zeroValue string - w := &WorkflowRunEvent{Action: &zeroValue} - w.GetAction() - w = &WorkflowRunEvent{} - w.GetAction() - w = nil - w.GetAction() -} - func TestWorkflowRunEvent_GetInstallation(tt *testing.T) { w := &WorkflowRunEvent{} w.GetInstallation()