github.com/go-playground/webhooks/v6@v6.3.0/bitbucket/payload.go (about)

     1  package bitbucket
     2  
     3  import "time"
     4  
     5  // RepoPushPayload is the Bitbucket repo:push payload
     6  type RepoPushPayload struct {
     7  	Actor      Owner      `json:"actor"`
     8  	Repository Repository `json:"repository"`
     9  	Push       struct {
    10  		Changes []struct {
    11  			New struct {
    12  				Type   string `json:"type"`
    13  				Name   string `json:"name"`
    14  				Target struct {
    15  					Type    string    `json:"type"`
    16  					Hash    string    `json:"hash"`
    17  					Author  Owner     `json:"author"`
    18  					Message string    `json:"message"`
    19  					Date    time.Time `json:"date"`
    20  					Parents []struct {
    21  						Type  string `json:"type"`
    22  						Hash  string `json:"hash"`
    23  						Links struct {
    24  							Self struct {
    25  								Href string `json:"href"`
    26  							} `json:"self"`
    27  							HTML struct {
    28  								Href string `json:"href"`
    29  							} `json:"html"`
    30  						} `json:"links"`
    31  					} `json:"parents"`
    32  					Links struct {
    33  						Self struct {
    34  							Href string `json:"href"`
    35  						} `json:"self"`
    36  						HTML struct {
    37  							Href string `json:"href"`
    38  						} `json:"html"`
    39  					} `json:"links"`
    40  				} `json:"target"`
    41  				Links struct {
    42  					Self struct {
    43  						Href string `json:"href"`
    44  					} `json:"self"`
    45  					Commits struct {
    46  						Href string `json:"href"`
    47  					} `json:"commits"`
    48  					HTML struct {
    49  						Href string `json:"href"`
    50  					} `json:"html"`
    51  				} `json:"links"`
    52  			} `json:"new"`
    53  			Old struct {
    54  				Type   string `json:"type"`
    55  				Name   string `json:"name"`
    56  				Target struct {
    57  					Type    string    `json:"type"`
    58  					Hash    string    `json:"hash"`
    59  					Author  Owner     `json:"author"`
    60  					Message string    `json:"message"`
    61  					Date    time.Time `json:"date"`
    62  					Parents []struct {
    63  						Type  string `json:"type"`
    64  						Hash  string `json:"hash"`
    65  						Links struct {
    66  							Self struct {
    67  								Href string `json:"href"`
    68  							} `json:"self"`
    69  							HTML struct {
    70  								Href string `json:"href"`
    71  							} `json:"html"`
    72  						} `json:"links"`
    73  					} `json:"parents"`
    74  					Links struct {
    75  						Self struct {
    76  							Href string `json:"href"`
    77  						} `json:"self"`
    78  						HTML struct {
    79  							Href string `json:"href"`
    80  						} `json:"html"`
    81  					} `json:"links"`
    82  				} `json:"target"`
    83  				Links struct {
    84  					Self struct {
    85  						Href string `json:"href"`
    86  					} `json:"self"`
    87  					Commits struct {
    88  						Href string `json:"href"`
    89  					} `json:"commits"`
    90  					HTML struct {
    91  						Href string `json:"href"`
    92  					} `json:"html"`
    93  				} `json:"links"`
    94  			} `json:"old"`
    95  			Links struct {
    96  				HTML struct {
    97  					Href string `json:"href"`
    98  				} `json:"html"`
    99  				Diff struct {
   100  					Href string `json:"href"`
   101  				} `json:"diff"`
   102  				Commits struct {
   103  					Href string `json:"href"`
   104  				} `json:"commits"`
   105  			} `json:"links"`
   106  			Created bool `json:"created"`
   107  			Forced  bool `json:"forced"`
   108  			Closed  bool `json:"closed"`
   109  			Commits []struct {
   110  				Hash    string `json:"hash"`
   111  				Type    string `json:"type"`
   112  				Message string `json:"message"`
   113  				Author  Owner  `json:"author"`
   114  				Links   struct {
   115  					Self struct {
   116  						Href string `json:"href"`
   117  					} `json:"self"`
   118  					HTML struct {
   119  						Href string `json:"href"`
   120  					} `json:"html"`
   121  				} `json:"links"`
   122  			} `json:"commits"`
   123  			Truncated bool `json:"truncated"`
   124  		} `json:"changes"`
   125  	} `json:"push"`
   126  }
   127  
   128  // RepoForkPayload is the Bitbucket repo:fork payload
   129  type RepoForkPayload struct {
   130  	Actor      Owner      `json:"actor"`
   131  	Repository Repository `json:"repository"`
   132  	Fork       Repository `json:"fork"`
   133  }
   134  
   135  // RepoUpdatedPayload is the Bitbucket repo:updated payload
   136  type RepoUpdatedPayload struct {
   137  	Actor      Owner      `json:"actor"`
   138  	Repository Repository `json:"repository"`
   139  	Changes    struct {
   140  		Name struct {
   141  			New string `json:"new"`
   142  			Old string `json:"old"`
   143  		} `json:"name"`
   144  		Website struct {
   145  			New string `json:"new"`
   146  			Old string `json:"old"`
   147  		} `json:"website"`
   148  		Language struct {
   149  			New string `json:"new"`
   150  			Old string `json:"old"`
   151  		} `json:"language"`
   152  		Links struct {
   153  			New struct {
   154  				Avatar struct {
   155  					Href string `json:"href"`
   156  				} `json:"avatar"`
   157  				Self struct {
   158  					Href string `json:"href"`
   159  				} `json:"self"`
   160  				HTML struct {
   161  					Href string `json:"href"`
   162  				} `json:"html"`
   163  			} `json:"new"`
   164  			Old struct {
   165  				Avatar struct {
   166  					Href string `json:"href"`
   167  				} `json:"avatar"`
   168  				Self struct {
   169  					Href string `json:"href"`
   170  				} `json:"self"`
   171  				HTML struct {
   172  					Href string `json:"href"`
   173  				} `json:"html"`
   174  			} `json:"old"`
   175  		} `json:"links"`
   176  		Description struct {
   177  			New string `json:"new"`
   178  			Old string `json:"old"`
   179  		} `json:"description"`
   180  		FullName struct {
   181  			New string `json:"new"`
   182  			Old string `json:"old"`
   183  		} `json:"full_name"`
   184  	} `json:"changes"`
   185  }
   186  
   187  // RepoCommitCommentCreatedPayload is the Bitbucket repo:commit_comment_created payload
   188  type RepoCommitCommentCreatedPayload struct {
   189  	Actor      Owner      `json:"actor"`
   190  	Comment    Comment    `json:"comment"`
   191  	Repository Repository `json:"repository"`
   192  	Commit     struct {
   193  		Hash string `json:"hash"`
   194  	} `json:"commit"`
   195  }
   196  
   197  // RepoCommitStatusCreatedPayload is the Bitbucket repo:commit_status_created payload
   198  type RepoCommitStatusCreatedPayload struct {
   199  	Actor        Owner      `json:"actor"`
   200  	Repository   Repository `json:"repository"`
   201  	CommitStatus struct {
   202  		Name        string    `json:"name"`
   203  		Description string    `json:"description"`
   204  		State       string    `json:"state"`
   205  		Key         string    `json:"key"`
   206  		URL         string    `json:"url"`
   207  		Type        string    `json:"type"`
   208  		CreatedOn   time.Time `json:"created_on"`
   209  		UpdatedOn   time.Time `json:"updated_on"`
   210  		Links       struct {
   211  			Commit struct {
   212  				Href string `json:"href"`
   213  			} `json:"commit"`
   214  			Self struct {
   215  				Href string `json:"href"`
   216  			} `json:"self"`
   217  		} `json:"links"`
   218  	} `json:"commit_status"`
   219  }
   220  
   221  // RepoCommitStatusUpdatedPayload is the Bitbucket repo:commit_status_updated payload
   222  type RepoCommitStatusUpdatedPayload struct {
   223  	Actor        Owner      `json:"actor"`
   224  	Repository   Repository `json:"repository"`
   225  	CommitStatus struct {
   226  		Name        string    `json:"name"`
   227  		Description string    `json:"description"`
   228  		State       string    `json:"state"`
   229  		Key         string    `json:"key"`
   230  		URL         string    `json:"url"`
   231  		Type        string    `json:"type"`
   232  		CreatedOn   time.Time `json:"created_on"`
   233  		UpdatedOn   time.Time `json:"updated_on"`
   234  		Links       struct {
   235  			Commit struct {
   236  				Href string `json:"href"`
   237  			} `json:"commit"`
   238  			Self struct {
   239  				Href string `json:"href"`
   240  			} `json:"self"`
   241  		} `json:"links"`
   242  	} `json:"commit_status"`
   243  }
   244  
   245  // IssueCreatedPayload is the Bitbucket issue:created payload
   246  type IssueCreatedPayload struct {
   247  	Actor      Owner      `json:"actor"`
   248  	Issue      Issue      `json:"issue"`
   249  	Repository Repository `json:"repository"`
   250  }
   251  
   252  // IssueUpdatedPayload is the Bitbucket issue:updated payload
   253  type IssueUpdatedPayload struct {
   254  	Actor      Owner      `json:"actor"`
   255  	Issue      Issue      `json:"issue"`
   256  	Repository Repository `json:"repository"`
   257  	Comment    Comment    `json:"comment"`
   258  	Changes    struct {
   259  		Status struct {
   260  			Old string `json:"old"`
   261  			New string `json:"new"`
   262  		} `json:"status"`
   263  	} `json:"changes"`
   264  }
   265  
   266  // IssueCommentCreatedPayload is the Bitbucket pullrequest:created payload
   267  type IssueCommentCreatedPayload struct {
   268  	Actor      Owner      `json:"actor"`
   269  	Repository Repository `json:"repository"`
   270  	Issue      Issue      `json:"issue"`
   271  	Comment    Comment    `json:"comment"`
   272  }
   273  
   274  // PullRequestCreatedPayload is the Bitbucket pullrequest:created payload
   275  type PullRequestCreatedPayload struct {
   276  	Actor       Owner       `json:"actor"`
   277  	PullRequest PullRequest `json:"pullrequest"`
   278  	Repository  Repository  `json:"repository"`
   279  }
   280  
   281  // PullRequestUpdatedPayload is the Bitbucket pullrequest:updated payload
   282  type PullRequestUpdatedPayload struct {
   283  	Actor       Owner       `json:"actor"`
   284  	PullRequest PullRequest `json:"pullrequest"`
   285  	Repository  Repository  `json:"repository"`
   286  }
   287  
   288  // PullRequestApprovedPayload is the Bitbucket pullrequest:approved payload
   289  type PullRequestApprovedPayload struct {
   290  	Actor       Owner       `json:"actor"`
   291  	PullRequest PullRequest `json:"pullrequest"`
   292  	Repository  Repository  `json:"repository"`
   293  	Approval    struct {
   294  		Date time.Time `json:"date"`
   295  		User Owner     `json:"user"`
   296  	} `json:"approval"`
   297  }
   298  
   299  // PullRequestUnapprovedPayload is the Bitbucket pullrequest:unapproved payload
   300  type PullRequestUnapprovedPayload struct {
   301  	Actor       Owner       `json:"actor"`
   302  	PullRequest PullRequest `json:"pullrequest"`
   303  	Repository  Repository  `json:"repository"`
   304  	Approval    struct {
   305  		Date time.Time `json:"date"`
   306  		User Owner     `json:"user"`
   307  	} `json:"approval"`
   308  }
   309  
   310  // PullRequestMergedPayload is the Bitbucket pullrequest:fulfilled payload
   311  type PullRequestMergedPayload struct {
   312  	Actor       Owner       `json:"actor"`
   313  	PullRequest PullRequest `json:"pullrequest"`
   314  	Repository  Repository  `json:"repository"`
   315  }
   316  
   317  // PullRequestDeclinedPayload is the Bitbucket pullrequest:rejected payload
   318  type PullRequestDeclinedPayload struct {
   319  	Actor       Owner       `json:"actor"`
   320  	PullRequest PullRequest `json:"pullrequest"`
   321  	Repository  Repository  `json:"repository"`
   322  }
   323  
   324  // PullRequestCommentCreatedPayload is the Bitbucket pullrequest:comment_updated payload
   325  type PullRequestCommentCreatedPayload struct {
   326  	Actor       Owner       `json:"actor"`
   327  	Repository  Repository  `json:"repository"`
   328  	PullRequest PullRequest `json:"pullrequest"`
   329  	Comment     Comment     `json:"comment"`
   330  }
   331  
   332  // PullRequestCommentUpdatedPayload is the Bitbucket pullrequest:comment_created payload
   333  type PullRequestCommentUpdatedPayload struct {
   334  	Actor       Owner       `json:"actor"`
   335  	Repository  Repository  `json:"repository"`
   336  	PullRequest PullRequest `json:"pullrequest"`
   337  	Comment     Comment     `json:"comment"`
   338  }
   339  
   340  // PullRequestCommentDeletedPayload is the Bitbucket pullrequest:comment_deleted payload
   341  type PullRequestCommentDeletedPayload struct {
   342  	Actor       Owner       `json:"actor"`
   343  	Repository  Repository  `json:"repository"`
   344  	PullRequest PullRequest `json:"pullrequest"`
   345  	Comment     Comment     `json:"comment"`
   346  }
   347  
   348  // Owner is the common Bitbucket Owner Sub Entity
   349  type Owner struct {
   350  	Type        string `json:"type"`
   351  	NickName    string `json:"nickname"`
   352  	DisplayName string `json:"display_name"`
   353  	AccountID   string `json:"account_id"`
   354  	UUID        string `json:"uuid"`
   355  	Links       struct {
   356  		Self struct {
   357  			Href string `json:"href"`
   358  		} `json:"self"`
   359  		HTML struct {
   360  			Href string `json:"href"`
   361  		} `json:"html"`
   362  		Avatar struct {
   363  			Href string `json:"href"`
   364  		} `json:"avatar"`
   365  	} `json:"links"`
   366  }
   367  
   368  // Repository is the common Bitbucket Repository Sub Entity
   369  type Repository struct {
   370  	Type  string `json:"type"`
   371  	Links struct {
   372  		Self struct {
   373  			Href string `json:"href"`
   374  		} `json:"self"`
   375  		HTML struct {
   376  			Href string `json:"href"`
   377  		} `json:"html"`
   378  		Avatar struct {
   379  			Href string `json:"href"`
   380  		} `json:"avatar"`
   381  	} `json:"links"`
   382  	UUID      string  `json:"uuid"`
   383  	Project   Project `json:"project"`
   384  	FullName  string  `json:"full_name"`
   385  	Name      string  `json:"name"`
   386  	Website   string  `json:"website"`
   387  	Owner     Owner   `json:"owner"`
   388  	Scm       string  `json:"scm"`
   389  	IsPrivate bool    `json:"is_private"`
   390  }
   391  
   392  // Project is the common Bitbucket Project Sub Entity
   393  type Project struct {
   394  	Type    string `json:"type"`
   395  	Project string `json:"project"`
   396  	UUID    string `json:"uuid"`
   397  	Links   struct {
   398  		HTML struct {
   399  			Href string `json:"href"`
   400  		} `json:"html"`
   401  		Avatar struct {
   402  			Href string `json:"href"`
   403  		} `json:"avatar"`
   404  	} `json:"links"`
   405  	Key string `json:"key"`
   406  }
   407  
   408  // Issue is the common Bitbucket Issue Sub Entity
   409  type Issue struct {
   410  	ID        int64  `json:"id"`
   411  	Component string `json:"component"`
   412  	Title     string `json:"title"`
   413  	Content   struct {
   414  		Raw    string `json:"raw"`
   415  		HTML   string `json:"html"`
   416  		Markup string `json:"markup"`
   417  	} `json:"content"`
   418  	Priority  string `json:"priority"`
   419  	State     string `json:"state"`
   420  	Type      string `json:"type"`
   421  	Milestone struct {
   422  		Name string `json:"name"`
   423  	} `json:"milestone"`
   424  	Version struct {
   425  		Name string `json:"name"`
   426  	} `json:"version"`
   427  	CreatedOn time.Time `json:"created_on"`
   428  	UpdatedOn time.Time `json:"updated_on"`
   429  	Links     struct {
   430  		Self struct {
   431  			Href string `json:"href"`
   432  		} `json:"self"`
   433  		HTML struct {
   434  			Href string `json:"href"`
   435  		} `json:"html"`
   436  	} `json:"links"`
   437  }
   438  
   439  // Comment is the common Bitbucket Comment Sub Entity
   440  type Comment struct {
   441  	ID     int64 `json:"id"`
   442  	Parent struct {
   443  		ID int64 `json:"id"`
   444  	} `json:"parent"`
   445  	Content struct {
   446  		Raw    string `json:"raw"`
   447  		HTML   string `json:"html"`
   448  		Markup string `json:"markup"`
   449  	} `json:"content"`
   450  	Inline struct {
   451  		Path string `json:"path"`
   452  		From *int64 `json:"from"`
   453  		To   int64  `json:"to"`
   454  	} `json:"inline"`
   455  	CreatedOn time.Time `json:"created_on"`
   456  	UpdatedOn time.Time `json:"updated_on"`
   457  	Links     struct {
   458  		Self struct {
   459  			Href string `json:"href"`
   460  		} `json:"self"`
   461  		HTML struct {
   462  			Href string `json:"href"`
   463  		} `json:"html"`
   464  	} `json:"links"`
   465  }
   466  
   467  // PullRequest is the common Bitbucket Pull Request Sub Entity
   468  type PullRequest struct {
   469  	ID          int64  `json:"id"`
   470  	Title       string `json:"title"`
   471  	Description string `json:"description"`
   472  	State       string `json:"state"`
   473  	Author      Owner  `json:"author"`
   474  	Source      struct {
   475  		Branch struct {
   476  			Name string `json:"name"`
   477  		} `json:"branch"`
   478  		Commit struct {
   479  			Hash string `json:"hash"`
   480  		} `json:"commit"`
   481  		Repository Repository `json:"repository"`
   482  	} `json:"source"`
   483  	Destination struct {
   484  		Branch struct {
   485  			Name string `json:"name"`
   486  		} `json:"branch"`
   487  		Commit struct {
   488  			Hash string `json:"hash"`
   489  		} `json:"commit"`
   490  		Repository Repository `json:"repository"`
   491  	} `json:"destination"`
   492  	MergeCommit struct {
   493  		Hash string `json:"hash"`
   494  	} `json:"merge_commit"`
   495  	Participants      []Owner   `json:"participants"`
   496  	Reviewers         []Owner   `json:"reviewers"`
   497  	CloseSourceBranch bool      `json:"close_source_branch"`
   498  	ClosedBy          Owner     `json:"closed_by"`
   499  	Reason            string    `json:"reason"`
   500  	CreatedOn         time.Time `json:"created_on"`
   501  	UpdatedOn         time.Time `json:"updated_on"`
   502  	Links             struct {
   503  		Self struct {
   504  			Href string `json:"href"`
   505  		} `json:"self"`
   506  		HTML struct {
   507  			Href string `json:"href"`
   508  		} `json:"html"`
   509  	} `json:"links"`
   510  }