This repository has been archived by the owner on Dec 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
builds.go
68 lines (55 loc) · 2.6 KB
/
builds.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package responses
// AllBuildsResponse represents a AllBuilds response
type AllBuildsResponse struct {
URI string `json:"uri"`
Builds []struct {
URI string `json:"uri"`
LastStarted *ISO8601Time `json:"lastStarted"`
} `json:"builds"`
}
// AllBuildsResponseTestData is test data for AllBuildsResponse
const AllBuildsResponseTestData = "builds.json"
func (r AllBuildsResponse) minVersion() Version { return versionMustParse("2.2.0") }
func (r AllBuildsResponse) maxVersion() Version { return versionMustParse(CurrentVersion) }
func (r AllBuildsResponse) deprecated() bool { return false }
// BuildRunsResponse represents a Build response
type BuildRunsResponse struct {
URI string `json:"uri"`
BuildsNumbers []struct {
URI string `json:"uri"`
Started *ISO8601Time `json:"started"`
} `json:"buildsNumbers"`
}
// BuildRunsResponseTestData is test data for BuildResponse
const BuildRunsResponseTestData = "build.json"
func (r BuildRunsResponse) minVersion() Version { return versionMustParse("2.2.0") }
func (r BuildRunsResponse) maxVersion() Version { return versionMustParse(CurrentVersion) }
func (r BuildRunsResponse) deprecated() bool { return false }
// BuildInfoResponse represents a BuildInfo response
type BuildInfoResponse struct {
URI string `json:"uri"`
BuildInfo map[string]interface{} `json:"buildInfo"`
}
// BuildInfoResponseTestData is test data for BuildInfoResponse
const BuildInfoResponseTestData = "build_info.json"
func (r BuildInfoResponse) minVersion() Version { return versionMustParse("2.2.0") }
func (r BuildInfoResponse) maxVersion() Version { return versionMustParse(CurrentVersion) }
func (r BuildInfoResponse) deprecated() bool { return false }
// BuildDiffCommon represents common elements of build diffs
type BuildDiffCommon struct {
Updated []map[string]interface{} `json:"updated"`
Unchanged []map[string]interface{} `json:"unchanged"`
Removed []map[string]interface{} `json:"removed"`
New []map[string]interface{} `json:"new"`
}
// BuildDiffResponse represents a BuildDiff response
type BuildDiffResponse struct {
Artifacts BuildDiffCommon `json:"artifacts"`
Dependencies BuildDiffCommon `json:"dependencies"`
Properties BuildDiffCommon `json:"properties"`
}
// BuildDiffResponseTestData is test data for BuildDiffResponse
const BuildDiffResponseTestData = "build_diff.json"
func (r BuildDiffResponse) minVersion() Version { return versionMustParse("2.6.6") }
func (r BuildDiffResponse) maxVersion() Version { return versionMustParse(CurrentVersion) }
func (r BuildDiffResponse) deprecated() bool { return false }