Created
July 14, 2018 23:53
-
-
Save radu-matei/221c3941059f6d39db7e38deb1afdfcf to your computer and use it in GitHub Desktop.
VSTS git events in Go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GitPushEvent models the data for a git.push event | |
type GitPushEvent struct { | |
Commits []struct { | |
CommitID string `json:"commitId"` | |
Author struct { | |
Name string `json:"name"` | |
Email string `json:"email"` | |
Date time.Time `json:"date"` | |
} `json:"author"` | |
Committer struct { | |
Name string `json:"name"` | |
Email string `json:"email"` | |
Date time.Time `json:"date"` | |
} `json:"committer"` | |
Comment string `json:"comment"` | |
URL string `json:"url"` | |
} `json:"commits"` | |
RefUpdates []struct { | |
Name string `json:"name"` | |
OldObjectID string `json:"oldObjectId"` | |
NewObjectID string `json:"newObjectId"` | |
} `json:"refUpdates"` | |
Repository struct { | |
ID string `json:"id"` | |
Name string `json:"name"` | |
URL string `json:"url"` | |
Project struct { | |
ID string `json:"id"` | |
Name string `json:"name"` | |
URL string `json:"url"` | |
State string `json:"state"` | |
} `json:"project"` | |
DefaultBranch string `json:"defaultBranch"` | |
RemoteURL string `json:"remoteUrl"` | |
} `json:"repository"` | |
PushedBy struct { | |
ID string `json:"id"` | |
DisplayName string `json:"displayName"` | |
UniqueName string `json:"uniqueName"` | |
} `json:"pushedBy"` | |
PushID int `json:"pushId"` | |
Date time.Time `json:"date"` | |
URL string `json:"url"` | |
} | |
// GitPullRequestCreated models the data for a git.pullrequest.created event | |
type GitPullRequestCreated struct { | |
Repository struct { | |
ID string `json:"id"` | |
Name string `json:"name"` | |
URL string `json:"url"` | |
Project struct { | |
ID string `json:"id"` | |
Name string `json:"name"` | |
URL string `json:"url"` | |
State string `json:"state"` | |
} `json:"project"` | |
DefaultBranch string `json:"defaultBranch"` | |
RemoteURL string `json:"remoteUrl"` | |
} `json:"repository"` | |
PullRequestID int `json:"pullRequestId"` | |
Status string `json:"status"` | |
CreatedBy struct { | |
ID string `json:"id"` | |
DisplayName string `json:"displayName"` | |
UniqueName string `json:"uniqueName"` | |
URL string `json:"url"` | |
ImageURL string `json:"imageUrl"` | |
} `json:"createdBy"` | |
CreationDate time.Time `json:"creationDate"` | |
Title string `json:"title"` | |
Description string `json:"description"` | |
SourceRefName string `json:"sourceRefName"` | |
TargetRefName string `json:"targetRefName"` | |
MergeStatus string `json:"mergeStatus"` | |
MergeID string `json:"mergeId"` | |
LastMergeSourceCommit struct { | |
CommitID string `json:"commitId"` | |
URL string `json:"url"` | |
} `json:"lastMergeSourceCommit"` | |
LastMergeTargetCommit struct { | |
CommitID string `json:"commitId"` | |
URL string `json:"url"` | |
} `json:"lastMergeTargetCommit"` | |
LastMergeCommit struct { | |
CommitID string `json:"commitId"` | |
URL string `json:"url"` | |
} `json:"lastMergeCommit"` | |
Reviewers []struct { | |
ReviewerURL interface{} `json:"reviewerUrl"` | |
Vote int `json:"vote"` | |
ID string `json:"id"` | |
DisplayName string `json:"displayName"` | |
UniqueName string `json:"uniqueName"` | |
URL string `json:"url"` | |
ImageURL string `json:"imageUrl"` | |
IsContainer bool `json:"isContainer"` | |
} `json:"reviewers"` | |
URL string `json:"url"` | |
} | |
// GitPullRequestUpdated models the data for git.pullrequest.merged and git.pullrequest.updated events | |
type GitPullRequestUpdated struct { | |
Repository struct { | |
ID string `json:"id"` | |
Name string `json:"name"` | |
URL string `json:"url"` | |
Project struct { | |
ID string `json:"id"` | |
Name string `json:"name"` | |
URL string `json:"url"` | |
State string `json:"state"` | |
} `json:"project"` | |
DefaultBranch string `json:"defaultBranch"` | |
RemoteURL string `json:"remoteUrl"` | |
} `json:"repository"` | |
PullRequestID int `json:"pullRequestId"` | |
Status string `json:"status"` | |
CreatedBy struct { | |
ID string `json:"id"` | |
DisplayName string `json:"displayName"` | |
UniqueName string `json:"uniqueName"` | |
URL string `json:"url"` | |
ImageURL string `json:"imageUrl"` | |
} `json:"createdBy"` | |
CreationDate time.Time `json:"creationDate"` | |
ClosedDate time.Time `json:"closedDate"` | |
Title string `json:"title"` | |
Description string `json:"description"` | |
SourceRefName string `json:"sourceRefName"` | |
TargetRefName string `json:"targetRefName"` | |
MergeStatus string `json:"mergeStatus"` | |
MergeID string `json:"mergeId"` | |
LastMergeSourceCommit struct { | |
CommitID string `json:"commitId"` | |
URL string `json:"url"` | |
} `json:"lastMergeSourceCommit"` | |
LastMergeTargetCommit struct { | |
CommitID string `json:"commitId"` | |
URL string `json:"url"` | |
} `json:"lastMergeTargetCommit"` | |
LastMergeCommit struct { | |
CommitID string `json:"commitId"` | |
URL string `json:"url"` | |
} `json:"lastMergeCommit"` | |
Reviewers []struct { | |
ReviewerURL interface{} `json:"reviewerUrl"` | |
Vote int `json:"vote"` | |
ID string `json:"id"` | |
DisplayName string `json:"displayName"` | |
UniqueName string `json:"uniqueName"` | |
URL string `json:"url"` | |
ImageURL string `json:"imageUrl"` | |
IsContainer bool `json:"isContainer"` | |
} `json:"reviewers"` | |
URL string `json:"url"` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment