New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support MarketeplacePurchaseEvent #789
Changes from 5 commits
bebd273
f5645e1
52e0df4
724b868
cfdf7b6
2f94801
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -268,6 +268,22 @@ type LabelEvent struct { | |
Installation *Installation `json:"installation,omitempty"` | ||
} | ||
|
||
// MarketplacePurchaseEvent is triggered when a user purchases, cancels, or changes | ||
// their GitHub Marketplace plan. | ||
// Webhook event name "marketplace_purchase". | ||
// | ||
// Github API docs: https://developer.github.com/v3/activity/events/types/#marketplacepurchaseevent | ||
type MarketplacePurchaseEvent struct { | ||
Action *string `json:"action,omitempty"` | ||
|
||
// The following fields are only populated by Webhook events. | ||
EffectiveDate *Timestamp `json:"effective_date,omitempty"` | ||
MarketplacePurchase *MarketplacePurchase `json:"marketplace_purchase,omitempty"` | ||
PreviousMarketplacePurchase *MarketplacePurchase `json:"previous_marketplace_purchase,omitempty"` | ||
Sender *User `json:"sender,omitempty"` | ||
Installation *Installation `json:"installation,omitempty"` | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You'll need to break the fields into two sections. The event API payload fields (of which, there's only one, And Webhook payload fields, which are all the rest. You should put them under a type MarketplacePurchaseEvent struct {
// Action is the action that was performed. Possible values are:
// "purchased", "cancelled", or "changed".
Action *string `json:"action,omitempty"`
// The following fields are only populated by Webhook events.
...
} See structs right above and below the one you added for reference. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Additionally, you'll need to add an implicit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay @shurcooL, will fix these. thanks 👍 . |
||
|
||
// MemberEvent is triggered when a user is added as a collaborator to a repository. | ||
// The Webhook event name is "member". | ||
// | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice to add a comment here documenting possible action values, like in the events above and below.