@@ -16,6 +16,7 @@ type VCSRepo struct {
1616 name string
1717}
1818
19+ // Adapted from OTF (MPL License): https://github.com/leg100/otf
1920type VCSConnection struct {
2021 // Pushes to this VCS branch trigger runs. Empty string means the default
2122 // branch is used. Ignored if TagsRegex is non-empty.
@@ -33,6 +34,7 @@ type VCSConnection struct {
3334 AllowCLIApply bool
3435}
3536
37+ // Adapted from OTF (MPL License): https://github.com/leg100/otf
3638type WorkspaceVersion struct {
3739 // Latest if true means runs use the Latest available version at time of
3840 // creation of the run.
@@ -44,6 +46,8 @@ type WorkspaceVersion struct {
4446 semver string
4547}
4648
49+ // Following struct and its methods have been
50+ // Adapted from OTF (MPL License): https://github.com/leg100/otf
4751// If you ever marshal this domain type via jsonapi (you currently don't),
4852// its tags must also be valid. Fixing them anyway for completeness.
4953type Workspace struct {
@@ -89,10 +93,12 @@ func (ws *Workspace) Locked() bool {
8993
9094// ---- JSON:API DTOs below ----
9195
96+ // Adapted from OTF (MPL License): https://github.com/leg100/otf
9297type TFEWorkspaceActions struct {
9398 IsDestroyable bool `json:"is-destroyable"`
9499}
95100
101+ // Adapted from OTF (MPL License): https://github.com/leg100/otf
96102type TFEWorkspacePermissions struct {
97103 CanDestroy bool `json:"can-destroy"`
98104 CanForceUnlock bool `json:"can-force-unlock"`
@@ -106,6 +112,7 @@ type TFEWorkspacePermissions struct {
106112 CanUpdateVariable bool `json:"can-update-variable"`
107113}
108114
115+ // Adapted from OTF (MPL License): https://github.com/leg100/otf
109116// TFEVCSRepo is carried as a single attribute object on the workspace.
110117type TFEVCSRepo struct {
111118 Branch string `json:"branch"`
@@ -118,10 +125,12 @@ type TFEVCSRepo struct {
118125 ServiceProvider string `json:"service-provider"`
119126}
120127
128+ // Adapted from OTF (MPL License): https://github.com/leg100/otf
121129type TFERun struct {
122130 ID string `jsonapi:"primary,runs"`
123131}
124132
133+ // Adapted from OTF (MPL License): https://github.com/leg100/otf
125134type TFEWorkspace struct {
126135 ID string `jsonapi:"primary,workspaces"`
127136 Actions * TFEWorkspaceActions `jsonapi:"attr,actions" json:"actions"`
@@ -165,6 +174,7 @@ type TFEWorkspace struct {
165174 Outputs []* TFEWorkspaceOutput `jsonapi:"relation,outputs" json:"outputs"`
166175}
167176
177+ // Adapted from OTF (MPL License): https://github.com/leg100/otf
168178type TFEWorkspaceOutput struct {
169179 ID string `jsonapi:"primary,workspace-outputs"`
170180 Name string `jsonapi:"attr,Name" json:"Name"`
0 commit comments