@@ -91,6 +91,7 @@ type PayloadCommit struct {
91
91
92
92
var (
93
93
_ Payloader = & CreatePayload {}
94
+ _ Payloader = & DeletePayload {}
94
95
_ Payloader = & PushPayload {}
95
96
_ Payloader = & PullRequestPayload {}
96
97
)
@@ -103,10 +104,11 @@ var (
103
104
// \/ \/ \/ \/
104
105
105
106
type CreatePayload struct {
106
- Ref string `json:"ref"`
107
- RefType string `json:"ref_type"`
108
- Repo * Repository `json:"repository"`
109
- Sender * User `json:"sender"`
107
+ Ref string `json:"ref"`
108
+ RefType string `json:"ref_type"`
109
+ DefaultBranch string `json:"default_branch"`
110
+ Repo * Repository `json:"repository"`
111
+ Sender * User `json:"sender"`
110
112
}
111
113
112
114
func (p * CreatePayload ) JSONPayload () ([]byte , error ) {
@@ -133,6 +135,31 @@ func ParseCreateHook(raw []byte) (*CreatePayload, error) {
133
135
return hook , nil
134
136
}
135
137
138
+ // ________ .__ __
139
+ // \______ \ ____ | | _____/ |_ ____
140
+ // | | \_/ __ \| | _/ __ \ __\/ __ \
141
+ // | ` \ ___/| |_\ ___/| | \ ___/
142
+ // /_______ /\___ >____/\___ >__| \___ >
143
+ // \/ \/ \/ \/
144
+
145
+ type PusherType string
146
+
147
+ const (
148
+ PUSHER_TYPE_USER PusherType = "user"
149
+ )
150
+
151
+ type DeletePayload struct {
152
+ Ref string `json:"ref"`
153
+ RefType string `json:"ref_type"`
154
+ PusherType PusherType `json:"pusher_type"`
155
+ Repo * Repository `json:"repository"`
156
+ Sender * User `json:"sender"`
157
+ }
158
+
159
+ func (p * DeletePayload ) JSONPayload () ([]byte , error ) {
160
+ return json .MarshalIndent (p , "" , " " )
161
+ }
162
+
136
163
// __________ .__
137
164
// \______ \__ __ _____| |__
138
165
// | ___/ | \/ ___/ | \
0 commit comments