Skip to content

Commit

Permalink
Expose properties in DifferentialDiff entities (#36)
Browse files Browse the repository at this point in the history
Co-authored-by: Ruben Rizzi <[email protected]>
  • Loading branch information
raynor85 and Ruben Rizzi authored Feb 5, 2024
1 parent 5a53f30 commit ac84f09
Showing 1 changed file with 29 additions and 16 deletions.
45 changes: 29 additions & 16 deletions entities/differential.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,23 @@ type DifferentialRevision struct {

// A DifferentialDiff represents a diff in Differential.
type DifferentialDiff struct {
ID string `json:"id"`
RevisionID string `json:"revisionID"`
DateCreated util.UnixTimestamp `json:"dateCreated"`
DateModified util.UnixTimestamp `json:"dateModified"`
SourceControlBaseRevision string `json:"sourceControlBaseRevision"`
SourceControlPath string `json:"sourceControlPath"`
SourceControlSystem string `json:"sourceControlSystem"`
Branch string `json:"branch"`
Bookmark string `json:"bookmark"`
CreationMethod string `json:"creationMethod"`
Description string `json:"description"`
UnitStatus string `json:"unitStatus"`
LintStatus string `json:"lintStatus"`
Changes []DifferentialChange `json:"changes"`
AuthorName string `json:"authorName"`
AuthorEmail string `json:"authorEmail"`
ID string `json:"id"`
RevisionID string `json:"revisionID"`
DateCreated util.UnixTimestamp `json:"dateCreated"`
DateModified util.UnixTimestamp `json:"dateModified"`
SourceControlBaseRevision string `json:"sourceControlBaseRevision"`
SourceControlPath string `json:"sourceControlPath"`
SourceControlSystem string `json:"sourceControlSystem"`
Branch string `json:"branch"`
Bookmark string `json:"bookmark"`
CreationMethod string `json:"creationMethod"`
Description string `json:"description"`
UnitStatus string `json:"unitStatus"`
LintStatus string `json:"lintStatus"`
Changes []DifferentialChange `json:"changes"`
Properties DifferentialProperties `json:"properties"`
AuthorName string `json:"authorName"`
AuthorEmail string `json:"authorEmail"`
}

// A DifferentialChange represents a change to a file in Differential.
Expand All @@ -69,6 +70,18 @@ type DifferentialHunk struct {
Corpus string `json:"corpus"`
}

// A DifferentialProperties contains dynamic metadata about the Diff.
type DifferentialProperties struct {
ArcOnto []DifferentialArcOnto `json:"arc:onto"`
}

// A DifferentialArcOnto contains a list of branch destinations set with arc.
type DifferentialArcOnto struct {
Type string `json:"type"`
Name string `json:"name"`
Kind string `json:"kind"`
}

// A DifferentialRawDiff is a raw diff.
type DifferentialRawDiff struct {
Diff string `json:"diff"`
Expand Down

0 comments on commit ac84f09

Please sign in to comment.