@@ -16,6 +16,7 @@ type VCSRepo struct {
16
16
name string
17
17
}
18
18
19
+ // Adapted from OTF (MPL License): https://github.com/leg100/otf
19
20
type VCSConnection struct {
20
21
// Pushes to this VCS branch trigger runs. Empty string means the default
21
22
// branch is used. Ignored if TagsRegex is non-empty.
@@ -33,6 +34,7 @@ type VCSConnection struct {
33
34
AllowCLIApply bool
34
35
}
35
36
37
+ // Adapted from OTF (MPL License): https://github.com/leg100/otf
36
38
type WorkspaceVersion struct {
37
39
// Latest if true means runs use the Latest available version at time of
38
40
// creation of the run.
@@ -44,6 +46,8 @@ type WorkspaceVersion struct {
44
46
semver string
45
47
}
46
48
49
+ // Following struct and its methods have been
50
+ // Adapted from OTF (MPL License): https://github.com/leg100/otf
47
51
// If you ever marshal this domain type via jsonapi (you currently don't),
48
52
// its tags must also be valid. Fixing them anyway for completeness.
49
53
type Workspace struct {
@@ -89,10 +93,12 @@ func (ws *Workspace) Locked() bool {
89
93
90
94
// ---- JSON:API DTOs below ----
91
95
96
+ // Adapted from OTF (MPL License): https://github.com/leg100/otf
92
97
type TFEWorkspaceActions struct {
93
98
IsDestroyable bool `json:"is-destroyable"`
94
99
}
95
100
101
+ // Adapted from OTF (MPL License): https://github.com/leg100/otf
96
102
type TFEWorkspacePermissions struct {
97
103
CanDestroy bool `json:"can-destroy"`
98
104
CanForceUnlock bool `json:"can-force-unlock"`
@@ -106,6 +112,7 @@ type TFEWorkspacePermissions struct {
106
112
CanUpdateVariable bool `json:"can-update-variable"`
107
113
}
108
114
115
+ // Adapted from OTF (MPL License): https://github.com/leg100/otf
109
116
// TFEVCSRepo is carried as a single attribute object on the workspace.
110
117
type TFEVCSRepo struct {
111
118
Branch string `json:"branch"`
@@ -118,10 +125,12 @@ type TFEVCSRepo struct {
118
125
ServiceProvider string `json:"service-provider"`
119
126
}
120
127
128
+ // Adapted from OTF (MPL License): https://github.com/leg100/otf
121
129
type TFERun struct {
122
130
ID string `jsonapi:"primary,runs"`
123
131
}
124
132
133
+ // Adapted from OTF (MPL License): https://github.com/leg100/otf
125
134
type TFEWorkspace struct {
126
135
ID string `jsonapi:"primary,workspaces"`
127
136
Actions * TFEWorkspaceActions `jsonapi:"attr,actions" json:"actions"`
@@ -165,6 +174,7 @@ type TFEWorkspace struct {
165
174
Outputs []* TFEWorkspaceOutput `jsonapi:"relation,outputs" json:"outputs"`
166
175
}
167
176
177
+ // Adapted from OTF (MPL License): https://github.com/leg100/otf
168
178
type TFEWorkspaceOutput struct {
169
179
ID string `jsonapi:"primary,workspace-outputs"`
170
180
Name string `jsonapi:"attr,Name" json:"Name"`
0 commit comments