github.com/google/go-github/v69@v69.2.0/github/event_types.go (about)

     1  // Copyright 2016 The go-github AUTHORS. All rights reserved.
     2  //
     3  // Use of this source code is governed by a BSD-style
     4  // license that can be found in the LICENSE file.
     5  
     6  // These event types are shared between the Events API and used as Webhook payloads.
     7  
     8  package github
     9  
    10  import "encoding/json"
    11  
    12  // RequestedAction is included in a CheckRunEvent when a user has invoked an action,
    13  // i.e. when the CheckRunEvent's Action field is "requested_action".
    14  type RequestedAction struct {
    15  	Identifier string `json:"identifier"` // The integrator reference of the action requested by the user.
    16  }
    17  
    18  // BranchProtectionRuleEvent triggered when a check suite is "created", "edited", or "deleted".
    19  // The Webhook event name is "branch_protection_rule".
    20  //
    21  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_rule
    22  type BranchProtectionRuleEvent struct {
    23  	Action       *string               `json:"action,omitempty"`
    24  	Rule         *BranchProtectionRule `json:"rule,omitempty"`
    25  	Changes      *ProtectionChanges    `json:"changes,omitempty"`
    26  	Repo         *Repository           `json:"repository,omitempty"`
    27  	Org          *Organization         `json:"organization,omitempty"`
    28  	Sender       *User                 `json:"sender,omitempty"`
    29  	Installation *Installation         `json:"installation,omitempty"`
    30  }
    31  
    32  // BranchProtectionConfigurationEvent is triggered when there is a change to branch protection configurations for a repository.
    33  // The Webhook event name is "branch_protection_configuration".
    34  //
    35  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_configuration
    36  type BranchProtectionConfigurationEvent struct {
    37  	Action       *string       `json:"action,omitempty"`
    38  	Repo         *Repository   `json:"repository,omitempty"`
    39  	Org          *Organization `json:"organization,omitempty"`
    40  	Enterprise   *Enterprise   `json:"enterprise,omitempty"`
    41  	Sender       *User         `json:"sender,omitempty"`
    42  	Installation *Installation `json:"installation,omitempty"`
    43  }
    44  
    45  // CheckRunEvent is triggered when a check run is "created", "completed", or "rerequested".
    46  // The Webhook event name is "check_run".
    47  //
    48  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#check_run
    49  type CheckRunEvent struct {
    50  	CheckRun *CheckRun `json:"check_run,omitempty"`
    51  	// The action performed. Possible values are: "created", "completed", "rerequested" or "requested_action".
    52  	Action *string `json:"action,omitempty"`
    53  
    54  	// The following fields are only populated by Webhook events.
    55  	Repo         *Repository   `json:"repository,omitempty"`
    56  	Org          *Organization `json:"organization,omitempty"`
    57  	Sender       *User         `json:"sender,omitempty"`
    58  	Installation *Installation `json:"installation,omitempty"`
    59  
    60  	// The action requested by the user. Populated when the Action is "requested_action".
    61  	RequestedAction *RequestedAction `json:"requested_action,omitempty"` //
    62  }
    63  
    64  // CheckSuiteEvent is triggered when a check suite is "completed", "requested", or "rerequested".
    65  // The Webhook event name is "check_suite".
    66  //
    67  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#check_suite
    68  type CheckSuiteEvent struct {
    69  	CheckSuite *CheckSuite `json:"check_suite,omitempty"`
    70  	// The action performed. Possible values are: "completed", "requested" or "rerequested".
    71  	Action *string `json:"action,omitempty"`
    72  
    73  	// The following fields are only populated by Webhook events.
    74  	Repo         *Repository   `json:"repository,omitempty"`
    75  	Org          *Organization `json:"organization,omitempty"`
    76  	Sender       *User         `json:"sender,omitempty"`
    77  	Installation *Installation `json:"installation,omitempty"`
    78  }
    79  
    80  // CommitCommentEvent is triggered when a commit comment is created.
    81  // The Webhook event name is "commit_comment".
    82  //
    83  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#commit_comment
    84  type CommitCommentEvent struct {
    85  	Comment *RepositoryComment `json:"comment,omitempty"`
    86  
    87  	// The following fields are only populated by Webhook events.
    88  	Action       *string       `json:"action,omitempty"`
    89  	Repo         *Repository   `json:"repository,omitempty"`
    90  	Sender       *User         `json:"sender,omitempty"`
    91  	Installation *Installation `json:"installation,omitempty"`
    92  
    93  	// The following field is only present when the webhook is triggered on
    94  	// a repository belonging to an organization.
    95  	Org *Organization `json:"organization,omitempty"`
    96  }
    97  
    98  // ContentReferenceEvent is triggered when the body or comment of an issue or
    99  // pull request includes a URL that matches a configured content reference
   100  // domain.
   101  // The Webhook event name is "content_reference".
   102  //
   103  // GitHub API docs: https://developer.github.com/webhooks/event-payloads/#content_reference
   104  type ContentReferenceEvent struct {
   105  	Action           *string           `json:"action,omitempty"`
   106  	ContentReference *ContentReference `json:"content_reference,omitempty"`
   107  	Repo             *Repository       `json:"repository,omitempty"`
   108  	Sender           *User             `json:"sender,omitempty"`
   109  	Installation     *Installation     `json:"installation,omitempty"`
   110  }
   111  
   112  // CreateEvent represents a created repository, branch, or tag.
   113  // The Webhook event name is "create".
   114  //
   115  // Note: webhooks will not receive this event for created repositories.
   116  // Additionally, webhooks will not receive this event for tags if more
   117  // than three tags are pushed at once.
   118  //
   119  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/github-event-types#createevent
   120  type CreateEvent struct {
   121  	Ref *string `json:"ref,omitempty"`
   122  	// RefType is the object that was created. Possible values are: "repository", "branch", "tag".
   123  	RefType      *string `json:"ref_type,omitempty"`
   124  	MasterBranch *string `json:"master_branch,omitempty"`
   125  	Description  *string `json:"description,omitempty"`
   126  	PusherType   *string `json:"pusher_type,omitempty"`
   127  
   128  	// The following fields are only populated by Webhook events.
   129  	Repo         *Repository   `json:"repository,omitempty"`
   130  	Org          *Organization `json:"organization,omitempty"`
   131  	Sender       *User         `json:"sender,omitempty"`
   132  	Installation *Installation `json:"installation,omitempty"`
   133  }
   134  
   135  // CustomPropertyEvent represents a created, deleted or updated custom property.
   136  // The Webhook event name is "custom_property".
   137  //
   138  // Note: this is related to custom property configuration at the enterprise or organization level.
   139  // See CustomPropertyValuesEvent for activity related to custom property values for a repository.
   140  //
   141  // GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#custom_property
   142  type CustomPropertyEvent struct {
   143  	// Action possible values are: "created", "deleted", "updated".
   144  	Action     *string         `json:"action,omitempty"`
   145  	Definition *CustomProperty `json:"definition,omitempty"`
   146  
   147  	// The following fields are only populated by Webhook events.
   148  	Enterprise   *Enterprise   `json:"enterprise,omitempty"`
   149  	Installation *Installation `json:"installation,omitempty"`
   150  	Org          *Organization `json:"organization,omitempty"`
   151  	Sender       *User         `json:"sender,omitempty"`
   152  }
   153  
   154  // CustomPropertyValuesEvent represents an update to a custom property.
   155  // The Webhook event name is "custom_property_values".
   156  //
   157  // GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#custom_property_values
   158  type CustomPropertyValuesEvent struct {
   159  	// Action possible values are: "updated".
   160  	Action            *string                `json:"action,omitempty"`
   161  	NewPropertyValues []*CustomPropertyValue `json:"new_property_values,omitempty"`
   162  	OldPropertyValues []*CustomPropertyValue `json:"old_property_values,omitempty"`
   163  
   164  	// The following fields are only populated by Webhook events.
   165  	Enterprise   *Enterprise   `json:"enterprise,omitempty"`
   166  	Installation *Installation `json:"installation,omitempty"`
   167  	Repo         *Repository   `json:"repository,omitempty"`
   168  	Org          *Organization `json:"organization,omitempty"`
   169  	Sender       *User         `json:"sender,omitempty"`
   170  }
   171  
   172  // DeleteEvent represents a deleted branch or tag.
   173  // The Webhook event name is "delete".
   174  //
   175  // Note: webhooks will not receive this event for tags if more than three tags
   176  // are deleted at once.
   177  //
   178  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/github-event-types#deleteevent
   179  type DeleteEvent struct {
   180  	Ref *string `json:"ref,omitempty"`
   181  	// RefType is the object that was deleted. Possible values are: "branch", "tag".
   182  	RefType *string `json:"ref_type,omitempty"`
   183  
   184  	// The following fields are only populated by Webhook events.
   185  	PusherType   *string       `json:"pusher_type,omitempty"`
   186  	Repo         *Repository   `json:"repository,omitempty"`
   187  	Sender       *User         `json:"sender,omitempty"`
   188  	Installation *Installation `json:"installation,omitempty"`
   189  
   190  	// The following field is only present when the webhook is triggered on
   191  	// a repository belonging to an organization.
   192  	Org *Organization `json:"organization,omitempty"`
   193  }
   194  
   195  // DependabotAlertEvent is triggered when there is activity relating to Dependabot alerts.
   196  // The Webhook event name is "dependabot_alert".
   197  //
   198  // GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#dependabot_alert
   199  type DependabotAlertEvent struct {
   200  	Action *string          `json:"action,omitempty"`
   201  	Alert  *DependabotAlert `json:"alert,omitempty"`
   202  
   203  	// The following fields are only populated by Webhook events.
   204  	Installation *Installation `json:"installation,omitempty"`
   205  	Enterprise   *Enterprise   `json:"enterprise,omitempty"`
   206  	Repo         *Repository   `json:"repository,omitempty"`
   207  	Sender       *User         `json:"sender,omitempty"`
   208  
   209  	// The following field is only present when the webhook is triggered on
   210  	// a repository belonging to an organization.
   211  	Organization *Organization `json:"organization,omitempty"`
   212  }
   213  
   214  // DeployKeyEvent is triggered when a deploy key is added or removed from a repository.
   215  // The Webhook event name is "deploy_key".
   216  //
   217  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#deploy_key
   218  type DeployKeyEvent struct {
   219  	// Action is the action that was performed. Possible values are:
   220  	// "created" or "deleted".
   221  	Action *string `json:"action,omitempty"`
   222  
   223  	// The deploy key resource.
   224  	Key *Key `json:"key,omitempty"`
   225  
   226  	// The Repository where the event occurred
   227  	Repo *Repository `json:"repository,omitempty"`
   228  
   229  	// The following field is only present when the webhook is triggered on
   230  	// a repository belonging to an organization.
   231  	Organization *Organization `json:"organization,omitempty"`
   232  
   233  	// The following fields are only populated by Webhook events.
   234  	Sender       *User         `json:"sender,omitempty"`
   235  	Installation *Installation `json:"installation,omitempty"`
   236  }
   237  
   238  // DeploymentEvent represents a deployment.
   239  // The Webhook event name is "deployment".
   240  //
   241  // Events of this type are not visible in timelines, they are only used to trigger hooks.
   242  //
   243  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#deployment
   244  type DeploymentEvent struct {
   245  	Deployment  *Deployment  `json:"deployment,omitempty"`
   246  	Repo        *Repository  `json:"repository,omitempty"`
   247  	Workflow    *Workflow    `json:"workflow,omitempty"`
   248  	WorkflowRun *WorkflowRun `json:"workflow_run,omitempty"`
   249  
   250  	// The following fields are only populated by Webhook events.
   251  	Sender       *User         `json:"sender,omitempty"`
   252  	Installation *Installation `json:"installation,omitempty"`
   253  
   254  	// The following field is only present when the webhook is triggered on
   255  	// a repository belonging to an organization.
   256  	Org *Organization `json:"organization,omitempty"`
   257  }
   258  
   259  // DeploymentProtectionRuleEvent represents a deployment protection rule event.
   260  // The Webhook event name is "deployment_protection_rule".
   261  //
   262  // GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#deployment_protection_rule
   263  type DeploymentProtectionRuleEvent struct {
   264  	Action      *string `json:"action,omitempty"`
   265  	Environment *string `json:"environment,omitempty"`
   266  	Event       *string `json:"event,omitempty"`
   267  
   268  	// The URL Github provides for a third-party to use in order to pass/fail a deployment gate
   269  	DeploymentCallbackURL *string        `json:"deployment_callback_url,omitempty"`
   270  	Deployment            *Deployment    `json:"deployment,omitempty"`
   271  	Repo                  *Repository    `json:"repository,omitempty"`
   272  	Organization          *Organization  `json:"organization,omitempty"`
   273  	PullRequests          []*PullRequest `json:"pull_requests,omitempty"`
   274  	Sender                *User          `json:"sender,omitempty"`
   275  	Installation          *Installation  `json:"installation,omitempty"`
   276  }
   277  
   278  // DeploymentReviewEvent represents a deployment review event.
   279  // The Webhook event name is "deployment_review".
   280  //
   281  // GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads?#deployment_review
   282  type DeploymentReviewEvent struct {
   283  	// The action performed. Possible values are: "requested", "approved", or "rejected".
   284  	Action *string `json:"action,omitempty"`
   285  
   286  	// The following will be populated only if requested.
   287  	Requester   *User   `json:"requester,omitempty"`
   288  	Environment *string `json:"environment,omitempty"`
   289  
   290  	// The following will be populated only if approved or rejected.
   291  	Approver        *User             `json:"approver,omitempty"`
   292  	Comment         *string           `json:"comment,omitempty"`
   293  	WorkflowJobRuns []*WorkflowJobRun `json:"workflow_job_runs,omitempty"`
   294  
   295  	Enterprise     *Enterprise         `json:"enterprise,omitempty"`
   296  	Installation   *Installation       `json:"installation,omitempty"`
   297  	Organization   *Organization       `json:"organization,omitempty"`
   298  	Repo           *Repository         `json:"repository,omitempty"`
   299  	Reviewers      []*RequiredReviewer `json:"reviewers,omitempty"`
   300  	Sender         *User               `json:"sender,omitempty"`
   301  	Since          *string             `json:"since,omitempty"`
   302  	WorkflowJobRun *WorkflowJobRun     `json:"workflow_job_run,omitempty"`
   303  	WorkflowRun    *WorkflowRun        `json:"workflow_run,omitempty"`
   304  }
   305  
   306  // WorkflowJobRun represents a workflow_job_run in a GitHub DeploymentReviewEvent.
   307  type WorkflowJobRun struct {
   308  	Conclusion  *string    `json:"conclusion,omitempty"`
   309  	CreatedAt   *Timestamp `json:"created_at,omitempty"`
   310  	Environment *string    `json:"environment,omitempty"`
   311  	HTMLURL     *string    `json:"html_url,omitempty"`
   312  	ID          *int64     `json:"id,omitempty"`
   313  	Name        *string    `json:"name,omitempty"`
   314  	Status      *string    `json:"status,omitempty"`
   315  	UpdatedAt   *Timestamp `json:"updated_at,omitempty"`
   316  }
   317  
   318  // DeploymentStatusEvent represents a deployment status.
   319  // The Webhook event name is "deployment_status".
   320  //
   321  // Events of this type are not visible in timelines, they are only used to trigger hooks.
   322  //
   323  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#deployment_status
   324  type DeploymentStatusEvent struct {
   325  	Action           *string           `json:"action,omitempty"`
   326  	Deployment       *Deployment       `json:"deployment,omitempty"`
   327  	DeploymentStatus *DeploymentStatus `json:"deployment_status,omitempty"`
   328  	Repo             *Repository       `json:"repository,omitempty"`
   329  
   330  	// The following fields are only populated by Webhook events.
   331  	Sender       *User         `json:"sender,omitempty"`
   332  	Installation *Installation `json:"installation,omitempty"`
   333  
   334  	// The following field is only present when the webhook is triggered on
   335  	// a repository belonging to an organization.
   336  	Org *Organization `json:"organization,omitempty"`
   337  }
   338  
   339  // DiscussionCommentEvent represents a webhook event for a comment on discussion.
   340  // The Webhook event name is "discussion_comment".
   341  //
   342  // GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#discussion_comment
   343  type DiscussionCommentEvent struct {
   344  	// Action is the action that was performed on the comment.
   345  	// Possible values are: "created", "edited", "deleted". ** check what all can be added
   346  	Action       *string            `json:"action,omitempty"`
   347  	Discussion   *Discussion        `json:"discussion,omitempty"`
   348  	Comment      *CommentDiscussion `json:"comment,omitempty"`
   349  	Repo         *Repository        `json:"repository,omitempty"`
   350  	Org          *Organization      `json:"organization,omitempty"`
   351  	Sender       *User              `json:"sender,omitempty"`
   352  	Installation *Installation      `json:"installation,omitempty"`
   353  }
   354  
   355  // CommentDiscussion represents a comment in a GitHub DiscussionCommentEvent.
   356  type CommentDiscussion struct {
   357  	AuthorAssociation *string    `json:"author_association,omitempty"`
   358  	Body              *string    `json:"body,omitempty"`
   359  	ChildCommentCount *int       `json:"child_comment_count,omitempty"`
   360  	CreatedAt         *Timestamp `json:"created_at,omitempty"`
   361  	DiscussionID      *int64     `json:"discussion_id,omitempty"`
   362  	HTMLURL           *string    `json:"html_url,omitempty"`
   363  	ID                *int64     `json:"id,omitempty"`
   364  	NodeID            *string    `json:"node_id,omitempty"`
   365  	ParentID          *int64     `json:"parent_id,omitempty"`
   366  	Reactions         *Reactions `json:"reactions,omitempty"`
   367  	RepositoryURL     *string    `json:"repository_url,omitempty"`
   368  	UpdatedAt         *Timestamp `json:"updated_at,omitempty"`
   369  	User              *User      `json:"user,omitempty"`
   370  }
   371  
   372  // DiscussionEvent represents a webhook event for a discussion.
   373  // The Webhook event name is "discussion".
   374  //
   375  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#discussion
   376  type DiscussionEvent struct {
   377  	// Action is the action that was performed. Possible values are:
   378  	// created, edited, deleted, pinned, unpinned, locked, unlocked,
   379  	// transferred, category_changed, answered, or unanswered.
   380  	Action       *string       `json:"action,omitempty"`
   381  	Discussion   *Discussion   `json:"discussion,omitempty"`
   382  	Repo         *Repository   `json:"repository,omitempty"`
   383  	Org          *Organization `json:"organization,omitempty"`
   384  	Sender       *User         `json:"sender,omitempty"`
   385  	Installation *Installation `json:"installation,omitempty"`
   386  }
   387  
   388  // Discussion represents a discussion in a GitHub DiscussionEvent.
   389  type Discussion struct {
   390  	RepositoryURL      *string             `json:"repository_url,omitempty"`
   391  	DiscussionCategory *DiscussionCategory `json:"category,omitempty"`
   392  	AnswerHTMLURL      *string             `json:"answer_html_url,omitempty"`
   393  	AnswerChosenAt     *Timestamp          `json:"answer_chosen_at,omitempty"`
   394  	AnswerChosenBy     *string             `json:"answer_chosen_by,omitempty"`
   395  	HTMLURL            *string             `json:"html_url,omitempty"`
   396  	ID                 *int64              `json:"id,omitempty"`
   397  	NodeID             *string             `json:"node_id,omitempty"`
   398  	Number             *int                `json:"number,omitempty"`
   399  	Title              *string             `json:"title,omitempty"`
   400  	User               *User               `json:"user,omitempty"`
   401  	State              *string             `json:"state,omitempty"`
   402  	Locked             *bool               `json:"locked,omitempty"`
   403  	Comments           *int                `json:"comments,omitempty"`
   404  	CreatedAt          *Timestamp          `json:"created_at,omitempty"`
   405  	UpdatedAt          *Timestamp          `json:"updated_at,omitempty"`
   406  	AuthorAssociation  *string             `json:"author_association,omitempty"`
   407  	ActiveLockReason   *string             `json:"active_lock_reason,omitempty"`
   408  	Body               *string             `json:"body,omitempty"`
   409  }
   410  
   411  // DiscussionCategory represents a discussion category in a GitHub DiscussionEvent.
   412  type DiscussionCategory struct {
   413  	ID           *int64     `json:"id,omitempty"`
   414  	NodeID       *string    `json:"node_id,omitempty"`
   415  	RepositoryID *int64     `json:"repository_id,omitempty"`
   416  	Emoji        *string    `json:"emoji,omitempty"`
   417  	Name         *string    `json:"name,omitempty"`
   418  	Description  *string    `json:"description,omitempty"`
   419  	CreatedAt    *Timestamp `json:"created_at,omitempty"`
   420  	UpdatedAt    *Timestamp `json:"updated_at,omitempty"`
   421  	Slug         *string    `json:"slug,omitempty"`
   422  	IsAnswerable *bool      `json:"is_answerable,omitempty"`
   423  }
   424  
   425  // ForkEvent is triggered when a user forks a repository.
   426  // The Webhook event name is "fork".
   427  //
   428  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#fork
   429  type ForkEvent struct {
   430  	// Forkee is the created repository.
   431  	Forkee *Repository `json:"forkee,omitempty"`
   432  
   433  	// The following fields are only populated by Webhook events.
   434  	Repo         *Repository   `json:"repository,omitempty"`
   435  	Sender       *User         `json:"sender,omitempty"`
   436  	Installation *Installation `json:"installation,omitempty"`
   437  }
   438  
   439  // GitHubAppAuthorizationEvent is triggered when a user's authorization for a
   440  // GitHub Application is revoked.
   441  //
   442  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#github_app_authorization
   443  type GitHubAppAuthorizationEvent struct {
   444  	// The action performed. Possible value is: "revoked".
   445  	Action *string `json:"action,omitempty"`
   446  
   447  	// The following fields are only populated by Webhook events.
   448  	Sender       *User         `json:"sender,omitempty"`
   449  	Installation *Installation `json:"installation,omitempty"`
   450  }
   451  
   452  // Page represents a single Wiki page.
   453  type Page struct {
   454  	PageName *string `json:"page_name,omitempty"`
   455  	Title    *string `json:"title,omitempty"`
   456  	Summary  *string `json:"summary,omitempty"`
   457  	Action   *string `json:"action,omitempty"`
   458  	SHA      *string `json:"sha,omitempty"`
   459  	HTMLURL  *string `json:"html_url,omitempty"`
   460  }
   461  
   462  // GollumEvent is triggered when a Wiki page is created or updated.
   463  // The Webhook event name is "gollum".
   464  //
   465  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#gollum
   466  type GollumEvent struct {
   467  	Pages []*Page `json:"pages,omitempty"`
   468  
   469  	// The following fields are only populated by Webhook events.
   470  	Repo         *Repository   `json:"repository,omitempty"`
   471  	Sender       *User         `json:"sender,omitempty"`
   472  	Installation *Installation `json:"installation,omitempty"`
   473  
   474  	// The following field is only present when the webhook is triggered on
   475  	// a repository belonging to an organization.
   476  	Org *Organization `json:"organization,omitempty"`
   477  }
   478  
   479  // EditChange represents the changes when an issue, pull request, comment,
   480  // or repository has been edited.
   481  type EditChange struct {
   482  	Title         *EditTitle         `json:"title,omitempty"`
   483  	Body          *EditBody          `json:"body,omitempty"`
   484  	Base          *EditBase          `json:"base,omitempty"`
   485  	Repo          *EditRepo          `json:"repository,omitempty"`
   486  	Owner         *EditOwner         `json:"owner,omitempty"`
   487  	DefaultBranch *EditDefaultBranch `json:"default_branch,omitempty"`
   488  	Topics        *EditTopics        `json:"topics,omitempty"`
   489  }
   490  
   491  // EditTitle represents a pull-request title change.
   492  type EditTitle struct {
   493  	From *string `json:"from,omitempty"`
   494  }
   495  
   496  // EditBody represents a change of pull-request body.
   497  type EditBody struct {
   498  	From *string `json:"from,omitempty"`
   499  }
   500  
   501  // EditBase represents the change of a pull-request base branch.
   502  type EditBase struct {
   503  	Ref *EditRef `json:"ref,omitempty"`
   504  	SHA *EditSHA `json:"sha,omitempty"`
   505  }
   506  
   507  // EditRef represents a ref change of a pull-request.
   508  type EditRef struct {
   509  	From *string `json:"from,omitempty"`
   510  }
   511  
   512  // EditRepo represents a change of repository name.
   513  type EditRepo struct {
   514  	Name *RepoName `json:"name,omitempty"`
   515  }
   516  
   517  // EditOwner represents a change of repository ownership.
   518  type EditOwner struct {
   519  	OwnerInfo *OwnerInfo `json:"from,omitempty"`
   520  }
   521  
   522  // OwnerInfo represents the account info of the owner of the repo (could be User or Organization but both are User structs).
   523  type OwnerInfo struct {
   524  	User *User `json:"user,omitempty"`
   525  	Org  *User `json:"organization,omitempty"`
   526  }
   527  
   528  // RepoName represents a change of repository name.
   529  type RepoName struct {
   530  	From *string `json:"from,omitempty"`
   531  }
   532  
   533  // EditTopics represents a change of repository topics.
   534  type EditTopics struct {
   535  	From []string `json:"from,omitempty"`
   536  }
   537  
   538  // EditSHA represents a sha change of a pull-request.
   539  type EditSHA struct {
   540  	From *string `json:"from,omitempty"`
   541  }
   542  
   543  // EditDefaultBranch represents a change of repository's default branch name.
   544  type EditDefaultBranch struct {
   545  	From *string `json:"from,omitempty"`
   546  }
   547  
   548  // ProjectChange represents the changes when a project has been edited.
   549  type ProjectChange struct {
   550  	Name *ProjectName `json:"name,omitempty"`
   551  	Body *ProjectBody `json:"body,omitempty"`
   552  }
   553  
   554  // ProjectName represents a project name change.
   555  type ProjectName struct {
   556  	From *string `json:"from,omitempty"`
   557  }
   558  
   559  // ProjectBody represents a project body change.
   560  type ProjectBody struct {
   561  	From *string `json:"from,omitempty"`
   562  }
   563  
   564  // ProjectCardChange represents the changes when a project card has been edited.
   565  type ProjectCardChange struct {
   566  	Note *ProjectCardNote `json:"note,omitempty"`
   567  }
   568  
   569  // ProjectCardNote represents a change of a note of a project card.
   570  type ProjectCardNote struct {
   571  	From *string `json:"from,omitempty"`
   572  }
   573  
   574  // ProjectColumnChange represents the changes when a project column has been edited.
   575  type ProjectColumnChange struct {
   576  	Name *ProjectColumnName `json:"name,omitempty"`
   577  }
   578  
   579  // ProjectColumnName represents a project column name change.
   580  type ProjectColumnName struct {
   581  	From *string `json:"from,omitempty"`
   582  }
   583  
   584  // TeamChange represents the changes when a team has been edited.
   585  type TeamChange struct {
   586  	Description *TeamDescription `json:"description,omitempty"`
   587  	Name        *TeamName        `json:"name,omitempty"`
   588  	Privacy     *TeamPrivacy     `json:"privacy,omitempty"`
   589  	Repository  *TeamRepository  `json:"repository,omitempty"`
   590  }
   591  
   592  // TeamDescription represents a team description change.
   593  type TeamDescription struct {
   594  	From *string `json:"from,omitempty"`
   595  }
   596  
   597  // TeamName represents a team name change.
   598  type TeamName struct {
   599  	From *string `json:"from,omitempty"`
   600  }
   601  
   602  // TeamPrivacy represents a team privacy change.
   603  type TeamPrivacy struct {
   604  	From *string `json:"from,omitempty"`
   605  }
   606  
   607  // TeamRepository represents a team repository permission change.
   608  type TeamRepository struct {
   609  	Permissions *TeamPermissions `json:"permissions,omitempty"`
   610  }
   611  
   612  // TeamPermissions represents a team permission change.
   613  type TeamPermissions struct {
   614  	From *TeamPermissionsFrom `json:"from,omitempty"`
   615  }
   616  
   617  // TeamPermissionsFrom represents a team permission change.
   618  type TeamPermissionsFrom struct {
   619  	Admin *bool `json:"admin,omitempty"`
   620  	Pull  *bool `json:"pull,omitempty"`
   621  	Push  *bool `json:"push,omitempty"`
   622  }
   623  
   624  // InstallationEvent is triggered when a GitHub App has been installed, uninstalled, suspend, unsuspended
   625  // or new permissions have been accepted.
   626  // The Webhook event name is "installation".
   627  //
   628  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#installation
   629  type InstallationEvent struct {
   630  	// The action that was performed. Can be either "created", "deleted", "suspend", "unsuspend" or "new_permissions_accepted".
   631  	Action       *string       `json:"action,omitempty"`
   632  	Repositories []*Repository `json:"repositories,omitempty"`
   633  	Sender       *User         `json:"sender,omitempty"`
   634  	Installation *Installation `json:"installation,omitempty"`
   635  	Requester    *User         `json:"requester,omitempty"`
   636  
   637  	// The following field is only present when the webhook is triggered on
   638  	// a repository belonging to an organization.
   639  	Org *Organization `json:"organization,omitempty"`
   640  }
   641  
   642  // InstallationRepositoriesEvent is triggered when a repository is added or
   643  // removed from an installation. The Webhook event name is "installation_repositories".
   644  //
   645  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#installation_repositories
   646  type InstallationRepositoriesEvent struct {
   647  	// The action that was performed. Can be either "added" or "removed".
   648  	Action              *string       `json:"action,omitempty"`
   649  	RepositoriesAdded   []*Repository `json:"repositories_added,omitempty"`
   650  	RepositoriesRemoved []*Repository `json:"repositories_removed,omitempty"`
   651  	RepositorySelection *string       `json:"repository_selection,omitempty"`
   652  	Sender              *User         `json:"sender,omitempty"`
   653  	Installation        *Installation `json:"installation,omitempty"`
   654  
   655  	// The following field is only present when the webhook is triggered on
   656  	// a repository belonging to an organization.
   657  	Org *Organization `json:"organization,omitempty"`
   658  }
   659  
   660  // InstallationLoginChange represents a change in login on an installation.
   661  type InstallationLoginChange struct {
   662  	From *string `json:"from,omitempty"`
   663  }
   664  
   665  // InstallationSlugChange represents a change in slug on an installation.
   666  type InstallationSlugChange struct {
   667  	From *string `json:"from,omitempty"`
   668  }
   669  
   670  // InstallationChanges represents a change in slug or login on an installation.
   671  type InstallationChanges struct {
   672  	Login *InstallationLoginChange `json:"login,omitempty"`
   673  	Slug  *InstallationSlugChange  `json:"slug,omitempty"`
   674  }
   675  
   676  // InstallationTargetEvent is triggered when there is activity on an installation from a user or organization account.
   677  // The Webhook event name is "installation_target".
   678  //
   679  // GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#installation_target
   680  type InstallationTargetEvent struct {
   681  	Account      *User                `json:"account,omitempty"`
   682  	Action       *string              `json:"action,omitempty"`
   683  	Changes      *InstallationChanges `json:"changes,omitempty"`
   684  	Enterprise   *Enterprise          `json:"enterprise,omitempty"`
   685  	Installation *Installation        `json:"installation,omitempty"`
   686  	Organization *Organization        `json:"organization,omitempty"`
   687  	Repository   *Repository          `json:"repository,omitempty"`
   688  	Sender       *User                `json:"sender,omitempty"`
   689  	TargetType   *string              `json:"target_type,omitempty"`
   690  }
   691  
   692  // IssueCommentEvent is triggered when an issue comment is created on an issue
   693  // or pull request.
   694  // The Webhook event name is "issue_comment".
   695  //
   696  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#issue_comment
   697  type IssueCommentEvent struct {
   698  	// Action is the action that was performed on the comment.
   699  	// Possible values are: "created", "edited", "deleted".
   700  	Action  *string       `json:"action,omitempty"`
   701  	Issue   *Issue        `json:"issue,omitempty"`
   702  	Comment *IssueComment `json:"comment,omitempty"`
   703  
   704  	// The following fields are only populated by Webhook events.
   705  	Changes      *EditChange   `json:"changes,omitempty"`
   706  	Repo         *Repository   `json:"repository,omitempty"`
   707  	Sender       *User         `json:"sender,omitempty"`
   708  	Installation *Installation `json:"installation,omitempty"`
   709  
   710  	// The following field is only present when the webhook is triggered on
   711  	// a repository belonging to an organization.
   712  	Organization *Organization `json:"organization,omitempty"`
   713  }
   714  
   715  // IssuesEvent is triggered when an issue is opened, edited, deleted, transferred,
   716  // pinned, unpinned, closed, reopened, assigned, unassigned, labeled, unlabeled,
   717  // locked, unlocked, milestoned, or demilestoned.
   718  // The Webhook event name is "issues".
   719  //
   720  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#issues
   721  type IssuesEvent struct {
   722  	// Action is the action that was performed. Possible values are: "opened",
   723  	// "edited", "deleted", "transferred", "pinned", "unpinned", "closed", "reopened",
   724  	// "assigned", "unassigned", "labeled", "unlabeled", "locked", "unlocked",
   725  	// "milestoned", or "demilestoned".
   726  	Action   *string `json:"action,omitempty"`
   727  	Issue    *Issue  `json:"issue,omitempty"`
   728  	Assignee *User   `json:"assignee,omitempty"`
   729  	Label    *Label  `json:"label,omitempty"`
   730  
   731  	// The following fields are only populated by Webhook events.
   732  	Changes      *EditChange   `json:"changes,omitempty"`
   733  	Repo         *Repository   `json:"repository,omitempty"`
   734  	Sender       *User         `json:"sender,omitempty"`
   735  	Installation *Installation `json:"installation,omitempty"`
   736  	Milestone    *Milestone    `json:"milestone,omitempty"`
   737  
   738  	// The following field is only present when the webhook is triggered on
   739  	// a repository belonging to an organization.
   740  	Org *Organization `json:"organization,omitempty"`
   741  }
   742  
   743  // LabelEvent is triggered when a repository's label is created, edited, or deleted.
   744  // The Webhook event name is "label"
   745  //
   746  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#label
   747  type LabelEvent struct {
   748  	// Action is the action that was performed. Possible values are:
   749  	// "created", "edited", "deleted"
   750  	Action  *string     `json:"action,omitempty"`
   751  	Label   *Label      `json:"label,omitempty"`
   752  	Changes *EditChange `json:"changes,omitempty"`
   753  
   754  	// The following fields are only populated by Webhook events.
   755  	Repo         *Repository   `json:"repository,omitempty"`
   756  	Org          *Organization `json:"organization,omitempty"`
   757  	Sender       *User         `json:"sender,omitempty"`
   758  	Installation *Installation `json:"installation,omitempty"`
   759  }
   760  
   761  // MarketplacePurchaseEvent is triggered when a user purchases, cancels, or changes
   762  // their GitHub Marketplace plan.
   763  // Webhook event name "marketplace_purchase".
   764  //
   765  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#marketplace_purchase
   766  type MarketplacePurchaseEvent struct {
   767  	// Action is the action that was performed. Possible values are:
   768  	// "purchased", "cancelled", "pending_change", "pending_change_cancelled", "changed".
   769  	Action *string `json:"action,omitempty"`
   770  
   771  	// The following fields are only populated by Webhook events.
   772  	EffectiveDate               *Timestamp           `json:"effective_date,omitempty"`
   773  	MarketplacePurchase         *MarketplacePurchase `json:"marketplace_purchase,omitempty"`
   774  	PreviousMarketplacePurchase *MarketplacePurchase `json:"previous_marketplace_purchase,omitempty"`
   775  	Sender                      *User                `json:"sender,omitempty"`
   776  	Installation                *Installation        `json:"installation,omitempty"`
   777  
   778  	// The following field is only present when the webhook is triggered on
   779  	// a repository belonging to an organization.
   780  	Org *Organization `json:"organization,omitempty"`
   781  }
   782  
   783  // MemberChangesPermission represents changes to a repository collaborator's permissions.
   784  type MemberChangesPermission struct {
   785  	From *string `json:"from,omitempty"`
   786  	To   *string `json:"to,omitempty"`
   787  }
   788  
   789  // MemberChangesRoleName represents changes to a repository collaborator's role.
   790  type MemberChangesRoleName struct {
   791  	From *string `json:"from,omitempty"`
   792  	To   *string `json:"to,omitempty"`
   793  }
   794  
   795  // MemberChanges represents changes to a repository collaborator's role or permission.
   796  type MemberChanges struct {
   797  	Permission *MemberChangesPermission `json:"permission,omitempty"`
   798  	RoleName   *MemberChangesRoleName   `json:"role_name,omitempty"`
   799  }
   800  
   801  // MemberEvent is triggered when a user's membership as a collaborator to a repository changes.
   802  // The Webhook event name is "member".
   803  //
   804  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#member
   805  type MemberEvent struct {
   806  	// Action is the action that was performed. Possible values are: "added", "edited", "removed".
   807  	Action  *string        `json:"action,omitempty"`
   808  	Member  *User          `json:"member,omitempty"`
   809  	Changes *MemberChanges `json:"changes,omitempty"`
   810  
   811  	// The following fields are only populated by Webhook events.
   812  	Repo         *Repository   `json:"repository,omitempty"`
   813  	Sender       *User         `json:"sender,omitempty"`
   814  	Installation *Installation `json:"installation,omitempty"`
   815  
   816  	// The following field is only present when the webhook is triggered on
   817  	// a repository belonging to an organization.
   818  	Org *Organization `json:"organization,omitempty"`
   819  }
   820  
   821  // MembershipEvent is triggered when a user is added or removed from a team.
   822  // The Webhook event name is "membership".
   823  //
   824  // Events of this type are not visible in timelines, they are only used to
   825  // trigger organization webhooks.
   826  //
   827  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#membership
   828  type MembershipEvent struct {
   829  	// Action is the action that was performed. Possible values are: "added", "removed".
   830  	Action *string `json:"action,omitempty"`
   831  	// Scope is the scope of the membership. Possible value is: "team".
   832  	Scope  *string `json:"scope,omitempty"`
   833  	Member *User   `json:"member,omitempty"`
   834  	Team   *Team   `json:"team,omitempty"`
   835  
   836  	// The following fields are only populated by Webhook events.
   837  	Org          *Organization `json:"organization,omitempty"`
   838  	Sender       *User         `json:"sender,omitempty"`
   839  	Installation *Installation `json:"installation,omitempty"`
   840  }
   841  
   842  // MergeGroup represents the merge group in a merge queue.
   843  type MergeGroup struct {
   844  	// The SHA of the merge group.
   845  	HeadSHA *string `json:"head_sha,omitempty"`
   846  	// The full ref of the merge group.
   847  	HeadRef *string `json:"head_ref,omitempty"`
   848  	// The SHA of the merge group's parent commit.
   849  	BaseSHA *string `json:"base_sha,omitempty"`
   850  	// The full ref of the branch the merge group will be merged into.
   851  	BaseRef *string `json:"base_ref,omitempty"`
   852  	// An expanded representation of the head_sha commit.
   853  	HeadCommit *Commit `json:"head_commit,omitempty"`
   854  }
   855  
   856  // MergeGroupEvent represents activity related to merge groups in a merge queue. The type of activity is specified
   857  // in the action property of the payload object.
   858  //
   859  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#merge_group
   860  type MergeGroupEvent struct {
   861  	// The action that was performed. Currently, can only be checks_requested.
   862  	Action *string `json:"action,omitempty"`
   863  	// The merge group.
   864  	MergeGroup *MergeGroup `json:"merge_group,omitempty"`
   865  
   866  	// The following fields are only populated by Webhook events.
   867  	Repo         *Repository   `json:"repository,omitempty"`
   868  	Org          *Organization `json:"organization,omitempty"`
   869  	Installation *Installation `json:"installation,omitempty"`
   870  	Sender       *User         `json:"sender,omitempty"`
   871  }
   872  
   873  // MetaEvent is triggered when the webhook that this event is configured on is deleted.
   874  // This event will only listen for changes to the particular hook the event is installed on.
   875  // Therefore, it must be selected for each hook that you'd like to receive meta events for.
   876  // The Webhook event name is "meta".
   877  //
   878  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#meta
   879  type MetaEvent struct {
   880  	// Action is the action that was performed. Possible value is: "deleted".
   881  	Action *string `json:"action,omitempty"`
   882  	// The ID of the modified webhook.
   883  	HookID *int64 `json:"hook_id,omitempty"`
   884  	// The modified webhook.
   885  	// This will contain different keys based on the type of webhook it is: repository,
   886  	// organization, business, app, or GitHub Marketplace.
   887  	Hook *Hook `json:"hook,omitempty"`
   888  
   889  	// The following fields are only populated by Webhook events.
   890  	Repo         *Repository   `json:"repository,omitempty"`
   891  	Org          *Organization `json:"organization,omitempty"`
   892  	Sender       *User         `json:"sender,omitempty"`
   893  	Installation *Installation `json:"installation,omitempty"`
   894  }
   895  
   896  // MilestoneEvent is triggered when a milestone is created, closed, opened, edited, or deleted.
   897  // The Webhook event name is "milestone".
   898  //
   899  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#milestone
   900  type MilestoneEvent struct {
   901  	// Action is the action that was performed. Possible values are:
   902  	// "created", "closed", "opened", "edited", "deleted"
   903  	Action    *string    `json:"action,omitempty"`
   904  	Milestone *Milestone `json:"milestone,omitempty"`
   905  
   906  	// The following fields are only populated by Webhook events.
   907  	Changes      *EditChange   `json:"changes,omitempty"`
   908  	Repo         *Repository   `json:"repository,omitempty"`
   909  	Sender       *User         `json:"sender,omitempty"`
   910  	Org          *Organization `json:"organization,omitempty"`
   911  	Installation *Installation `json:"installation,omitempty"`
   912  }
   913  
   914  // OrganizationEvent is triggered when an organization is deleted and renamed, and when a user is added,
   915  // removed, or invited to an organization.
   916  // Events of this type are not visible in timelines. These events are only used to trigger organization hooks.
   917  // Webhook event name is "organization".
   918  //
   919  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#organization
   920  type OrganizationEvent struct {
   921  	// Action is the action that was performed.
   922  	// Possible values are: "deleted", "renamed", "member_added", "member_removed", or "member_invited".
   923  	Action *string `json:"action,omitempty"`
   924  
   925  	// Invitation is the invitation for the user or email if the action is "member_invited".
   926  	Invitation *Invitation `json:"invitation,omitempty"`
   927  
   928  	// Membership is the membership between the user and the organization.
   929  	// Not present when the action is "member_invited".
   930  	Membership *Membership `json:"membership,omitempty"`
   931  
   932  	Organization *Organization `json:"organization,omitempty"`
   933  	Sender       *User         `json:"sender,omitempty"`
   934  	Installation *Installation `json:"installation,omitempty"`
   935  }
   936  
   937  // OrgBlockEvent is triggered when an organization blocks or unblocks a user.
   938  // The Webhook event name is "org_block".
   939  //
   940  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#org_block
   941  type OrgBlockEvent struct {
   942  	// Action is the action that was performed.
   943  	// Can be "blocked" or "unblocked".
   944  	Action       *string       `json:"action,omitempty"`
   945  	BlockedUser  *User         `json:"blocked_user,omitempty"`
   946  	Organization *Organization `json:"organization,omitempty"`
   947  	Sender       *User         `json:"sender,omitempty"`
   948  
   949  	// The following fields are only populated by Webhook events.
   950  	Installation *Installation `json:"installation,omitempty"`
   951  }
   952  
   953  // PackageEvent represents activity related to GitHub Packages.
   954  // The Webhook event name is "package".
   955  //
   956  // This event is triggered when a GitHub Package is published or updated.
   957  //
   958  // GitHub API docs: https://developer.github.com/webhooks/event-payloads/#package
   959  type PackageEvent struct {
   960  	// Action is the action that was performed.
   961  	// Can be "published" or "updated".
   962  	Action  *string       `json:"action,omitempty"`
   963  	Package *Package      `json:"package,omitempty"`
   964  	Repo    *Repository   `json:"repository,omitempty"`
   965  	Org     *Organization `json:"organization,omitempty"`
   966  	Sender  *User         `json:"sender,omitempty"`
   967  
   968  	// The following fields are only populated by Webhook events.
   969  	Installation *Installation `json:"installation,omitempty"`
   970  }
   971  
   972  // PageBuildEvent represents an attempted build of a GitHub Pages site, whether
   973  // successful or not.
   974  // The Webhook event name is "page_build".
   975  //
   976  // This event is triggered on push to a GitHub Pages enabled branch (gh-pages
   977  // for project pages, master for user and organization pages).
   978  //
   979  // Events of this type are not visible in timelines, they are only used to trigger hooks.
   980  //
   981  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#page_build
   982  type PageBuildEvent struct {
   983  	Build *PagesBuild `json:"build,omitempty"`
   984  
   985  	// The following fields are only populated by Webhook events.
   986  	ID           *int64        `json:"id,omitempty"`
   987  	Repo         *Repository   `json:"repository,omitempty"`
   988  	Sender       *User         `json:"sender,omitempty"`
   989  	Installation *Installation `json:"installation,omitempty"`
   990  
   991  	// The following field is only present when the webhook is triggered on
   992  	// a repository belonging to an organization.
   993  	Org *Organization `json:"organization,omitempty"`
   994  }
   995  
   996  // PersonalAccessTokenRequestEvent occurs when there is activity relating to a
   997  // request for a fine-grained personal access token to access resources that
   998  // belong to a resource owner that requires approval for token access.
   999  // The webhook event name is "personal_access_token_request".
  1000  //
  1001  // GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#personal_access_token_request
  1002  type PersonalAccessTokenRequestEvent struct {
  1003  	// Action is the action that was performed. Possible values are:
  1004  	// "approved", "cancelled", "created" or "denied"
  1005  	Action                     *string                     `json:"action,omitempty"`
  1006  	PersonalAccessTokenRequest *PersonalAccessTokenRequest `json:"personal_access_token_request,omitempty"`
  1007  	Org                        *Organization               `json:"organization,omitempty"`
  1008  	Sender                     *User                       `json:"sender,omitempty"`
  1009  	Installation               *Installation               `json:"installation,omitempty"`
  1010  }
  1011  
  1012  // PersonalAccessTokenRequest contains the details of a PersonalAccessTokenRequestEvent.
  1013  type PersonalAccessTokenRequest struct {
  1014  	// Unique identifier of the request for access via fine-grained personal
  1015  	// access token. Used as the pat_request_id parameter in the list and review
  1016  	// API calls.
  1017  	ID    *int64 `json:"id,omitempty"`
  1018  	Owner *User  `json:"owner,omitempty"`
  1019  
  1020  	// New requested permissions, categorized by type of permission.
  1021  	PermissionsAdded *PersonalAccessTokenPermissions `json:"permissions_added,omitempty"`
  1022  
  1023  	// Requested permissions that elevate access for a previously approved
  1024  	// request for access, categorized by type of permission.
  1025  	PermissionsUpgraded *PersonalAccessTokenPermissions `json:"permissions_upgraded,omitempty"`
  1026  
  1027  	// Permissions requested, categorized by type of permission.
  1028  	// This field incorporates permissions_added and permissions_upgraded.
  1029  	PermissionsResult *PersonalAccessTokenPermissions `json:"permissions_result,omitempty"`
  1030  
  1031  	// Type of repository selection requested. Possible values are:
  1032  	// "none", "all" or "subset"
  1033  	RepositorySelection *string `json:"repository_selection,omitempty"`
  1034  
  1035  	// The number of repositories the token is requesting access to.
  1036  	// This field is only populated when repository_selection is subset.
  1037  	RepositoryCount *int64 `json:"repository_count,omitempty"`
  1038  
  1039  	// An array of repository objects the token is requesting access to.
  1040  	// This field is only populated when repository_selection is subset.
  1041  	Repositories []*Repository `json:"repositories,omitempty"`
  1042  
  1043  	// Date and time when the request for access was created.
  1044  	CreatedAt *Timestamp `json:"created_at,omitempty"`
  1045  
  1046  	// Whether the associated fine-grained personal access token has expired.
  1047  	TokenExpired *bool `json:"token_expired,omitempty"`
  1048  
  1049  	// Date and time when the associated fine-grained personal access token expires.
  1050  	TokenExpiresAt *Timestamp `json:"token_expires_at,omitempty"`
  1051  
  1052  	// Date and time when the associated fine-grained personal access token was last used for authentication.
  1053  	TokenLastUsedAt *Timestamp `json:"token_last_used_at,omitempty"`
  1054  
  1055  	// The following field is only present when the webhook is triggered on
  1056  	// a repository belonging to an organization.
  1057  	Org *Organization `json:"organization,omitempty"`
  1058  }
  1059  
  1060  // PersonalAccessTokenPermissions represents the original or newly requested
  1061  // scope of permissions for a fine-grained personal access token within a PersonalAccessTokenRequest.
  1062  type PersonalAccessTokenPermissions struct {
  1063  	Org   map[string]string `json:"organization,omitempty"`
  1064  	Repo  map[string]string `json:"repository,omitempty"`
  1065  	Other map[string]string `json:"other,omitempty"`
  1066  }
  1067  
  1068  // PingEvent is triggered when a Webhook is added to GitHub.
  1069  //
  1070  // GitHub API docs: https://developer.github.com/webhooks/#ping-event
  1071  type PingEvent struct {
  1072  	// Random string of GitHub zen.
  1073  	Zen *string `json:"zen,omitempty"`
  1074  	// The ID of the webhook that triggered the ping.
  1075  	HookID *int64 `json:"hook_id,omitempty"`
  1076  	// The webhook configuration.
  1077  	Hook *Hook `json:"hook,omitempty"`
  1078  
  1079  	// The following fields are only populated by Webhook events.
  1080  	Repo         *Repository   `json:"repository,omitempty"`
  1081  	Org          *Organization `json:"organization,omitempty"`
  1082  	Sender       *User         `json:"sender,omitempty"`
  1083  	Installation *Installation `json:"installation,omitempty"`
  1084  }
  1085  
  1086  // ProjectV2Event is triggered when there is activity relating to an organization-level project.
  1087  // The Webhook event name is "projects_v2".
  1088  //
  1089  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2
  1090  type ProjectV2Event struct {
  1091  	Action     *string    `json:"action,omitempty"`
  1092  	ProjectsV2 *ProjectV2 `json:"projects_v2,omitempty"`
  1093  
  1094  	// The following fields are only populated by Webhook events.
  1095  	Installation *Installation `json:"installation,omitempty"`
  1096  	Org          *Organization `json:"organization,omitempty"`
  1097  	Sender       *User         `json:"sender,omitempty"`
  1098  }
  1099  
  1100  // ProjectV2 represents a v2 project.
  1101  type ProjectV2 struct {
  1102  	ID               *int64     `json:"id,omitempty"`
  1103  	NodeID           *string    `json:"node_id,omitempty"`
  1104  	Owner            *User      `json:"owner,omitempty"`
  1105  	Creator          *User      `json:"creator,omitempty"`
  1106  	Title            *string    `json:"title,omitempty"`
  1107  	Description      *string    `json:"description,omitempty"`
  1108  	Public           *bool      `json:"public,omitempty"`
  1109  	ClosedAt         *Timestamp `json:"closed_at,omitempty"`
  1110  	CreatedAt        *Timestamp `json:"created_at,omitempty"`
  1111  	UpdatedAt        *Timestamp `json:"updated_at,omitempty"`
  1112  	DeletedAt        *Timestamp `json:"deleted_at,omitempty"`
  1113  	Number           *int       `json:"number,omitempty"`
  1114  	ShortDescription *string    `json:"short_description,omitempty"`
  1115  	DeletedBy        *User      `json:"deleted_by,omitempty"`
  1116  
  1117  	// Fields migrated from the Project (classic) struct:
  1118  	URL                    *string `json:"url,omitempty"`
  1119  	HTMLURL                *string `json:"html_url,omitempty"`
  1120  	ColumnsURL             *string `json:"columns_url,omitempty"`
  1121  	OwnerURL               *string `json:"owner_url,omitempty"`
  1122  	Name                   *string `json:"name,omitempty"`
  1123  	Body                   *string `json:"body,omitempty"`
  1124  	State                  *string `json:"state,omitempty"`
  1125  	OrganizationPermission *string `json:"organization_permission,omitempty"`
  1126  	Private                *bool   `json:"private,omitempty"`
  1127  }
  1128  
  1129  // ProjectV2ItemEvent is triggered when there is activity relating to an item on an organization-level project.
  1130  // The Webhook event name is "projects_v2_item".
  1131  //
  1132  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2_item
  1133  type ProjectV2ItemEvent struct {
  1134  	Action        *string              `json:"action,omitempty"`
  1135  	Changes       *ProjectV2ItemChange `json:"changes,omitempty"`
  1136  	ProjectV2Item *ProjectV2Item       `json:"projects_v2_item,omitempty"`
  1137  
  1138  	// The following fields are only populated by Webhook events.
  1139  	Installation *Installation `json:"installation,omitempty"`
  1140  	Org          *Organization `json:"organization,omitempty"`
  1141  	Sender       *User         `json:"sender,omitempty"`
  1142  }
  1143  
  1144  // ProjectV2ItemChange represents a project v2 item change.
  1145  type ProjectV2ItemChange struct {
  1146  	ArchivedAt *ArchivedAt `json:"archived_at,omitempty"`
  1147  }
  1148  
  1149  // ArchivedAt represents an archiving date change.
  1150  type ArchivedAt struct {
  1151  	From *Timestamp `json:"from,omitempty"`
  1152  	To   *Timestamp `json:"to,omitempty"`
  1153  }
  1154  
  1155  // ProjectV2Item represents an item belonging to a project.
  1156  type ProjectV2Item struct {
  1157  	ID            *int64     `json:"id,omitempty"`
  1158  	NodeID        *string    `json:"node_id,omitempty"`
  1159  	ProjectNodeID *string    `json:"project_node_id,omitempty"`
  1160  	ContentNodeID *string    `json:"content_node_id,omitempty"`
  1161  	ContentType   *string    `json:"content_type,omitempty"`
  1162  	Creator       *User      `json:"creator,omitempty"`
  1163  	CreatedAt     *Timestamp `json:"created_at,omitempty"`
  1164  	UpdatedAt     *Timestamp `json:"updated_at,omitempty"`
  1165  	ArchivedAt    *Timestamp `json:"archived_at,omitempty"`
  1166  }
  1167  
  1168  // PublicEvent is triggered when a private repository is open sourced.
  1169  // According to GitHub: "Without a doubt: the best GitHub event."
  1170  // The Webhook event name is "public".
  1171  //
  1172  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#public
  1173  type PublicEvent struct {
  1174  	// The following fields are only populated by Webhook events.
  1175  	Repo         *Repository   `json:"repository,omitempty"`
  1176  	Sender       *User         `json:"sender,omitempty"`
  1177  	Installation *Installation `json:"installation,omitempty"`
  1178  
  1179  	// The following field is only present when the webhook is triggered on
  1180  	// a repository belonging to an organization.
  1181  	Org *Organization `json:"organization,omitempty"`
  1182  }
  1183  
  1184  // PullRequestEvent is triggered when a pull request is assigned, unassigned, labeled,
  1185  // unlabeled, opened, edited, closed, reopened, synchronize, ready_for_review,
  1186  // locked, unlocked, a pull request review is requested, or a review request is removed.
  1187  // The Webhook event name is "pull_request".
  1188  //
  1189  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/github-event-types#pullrequestevent
  1190  type PullRequestEvent struct {
  1191  	// Action is the action that was performed. Possible values are:
  1192  	// "assigned", "unassigned", "review_requested", "review_request_removed", "labeled", "unlabeled",
  1193  	// "opened", "edited", "closed", "ready_for_review", "locked", "unlocked", or "reopened".
  1194  	// If the action is "closed" and the "merged" key is "false", the pull request was closed with unmerged commits.
  1195  	// If the action is "closed" and the "merged" key is "true", the pull request was merged.
  1196  	// While webhooks are also triggered when a pull request is synchronized, Events API timelines
  1197  	// don't include pull request events with the "synchronize" action.
  1198  	Action      *string      `json:"action,omitempty"`
  1199  	Assignee    *User        `json:"assignee,omitempty"`
  1200  	Number      *int         `json:"number,omitempty"`
  1201  	PullRequest *PullRequest `json:"pull_request,omitempty"`
  1202  
  1203  	// The following fields are only populated by Webhook events.
  1204  	Changes *EditChange `json:"changes,omitempty"`
  1205  	// RequestedReviewer is populated in "review_requested", "review_request_removed" event deliveries.
  1206  	// A request affecting multiple reviewers at once is split into multiple
  1207  	// such event deliveries, each with a single, different RequestedReviewer.
  1208  	RequestedReviewer *User `json:"requested_reviewer,omitempty"`
  1209  	// In the event that a team is requested instead of a user, "requested_team" gets sent in place of
  1210  	// "requested_user" with the same delivery behavior.
  1211  	RequestedTeam *Team         `json:"requested_team,omitempty"`
  1212  	Repo          *Repository   `json:"repository,omitempty"`
  1213  	Sender        *User         `json:"sender,omitempty"`
  1214  	Installation  *Installation `json:"installation,omitempty"`
  1215  	Label         *Label        `json:"label,omitempty"` // Populated in "labeled" event deliveries.
  1216  
  1217  	// The following field is only present when the webhook is triggered on
  1218  	// a repository belonging to an organization.
  1219  	Organization *Organization `json:"organization,omitempty"`
  1220  
  1221  	// The following fields are only populated when the Action is "synchronize".
  1222  	Before *string `json:"before,omitempty"`
  1223  	After  *string `json:"after,omitempty"`
  1224  
  1225  	// The following will be populated if the event was performed by an App
  1226  	PerformedViaGithubApp *App `json:"performed_via_github_app,omitempty"`
  1227  }
  1228  
  1229  // PullRequestReviewEvent is triggered when a review is submitted on a pull
  1230  // request.
  1231  // The Webhook event name is "pull_request_review".
  1232  //
  1233  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review
  1234  type PullRequestReviewEvent struct {
  1235  	// Action is always "submitted".
  1236  	Action      *string            `json:"action,omitempty"`
  1237  	Review      *PullRequestReview `json:"review,omitempty"`
  1238  	PullRequest *PullRequest       `json:"pull_request,omitempty"`
  1239  
  1240  	// The following fields are only populated by Webhook events.
  1241  	Repo         *Repository   `json:"repository,omitempty"`
  1242  	Sender       *User         `json:"sender,omitempty"`
  1243  	Installation *Installation `json:"installation,omitempty"`
  1244  
  1245  	// The following field is only present when the webhook is triggered on
  1246  	// a repository belonging to an organization.
  1247  	Organization *Organization `json:"organization,omitempty"`
  1248  }
  1249  
  1250  // PullRequestReviewCommentEvent is triggered when a comment is created on a
  1251  // portion of the unified diff of a pull request.
  1252  // The Webhook event name is "pull_request_review_comment".
  1253  //
  1254  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review_comment
  1255  type PullRequestReviewCommentEvent struct {
  1256  	// Action is the action that was performed on the comment.
  1257  	// Possible values are: "created", "edited", "deleted".
  1258  	Action      *string             `json:"action,omitempty"`
  1259  	PullRequest *PullRequest        `json:"pull_request,omitempty"`
  1260  	Comment     *PullRequestComment `json:"comment,omitempty"`
  1261  
  1262  	// The following fields are only populated by Webhook events.
  1263  	Changes      *EditChange   `json:"changes,omitempty"`
  1264  	Repo         *Repository   `json:"repository,omitempty"`
  1265  	Sender       *User         `json:"sender,omitempty"`
  1266  	Installation *Installation `json:"installation,omitempty"`
  1267  
  1268  	// The following field is only present when the webhook is triggered on
  1269  	// a repository belonging to an organization.
  1270  	Org *Organization `json:"organization,omitempty"`
  1271  }
  1272  
  1273  // PullRequestReviewThreadEvent is triggered when a comment made as part of a
  1274  // review of a pull request is marked resolved or unresolved.
  1275  // The Webhook event name is "pull_request_review_thread".
  1276  //
  1277  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review_thread
  1278  type PullRequestReviewThreadEvent struct {
  1279  	// Action is the action that was performed on the comment.
  1280  	// Possible values are: "resolved", "unresolved".
  1281  	Action      *string            `json:"action,omitempty"`
  1282  	Thread      *PullRequestThread `json:"thread,omitempty"`
  1283  	PullRequest *PullRequest       `json:"pull_request,omitempty"`
  1284  
  1285  	// The following fields are only populated by Webhook events.
  1286  	Repo         *Repository   `json:"repository,omitempty"`
  1287  	Sender       *User         `json:"sender,omitempty"`
  1288  	Installation *Installation `json:"installation,omitempty"`
  1289  
  1290  	// The following field is only present when the webhook is triggered on
  1291  	// a repository belonging to an organization.
  1292  	Org *Organization `json:"organization,omitempty"`
  1293  }
  1294  
  1295  // PullRequestTargetEvent is triggered when a pull request is assigned, unassigned, labeled,
  1296  // unlabeled, opened, edited, closed, reopened, synchronize, ready_for_review,
  1297  // locked, unlocked, a pull request review is requested, or a review request is removed.
  1298  // The Webhook event name is "pull_request_target".
  1299  //
  1300  // GitHub API docs: https://docs.github.com/actions/events-that-trigger-workflows#pull_request_target
  1301  type PullRequestTargetEvent struct {
  1302  	// Action is the action that was performed. Possible values are:
  1303  	// "assigned", "unassigned", "labeled", "unlabeled", "opened", "edited", "closed", "reopened",
  1304  	// "ready_for_review", "locked", "unlocked", "review_requested" or "review_request_removed".
  1305  	// If the action is "closed" and the "merged" key is "false", the pull request was closed with unmerged commits.
  1306  	// If the action is "closed" and the "merged" key is "true", the pull request was merged.
  1307  	// While webhooks are also triggered when a pull request is synchronized, Events API timelines
  1308  	// don't include pull request events with the "synchronize" action.
  1309  	Action      *string      `json:"action,omitempty"`
  1310  	Assignee    *User        `json:"assignee,omitempty"`
  1311  	Number      *int         `json:"number,omitempty"`
  1312  	PullRequest *PullRequest `json:"pull_request,omitempty"`
  1313  
  1314  	// The following fields are only populated by Webhook events.
  1315  	Changes *EditChange `json:"changes,omitempty"`
  1316  	// RequestedReviewer is populated in "review_requested", "review_request_removed" event deliveries.
  1317  	// A request affecting multiple reviewers at once is split into multiple
  1318  	// such event deliveries, each with a single, different RequestedReviewer.
  1319  	RequestedReviewer *User `json:"requested_reviewer,omitempty"`
  1320  	// In the event that a team is requested instead of a user, "requested_team" gets sent in place of
  1321  	// "requested_user" with the same delivery behavior.
  1322  	RequestedTeam *Team         `json:"requested_team,omitempty"`
  1323  	Repo          *Repository   `json:"repository,omitempty"`
  1324  	Sender        *User         `json:"sender,omitempty"`
  1325  	Installation  *Installation `json:"installation,omitempty"`
  1326  	Label         *Label        `json:"label,omitempty"` // Populated in "labeled" event deliveries.
  1327  
  1328  	// The following field is only present when the webhook is triggered on
  1329  	// a repository belonging to an organization.
  1330  	Organization *Organization `json:"organization,omitempty"`
  1331  
  1332  	// The following fields are only populated when the Action is "synchronize".
  1333  	Before *string `json:"before,omitempty"`
  1334  	After  *string `json:"after,omitempty"`
  1335  
  1336  	// The following will be populated if the event was performed by an App
  1337  	PerformedViaGithubApp *App `json:"performed_via_github_app,omitempty"`
  1338  }
  1339  
  1340  // PushEvent represents a git push to a GitHub repository.
  1341  //
  1342  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#push
  1343  type PushEvent struct {
  1344  	PushID       *int64        `json:"push_id,omitempty"`
  1345  	Head         *string       `json:"head,omitempty"`
  1346  	Ref          *string       `json:"ref,omitempty"`
  1347  	Size         *int          `json:"size,omitempty"`
  1348  	Commits      []*HeadCommit `json:"commits,omitempty"`
  1349  	Before       *string       `json:"before,omitempty"`
  1350  	DistinctSize *int          `json:"distinct_size,omitempty"`
  1351  
  1352  	// The following fields are only populated by Webhook events.
  1353  	Action       *string              `json:"action,omitempty"`
  1354  	After        *string              `json:"after,omitempty"`
  1355  	Created      *bool                `json:"created,omitempty"`
  1356  	Deleted      *bool                `json:"deleted,omitempty"`
  1357  	Forced       *bool                `json:"forced,omitempty"`
  1358  	BaseRef      *string              `json:"base_ref,omitempty"`
  1359  	Compare      *string              `json:"compare,omitempty"`
  1360  	Repo         *PushEventRepository `json:"repository,omitempty"`
  1361  	HeadCommit   *HeadCommit          `json:"head_commit,omitempty"`
  1362  	Pusher       *CommitAuthor        `json:"pusher,omitempty"`
  1363  	Sender       *User                `json:"sender,omitempty"`
  1364  	Installation *Installation        `json:"installation,omitempty"`
  1365  
  1366  	// The following field is only present when the webhook is triggered on
  1367  	// a repository belonging to an organization.
  1368  	Organization *Organization `json:"organization,omitempty"`
  1369  }
  1370  
  1371  func (p PushEvent) String() string {
  1372  	return Stringify(p)
  1373  }
  1374  
  1375  // HeadCommit represents a git commit in a GitHub PushEvent.
  1376  type HeadCommit struct {
  1377  	Message  *string       `json:"message,omitempty"`
  1378  	Author   *CommitAuthor `json:"author,omitempty"`
  1379  	URL      *string       `json:"url,omitempty"`
  1380  	Distinct *bool         `json:"distinct,omitempty"`
  1381  
  1382  	// The following fields are only populated by Events API.
  1383  	SHA *string `json:"sha,omitempty"`
  1384  
  1385  	// The following fields are only populated by Webhook events.
  1386  	ID        *string       `json:"id,omitempty"`
  1387  	TreeID    *string       `json:"tree_id,omitempty"`
  1388  	Timestamp *Timestamp    `json:"timestamp,omitempty"`
  1389  	Committer *CommitAuthor `json:"committer,omitempty"`
  1390  	Added     []string      `json:"added,omitempty"`
  1391  	Removed   []string      `json:"removed,omitempty"`
  1392  	Modified  []string      `json:"modified,omitempty"`
  1393  }
  1394  
  1395  func (h HeadCommit) String() string {
  1396  	return Stringify(h)
  1397  }
  1398  
  1399  // PushEventRepository represents the repo object in a PushEvent payload.
  1400  type PushEventRepository struct {
  1401  	ID               *int64                 `json:"id,omitempty"`
  1402  	NodeID           *string                `json:"node_id,omitempty"`
  1403  	Name             *string                `json:"name,omitempty"`
  1404  	FullName         *string                `json:"full_name,omitempty"`
  1405  	Owner            *User                  `json:"owner,omitempty"`
  1406  	Private          *bool                  `json:"private,omitempty"`
  1407  	Description      *string                `json:"description,omitempty"`
  1408  	Fork             *bool                  `json:"fork,omitempty"`
  1409  	CreatedAt        *Timestamp             `json:"created_at,omitempty"`
  1410  	PushedAt         *Timestamp             `json:"pushed_at,omitempty"`
  1411  	UpdatedAt        *Timestamp             `json:"updated_at,omitempty"`
  1412  	Homepage         *string                `json:"homepage,omitempty"`
  1413  	PullsURL         *string                `json:"pulls_url,omitempty"`
  1414  	Size             *int                   `json:"size,omitempty"`
  1415  	StargazersCount  *int                   `json:"stargazers_count,omitempty"`
  1416  	WatchersCount    *int                   `json:"watchers_count,omitempty"`
  1417  	Language         *string                `json:"language,omitempty"`
  1418  	HasIssues        *bool                  `json:"has_issues,omitempty"`
  1419  	HasDownloads     *bool                  `json:"has_downloads,omitempty"`
  1420  	HasWiki          *bool                  `json:"has_wiki,omitempty"`
  1421  	HasPages         *bool                  `json:"has_pages,omitempty"`
  1422  	ForksCount       *int                   `json:"forks_count,omitempty"`
  1423  	Archived         *bool                  `json:"archived,omitempty"`
  1424  	Disabled         *bool                  `json:"disabled,omitempty"`
  1425  	OpenIssuesCount  *int                   `json:"open_issues_count,omitempty"`
  1426  	DefaultBranch    *string                `json:"default_branch,omitempty"`
  1427  	MasterBranch     *string                `json:"master_branch,omitempty"`
  1428  	Organization     *string                `json:"organization,omitempty"`
  1429  	URL              *string                `json:"url,omitempty"`
  1430  	ArchiveURL       *string                `json:"archive_url,omitempty"`
  1431  	HTMLURL          *string                `json:"html_url,omitempty"`
  1432  	StatusesURL      *string                `json:"statuses_url,omitempty"`
  1433  	GitURL           *string                `json:"git_url,omitempty"`
  1434  	SSHURL           *string                `json:"ssh_url,omitempty"`
  1435  	CloneURL         *string                `json:"clone_url,omitempty"`
  1436  	SVNURL           *string                `json:"svn_url,omitempty"`
  1437  	Topics           []string               `json:"topics,omitempty"`
  1438  	CustomProperties map[string]interface{} `json:"custom_properties,omitempty"`
  1439  }
  1440  
  1441  // PushEventRepoOwner is a basic representation of user/org in a PushEvent payload.
  1442  type PushEventRepoOwner struct {
  1443  	Name  *string `json:"name,omitempty"`
  1444  	Email *string `json:"email,omitempty"`
  1445  }
  1446  
  1447  // ReleaseEvent is triggered when a release is published, unpublished, created,
  1448  // edited, deleted, or prereleased.
  1449  // The Webhook event name is "release".
  1450  //
  1451  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#release
  1452  type ReleaseEvent struct {
  1453  	// Action is the action that was performed. Possible values are: "published", "unpublished",
  1454  	// "created", "edited", "deleted", or "prereleased".
  1455  	Action  *string            `json:"action,omitempty"`
  1456  	Release *RepositoryRelease `json:"release,omitempty"`
  1457  
  1458  	// The following fields are only populated by Webhook events.
  1459  	Repo         *Repository   `json:"repository,omitempty"`
  1460  	Sender       *User         `json:"sender,omitempty"`
  1461  	Installation *Installation `json:"installation,omitempty"`
  1462  
  1463  	// The following field is only present when the webhook is triggered on
  1464  	// a repository belonging to an organization.
  1465  	Org *Organization `json:"organization,omitempty"`
  1466  }
  1467  
  1468  // RepositoryEvent is triggered when a repository is created, archived, unarchived,
  1469  // renamed, edited, transferred, made public, or made private. Organization hooks are
  1470  // also triggered when a repository is deleted.
  1471  // The Webhook event name is "repository".
  1472  //
  1473  // Events of this type are not visible in timelines, they are only used to
  1474  // trigger organization webhooks.
  1475  //
  1476  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository
  1477  type RepositoryEvent struct {
  1478  	// Action is the action that was performed. Possible values are: "created",
  1479  	// "deleted" (organization hooks only), "archived", "unarchived", "edited", "renamed",
  1480  	// "transferred", "publicized", or "privatized".
  1481  	Action *string     `json:"action,omitempty"`
  1482  	Repo   *Repository `json:"repository,omitempty"`
  1483  
  1484  	// The following fields are only populated by Webhook events.
  1485  	Changes      *EditChange   `json:"changes,omitempty"`
  1486  	Org          *Organization `json:"organization,omitempty"`
  1487  	Sender       *User         `json:"sender,omitempty"`
  1488  	Installation *Installation `json:"installation,omitempty"`
  1489  }
  1490  
  1491  // RepositoryDispatchEvent is triggered when a client sends a POST request to the repository dispatch event endpoint.
  1492  //
  1493  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository_dispatch
  1494  type RepositoryDispatchEvent struct {
  1495  	// Action is the event_type that submitted with the repository dispatch payload. Value can be any string.
  1496  	Action        *string         `json:"action,omitempty"`
  1497  	Branch        *string         `json:"branch,omitempty"`
  1498  	ClientPayload json.RawMessage `json:"client_payload,omitempty"`
  1499  	Repo          *Repository     `json:"repository,omitempty"`
  1500  
  1501  	// The following fields are only populated by Webhook events.
  1502  	Org          *Organization `json:"organization,omitempty"`
  1503  	Sender       *User         `json:"sender,omitempty"`
  1504  	Installation *Installation `json:"installation,omitempty"`
  1505  }
  1506  
  1507  // RepositoryImportEvent represents the activity related to a repository being imported to GitHub.
  1508  //
  1509  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#repository_import
  1510  type RepositoryImportEvent struct {
  1511  	// Status represents the final state of the import. This can be one of "success", "cancelled", or "failure".
  1512  	Status *string       `json:"status,omitempty"`
  1513  	Repo   *Repository   `json:"repository,omitempty"`
  1514  	Org    *Organization `json:"organization,omitempty"`
  1515  	Sender *User         `json:"sender,omitempty"`
  1516  }
  1517  
  1518  // RepositoryRulesetEvent triggers whenever there is a change to the repository's ruleset configuration.
  1519  //
  1520  // This can include updates to protection rules, required status checks, code owners, or other related configurations.
  1521  //
  1522  // GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#repository_ruleset
  1523  type RepositoryRulesetEvent struct {
  1524  	Action            *string                   `json:"action,omitempty"`
  1525  	Enterprise        *Enterprise               `json:"enterprise,omitempty"`
  1526  	Installation      *Installation             `json:"installation,omitempty"`
  1527  	Organization      *Organization             `json:"organization,omitempty"`
  1528  	Repository        *Repository               `json:"repository,omitempty"`
  1529  	RepositoryRuleset *RepositoryRuleset        `json:"repository_ruleset"`
  1530  	Changes           *RepositoryRulesetChanges `json:"changes,omitempty"`
  1531  	Sender            *User                     `json:"sender"`
  1532  }
  1533  
  1534  // RepositoryRulesetChanges represents the changes made to a repository ruleset.
  1535  type RepositoryRulesetChanges struct {
  1536  	Name        *RepositoryRulesetChangeSource      `json:"name,omitempty"`
  1537  	Enforcement *RepositoryRulesetChangeSource      `json:"enforcement,omitempty"`
  1538  	Conditions  *RepositoryRulesetChangedConditions `json:"conditions,omitempty"`
  1539  	Rules       *RepositoryRulesetChangedRules      `json:"rules,omitempty"`
  1540  }
  1541  
  1542  // RepositoryRulesetChangeSource represents a source change for the ruleset.
  1543  type RepositoryRulesetChangeSource struct {
  1544  	From *string `json:"from,omitempty"`
  1545  }
  1546  
  1547  // RepositoryRulesetChangeSources represents multiple source changes for the ruleset.
  1548  type RepositoryRulesetChangeSources struct {
  1549  	From []string `json:"from,omitempty"`
  1550  }
  1551  
  1552  // RepositoryRulesetChangedConditions holds changes to conditions in a ruleset.
  1553  type RepositoryRulesetChangedConditions struct {
  1554  	Added   []*RepositoryRulesetConditions        `json:"added,omitempty"`
  1555  	Deleted []*RepositoryRulesetConditions        `json:"deleted,omitempty"`
  1556  	Updated []*RepositoryRulesetUpdatedConditions `json:"updated,omitempty"`
  1557  }
  1558  
  1559  // RepositoryRulesetUpdatedConditions represents the edited updates to conditions in a ruleset.
  1560  type RepositoryRulesetUpdatedConditions struct {
  1561  	Condition *RepositoryRulesetConditions       `json:"condition,omitempty"`
  1562  	Changes   *RepositoryRulesetUpdatedCondition `json:"changes,omitempty"`
  1563  }
  1564  
  1565  // RepositoryRulesetUpdatedCondition represents the changes to a condition in a ruleset.
  1566  type RepositoryRulesetUpdatedCondition struct {
  1567  	ConditionType *RepositoryRulesetChangeSource  `json:"condition_type,omitempty"`
  1568  	Target        *RepositoryRulesetChangeSource  `json:"target,omitempty"`
  1569  	Include       *RepositoryRulesetChangeSources `json:"include,omitempty"`
  1570  	Exclude       *RepositoryRulesetChangeSources `json:"exclude,omitempty"`
  1571  }
  1572  
  1573  // RepositoryRulesetChangedRules holds changes to rules in a ruleset.
  1574  type RepositoryRulesetChangedRules struct {
  1575  	Added   []*RepositoryRule                `json:"added,omitempty"`
  1576  	Deleted []*RepositoryRule                `json:"deleted,omitempty"`
  1577  	Updated []*RepositoryRulesetUpdatedRules `json:"updated,omitempty"`
  1578  }
  1579  
  1580  // RepositoryRulesetUpdatedRules holds updates to rules in a ruleset.
  1581  type RepositoryRulesetUpdatedRules struct {
  1582  	Rule    *RepositoryRule               `json:"rule,omitempty"`
  1583  	Changes *RepositoryRulesetChangedRule `json:"changes,omitempty"`
  1584  }
  1585  
  1586  // RepositoryRulesetChangedRule holds changes made to a rule in a ruleset.
  1587  type RepositoryRulesetChangedRule struct {
  1588  	Configuration *RepositoryRulesetChangeSource `json:"configuration,omitempty"`
  1589  	RuleType      *RepositoryRulesetChangeSource `json:"rule_type,omitempty"`
  1590  	Pattern       *RepositoryRulesetChangeSource `json:"pattern,omitempty"`
  1591  }
  1592  
  1593  // RepositoryVulnerabilityAlertEvent is triggered when a security alert is created, dismissed, or resolved.
  1594  //
  1595  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository_vulnerability_alert
  1596  type RepositoryVulnerabilityAlertEvent struct {
  1597  	// Action is the action that was performed. Possible values are: "create", "dismiss", "resolve".
  1598  	Action *string `json:"action,omitempty"`
  1599  
  1600  	// The security alert of the vulnerable dependency.
  1601  	Alert *RepositoryVulnerabilityAlert `json:"alert,omitempty"`
  1602  
  1603  	// The repository of the vulnerable dependency.
  1604  	Repository *Repository `json:"repository,omitempty"`
  1605  
  1606  	// The following fields are only populated by Webhook events.
  1607  	Installation *Installation `json:"installation,omitempty"`
  1608  
  1609  	// The user that triggered the event.
  1610  	Sender *User `json:"sender,omitempty"`
  1611  
  1612  	// The following field is only present when the webhook is triggered on
  1613  	// a repository belonging to an organization.
  1614  	Org *Organization `json:"organization,omitempty"`
  1615  }
  1616  
  1617  // RepositoryVulnerabilityAlert represents a repository security alert.
  1618  type RepositoryVulnerabilityAlert struct {
  1619  	ID                       *int64     `json:"id,omitempty"`
  1620  	AffectedRange            *string    `json:"affected_range,omitempty"`
  1621  	AffectedPackageName      *string    `json:"affected_package_name,omitempty"`
  1622  	ExternalReference        *string    `json:"external_reference,omitempty"`
  1623  	ExternalIdentifier       *string    `json:"external_identifier,omitempty"`
  1624  	GitHubSecurityAdvisoryID *string    `json:"ghsa_id,omitempty"`
  1625  	Severity                 *string    `json:"severity,omitempty"`
  1626  	CreatedAt                *Timestamp `json:"created_at,omitempty"`
  1627  	FixedIn                  *string    `json:"fixed_in,omitempty"`
  1628  	Dismisser                *User      `json:"dismisser,omitempty"`
  1629  	DismissReason            *string    `json:"dismiss_reason,omitempty"`
  1630  	DismissedAt              *Timestamp `json:"dismissed_at,omitempty"`
  1631  }
  1632  
  1633  // SecretScanningAlertEvent is triggered when a secret scanning alert occurs in a repository.
  1634  // The Webhook name is secret_scanning_alert.
  1635  //
  1636  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#secret_scanning_alert
  1637  type SecretScanningAlertEvent struct {
  1638  	// Action is the action that was performed. Possible values are: "created", "resolved", or "reopened".
  1639  	Action *string `json:"action,omitempty"`
  1640  
  1641  	// Alert is the secret scanning alert involved in the event.
  1642  	Alert *SecretScanningAlert `json:"alert,omitempty"`
  1643  
  1644  	// Only populated by the "resolved" and "reopen" actions
  1645  	Sender *User `json:"sender,omitempty"`
  1646  	// The following fields are only populated by Webhook events.
  1647  	Repo         *Repository   `json:"repository,omitempty"`
  1648  	Organization *Organization `json:"organization,omitempty"`
  1649  	Enterprise   *Enterprise   `json:"enterprise,omitempty"`
  1650  	Installation *Installation `json:"installation,omitempty"`
  1651  }
  1652  
  1653  // SecretScanningAlertLocationEvent is triggered when there is activity relating to the locations of a secret in a secret scanning alert.
  1654  // The Webhook event name is "secret_scanning_alert_location".
  1655  //
  1656  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#secret_scanning_alert_location
  1657  type SecretScanningAlertLocationEvent struct {
  1658  	Action       *string                      `json:"action,omitempty"`
  1659  	Alert        *SecretScanningAlert         `json:"alert,omitempty"`
  1660  	Installation *Installation                `json:"installation,omitempty"`
  1661  	Location     *SecretScanningAlertLocation `json:"location,omitempty"`
  1662  	Organization *Organization                `json:"organization,omitempty"`
  1663  	Repo         *Repository                  `json:"repository,omitempty"`
  1664  	Sender       *User                        `json:"sender,omitempty"`
  1665  }
  1666  
  1667  // SecurityAndAnalysisEvent is triggered when code security and analysis features
  1668  // are enabled or disabled for a repository.
  1669  //
  1670  // GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#security_and_analysis
  1671  type SecurityAndAnalysisEvent struct {
  1672  	Changes      *SecurityAndAnalysisChange `json:"changes,omitempty"`
  1673  	Enterprise   *Enterprise                `json:"enterprise,omitempty"`
  1674  	Installation *Installation              `json:"installation,omitempty"`
  1675  	Organization *Organization              `json:"organization,omitempty"`
  1676  	Repository   *Repository                `json:"repository,omitempty"`
  1677  	Sender       *User                      `json:"sender,omitempty"`
  1678  }
  1679  
  1680  // SecurityAndAnalysisChange represents the changes when security and analysis
  1681  // features are enabled or disabled for a repository.
  1682  type SecurityAndAnalysisChange struct {
  1683  	From *SecurityAndAnalysisChangeFrom `json:"from,omitempty"`
  1684  }
  1685  
  1686  // SecurityAndAnalysisChangeFrom represents which change was made when security
  1687  // and analysis features are enabled or disabled for a repository.
  1688  type SecurityAndAnalysisChangeFrom struct {
  1689  	SecurityAndAnalysis *SecurityAndAnalysis `json:"security_and_analysis,omitempty"`
  1690  }
  1691  
  1692  // StarEvent is triggered when a star is added or removed from a repository.
  1693  // The Webhook event name is "star".
  1694  //
  1695  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#star
  1696  type StarEvent struct {
  1697  	// Action is the action that was performed. Possible values are: "created" or "deleted".
  1698  	Action *string `json:"action,omitempty"`
  1699  
  1700  	// StarredAt is the time the star was created. It will be null for the "deleted" action.
  1701  	StarredAt *Timestamp `json:"starred_at,omitempty"`
  1702  
  1703  	// The following fields are only populated by Webhook events.
  1704  	Org          *Organization `json:"organization,omitempty"`
  1705  	Repo         *Repository   `json:"repository,omitempty"`
  1706  	Sender       *User         `json:"sender,omitempty"`
  1707  	Installation *Installation `json:"installation,omitempty"`
  1708  }
  1709  
  1710  // StatusEvent is triggered when the status of a Git commit changes.
  1711  // The Webhook event name is "status".
  1712  //
  1713  // Events of this type are not visible in timelines, they are only used to
  1714  // trigger hooks.
  1715  //
  1716  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#status
  1717  type StatusEvent struct {
  1718  	SHA *string `json:"sha,omitempty"`
  1719  	// State is the new state. Possible values are: "pending", "success", "failure", "error".
  1720  	State       *string   `json:"state,omitempty"`
  1721  	Description *string   `json:"description,omitempty"`
  1722  	TargetURL   *string   `json:"target_url,omitempty"`
  1723  	Branches    []*Branch `json:"branches,omitempty"`
  1724  
  1725  	// The following fields are only populated by Webhook events.
  1726  	ID           *int64            `json:"id,omitempty"`
  1727  	Name         *string           `json:"name,omitempty"`
  1728  	Context      *string           `json:"context,omitempty"`
  1729  	Commit       *RepositoryCommit `json:"commit,omitempty"`
  1730  	CreatedAt    *Timestamp        `json:"created_at,omitempty"`
  1731  	UpdatedAt    *Timestamp        `json:"updated_at,omitempty"`
  1732  	Repo         *Repository       `json:"repository,omitempty"`
  1733  	Sender       *User             `json:"sender,omitempty"`
  1734  	Installation *Installation     `json:"installation,omitempty"`
  1735  
  1736  	// The following field is only present when the webhook is triggered on
  1737  	// a repository belonging to an organization.
  1738  	Org *Organization `json:"organization,omitempty"`
  1739  }
  1740  
  1741  // TeamEvent is triggered when an organization's team is created, modified or deleted.
  1742  // The Webhook event name is "team".
  1743  //
  1744  // Events of this type are not visible in timelines. These events are only used
  1745  // to trigger hooks.
  1746  //
  1747  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#team
  1748  type TeamEvent struct {
  1749  	Action  *string     `json:"action,omitempty"`
  1750  	Team    *Team       `json:"team,omitempty"`
  1751  	Changes *TeamChange `json:"changes,omitempty"`
  1752  	Repo    *Repository `json:"repository,omitempty"`
  1753  
  1754  	// The following fields are only populated by Webhook events.
  1755  	Org          *Organization `json:"organization,omitempty"`
  1756  	Sender       *User         `json:"sender,omitempty"`
  1757  	Installation *Installation `json:"installation,omitempty"`
  1758  }
  1759  
  1760  // TeamAddEvent is triggered when a repository is added to a team.
  1761  // The Webhook event name is "team_add".
  1762  //
  1763  // Events of this type are not visible in timelines. These events are only used
  1764  // to trigger hooks.
  1765  //
  1766  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#team_add
  1767  type TeamAddEvent struct {
  1768  	Team *Team       `json:"team,omitempty"`
  1769  	Repo *Repository `json:"repository,omitempty"`
  1770  
  1771  	// The following fields are only populated by Webhook events.
  1772  	Org          *Organization `json:"organization,omitempty"`
  1773  	Sender       *User         `json:"sender,omitempty"`
  1774  	Installation *Installation `json:"installation,omitempty"`
  1775  }
  1776  
  1777  // UserEvent is triggered when a user is created or deleted.
  1778  // The Webhook event name is "user".
  1779  //
  1780  // Only global webhooks can subscribe to this event type.
  1781  //
  1782  // GitHub API docs: https://developer.github.com/enterprise/v3/activity/events/types/#userevent-enterprise
  1783  type UserEvent struct {
  1784  	User *User `json:"user,omitempty"`
  1785  	// The action performed. Possible values are: "created" or "deleted".
  1786  	Action     *string     `json:"action,omitempty"`
  1787  	Enterprise *Enterprise `json:"enterprise,omitempty"`
  1788  	Sender     *User       `json:"sender,omitempty"`
  1789  
  1790  	// The following fields are only populated by Webhook events.
  1791  	Installation *Installation `json:"installation,omitempty"`
  1792  }
  1793  
  1794  // WatchEvent is related to starring a repository, not watching. See this API
  1795  // blog post for an explanation: https://developer.github.com/changes/2012-09-05-watcher-api/
  1796  //
  1797  // The event’s actor is the user who starred a repository, and the event’s
  1798  // repository is the repository that was starred.
  1799  //
  1800  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#watch
  1801  type WatchEvent struct {
  1802  	// Action is the action that was performed. Possible value is: "started".
  1803  	Action *string `json:"action,omitempty"`
  1804  
  1805  	// The following fields are only populated by Webhook events.
  1806  	Repo         *Repository   `json:"repository,omitempty"`
  1807  	Sender       *User         `json:"sender,omitempty"`
  1808  	Installation *Installation `json:"installation,omitempty"`
  1809  
  1810  	// The following field is only present when the webhook is triggered on
  1811  	// a repository belonging to an organization.
  1812  	Org *Organization `json:"organization,omitempty"`
  1813  }
  1814  
  1815  // WorkflowDispatchEvent is triggered when someone triggers a workflow run on GitHub or
  1816  // sends a POST request to the create a workflow dispatch event endpoint.
  1817  //
  1818  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch
  1819  type WorkflowDispatchEvent struct {
  1820  	Inputs   json.RawMessage `json:"inputs,omitempty"`
  1821  	Ref      *string         `json:"ref,omitempty"`
  1822  	Workflow *string         `json:"workflow,omitempty"`
  1823  
  1824  	// The following fields are only populated by Webhook events.
  1825  	Repo         *Repository   `json:"repository,omitempty"`
  1826  	Org          *Organization `json:"organization,omitempty"`
  1827  	Sender       *User         `json:"sender,omitempty"`
  1828  	Installation *Installation `json:"installation,omitempty"`
  1829  }
  1830  
  1831  // WorkflowJobEvent is triggered when a job is queued, started or completed.
  1832  //
  1833  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_job
  1834  type WorkflowJobEvent struct {
  1835  	WorkflowJob *WorkflowJob `json:"workflow_job,omitempty"`
  1836  
  1837  	Action *string `json:"action,omitempty"`
  1838  
  1839  	// The following fields are only populated by Webhook events.
  1840  
  1841  	// Org is not nil when the webhook is configured for an organization or the event
  1842  	// occurs from activity in a repository owned by an organization.
  1843  	Org          *Organization `json:"organization,omitempty"`
  1844  	Repo         *Repository   `json:"repository,omitempty"`
  1845  	Sender       *User         `json:"sender,omitempty"`
  1846  	Installation *Installation `json:"installation,omitempty"`
  1847  	Deployment   *Deployment   `json:"deployment,omitempty"`
  1848  }
  1849  
  1850  // WorkflowRunEvent is triggered when a GitHub Actions workflow run is requested or completed.
  1851  //
  1852  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#workflow_run
  1853  type WorkflowRunEvent struct {
  1854  	Action      *string      `json:"action,omitempty"`
  1855  	Workflow    *Workflow    `json:"workflow,omitempty"`
  1856  	WorkflowRun *WorkflowRun `json:"workflow_run,omitempty"`
  1857  
  1858  	// The following fields are only populated by Webhook events.
  1859  	Org          *Organization `json:"organization,omitempty"`
  1860  	Repo         *Repository   `json:"repository,omitempty"`
  1861  	Sender       *User         `json:"sender,omitempty"`
  1862  	Installation *Installation `json:"installation,omitempty"`
  1863  }
  1864  
  1865  // SecurityAdvisory represents the advisory object in SecurityAdvisoryEvent payload.
  1866  //
  1867  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory
  1868  type SecurityAdvisory struct {
  1869  	CVSS               *AdvisoryCVSS                 `json:"cvss,omitempty"`
  1870  	CWEs               []*AdvisoryCWEs               `json:"cwes,omitempty"`
  1871  	GHSAID             *string                       `json:"ghsa_id,omitempty"`
  1872  	Summary            *string                       `json:"summary,omitempty"`
  1873  	Description        *string                       `json:"description,omitempty"`
  1874  	Severity           *string                       `json:"severity,omitempty"`
  1875  	Identifiers        []*AdvisoryIdentifier         `json:"identifiers,omitempty"`
  1876  	References         []*AdvisoryReference          `json:"references,omitempty"`
  1877  	PublishedAt        *Timestamp                    `json:"published_at,omitempty"`
  1878  	UpdatedAt          *Timestamp                    `json:"updated_at,omitempty"`
  1879  	WithdrawnAt        *Timestamp                    `json:"withdrawn_at,omitempty"`
  1880  	Vulnerabilities    []*AdvisoryVulnerability      `json:"vulnerabilities,omitempty"`
  1881  	CVEID              *string                       `json:"cve_id,omitempty"`
  1882  	URL                *string                       `json:"url,omitempty"`
  1883  	HTMLURL            *string                       `json:"html_url,omitempty"`
  1884  	Author             *User                         `json:"author,omitempty"`
  1885  	Publisher          *User                         `json:"publisher,omitempty"`
  1886  	State              *string                       `json:"state,omitempty"`
  1887  	CreatedAt          *Timestamp                    `json:"created_at,omitempty"`
  1888  	ClosedAt           *Timestamp                    `json:"closed_at,omitempty"`
  1889  	Submission         *SecurityAdvisorySubmission   `json:"submission,omitempty"`
  1890  	CWEIDs             []string                      `json:"cwe_ids,omitempty"`
  1891  	Credits            []*RepoAdvisoryCredit         `json:"credits,omitempty"`
  1892  	CreditsDetailed    []*RepoAdvisoryCreditDetailed `json:"credits_detailed,omitempty"`
  1893  	CollaboratingUsers []*User                       `json:"collaborating_users,omitempty"`
  1894  	CollaboratingTeams []*Team                       `json:"collaborating_teams,omitempty"`
  1895  	PrivateFork        *Repository                   `json:"private_fork,omitempty"`
  1896  }
  1897  
  1898  // AdvisoryIdentifier represents the identifier for a Security Advisory.
  1899  type AdvisoryIdentifier struct {
  1900  	Value *string `json:"value,omitempty"`
  1901  	Type  *string `json:"type,omitempty"`
  1902  }
  1903  
  1904  // AdvisoryReference represents the reference url for the security advisory.
  1905  type AdvisoryReference struct {
  1906  	URL *string `json:"url,omitempty"`
  1907  }
  1908  
  1909  // AdvisoryVulnerability represents the vulnerability object for a Security Advisory.
  1910  type AdvisoryVulnerability struct {
  1911  	Package                *VulnerabilityPackage `json:"package,omitempty"`
  1912  	Severity               *string               `json:"severity,omitempty"`
  1913  	VulnerableVersionRange *string               `json:"vulnerable_version_range,omitempty"`
  1914  	FirstPatchedVersion    *FirstPatchedVersion  `json:"first_patched_version,omitempty"`
  1915  
  1916  	// PatchedVersions and VulnerableFunctions are used in the following APIs:
  1917  	// - https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization
  1918  	// - https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories
  1919  	PatchedVersions     *string  `json:"patched_versions,omitempty"`
  1920  	VulnerableFunctions []string `json:"vulnerable_functions,omitempty"`
  1921  }
  1922  
  1923  // VulnerabilityPackage represents the package object for an Advisory Vulnerability.
  1924  type VulnerabilityPackage struct {
  1925  	Ecosystem *string `json:"ecosystem,omitempty"`
  1926  	Name      *string `json:"name,omitempty"`
  1927  }
  1928  
  1929  // FirstPatchedVersion represents the identifier for the first patched version of that vulnerability.
  1930  type FirstPatchedVersion struct {
  1931  	Identifier *string `json:"identifier,omitempty"`
  1932  }
  1933  
  1934  // SecurityAdvisoryEvent is triggered when a security-related vulnerability is found in software on GitHub.
  1935  //
  1936  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory
  1937  type SecurityAdvisoryEvent struct {
  1938  	Action           *string           `json:"action,omitempty"`
  1939  	SecurityAdvisory *SecurityAdvisory `json:"security_advisory,omitempty"`
  1940  
  1941  	// The following fields are only populated by Webhook events.
  1942  	Enterprise   *Enterprise   `json:"enterprise,omitempty"`
  1943  	Installation *Installation `json:"installation,omitempty"`
  1944  	Organization *Organization `json:"organization,omitempty"`
  1945  	Repository   *Repository   `json:"repository,omitempty"`
  1946  	Sender       *User         `json:"sender,omitempty"`
  1947  }
  1948  
  1949  // CodeScanningAlertEvent is triggered when a code scanning finds a potential vulnerability or error in your code.
  1950  //
  1951  // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#code_scanning_alert
  1952  type CodeScanningAlertEvent struct {
  1953  	Action *string `json:"action,omitempty"`
  1954  	Alert  *Alert  `json:"alert,omitempty"`
  1955  	Ref    *string `json:"ref,omitempty"`
  1956  	// CommitOID is the commit SHA of the code scanning alert
  1957  	CommitOID *string       `json:"commit_oid,omitempty"`
  1958  	Repo      *Repository   `json:"repository,omitempty"`
  1959  	Org       *Organization `json:"organization,omitempty"`
  1960  	Sender    *User         `json:"sender,omitempty"`
  1961  
  1962  	Installation *Installation `json:"installation,omitempty"`
  1963  }
  1964  
  1965  // SponsorshipEvent represents a sponsorship event in GitHub.
  1966  //
  1967  // GitHub API docs: https://docs.github.com/en/rest/overview/github-event-types?apiVersion=2022-11-28#sponsorshipevent
  1968  type SponsorshipEvent struct {
  1969  	Action        *string             `json:"action,omitempty"`
  1970  	EffectiveDate *string             `json:"effective_date,omitempty"`
  1971  	Changes       *SponsorshipChanges `json:"changes,omitempty"`
  1972  	Repository    *Repository         `json:"repository,omitempty"`
  1973  	Organization  *Organization       `json:"organization,omitempty"`
  1974  	Sender        *User               `json:"sender,omitempty"`
  1975  	Installation  *Installation       `json:"installation,omitempty"`
  1976  }
  1977  
  1978  // SponsorshipChanges represents changes made to the sponsorship.
  1979  type SponsorshipChanges struct {
  1980  	Tier         *SponsorshipTier `json:"tier,omitempty"`
  1981  	PrivacyLevel *string          `json:"privacy_level,omitempty"`
  1982  }
  1983  
  1984  // SponsorshipTier represents the tier information of a sponsorship.
  1985  type SponsorshipTier struct {
  1986  	From *string `json:"from,omitempty"`
  1987  }