@@ -10,6 +10,15 @@ import (
10
10
// Compile-time proof of interface implementation.
11
11
var _ PolicySets = (* policySets )(nil )
12
12
13
+ // PolicyKind is an indicator of the underlying technology that the policy or policy set supports.
14
+ // There are two kinds documented in the enum.
15
+ type PolicyKind string
16
+
17
+ const (
18
+ OPA PolicyKind = "opa"
19
+ Sentinel PolicyKind = "sentinel"
20
+ )
21
+
13
22
// PolicySets describes all the policy set related methods that the Terraform
14
23
// Enterprise API supports.
15
24
//
@@ -61,16 +70,18 @@ type PolicySetList struct {
61
70
62
71
// PolicySet represents a Terraform Enterprise policy set.
63
72
type PolicySet struct {
64
- ID string `jsonapi:"primary,policy-sets"`
65
- Name string `jsonapi:"attr,name"`
66
- Description string `jsonapi:"attr,description"`
67
- Global bool `jsonapi:"attr,global"`
68
- PoliciesPath string `jsonapi:"attr,policies-path"`
69
- PolicyCount int `jsonapi:"attr,policy-count"`
70
- VCSRepo * VCSRepo `jsonapi:"attr,vcs-repo"`
71
- WorkspaceCount int `jsonapi:"attr,workspace-count"`
72
- CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"`
73
- UpdatedAt time.Time `jsonapi:"attr,updated-at,iso8601"`
73
+ ID string `jsonapi:"primary,policy-sets"`
74
+ Name string `jsonapi:"attr,name"`
75
+ Description string `jsonapi:"attr,description"`
76
+ Kind PolicyKind `jsonapi:"attr,kind"`
77
+ Overridable * bool `jsonapi:"attr,overridable"`
78
+ Global bool `jsonapi:"attr,global"`
79
+ PoliciesPath string `jsonapi:"attr,policies-path"`
80
+ PolicyCount int `jsonapi:"attr,policy-count"`
81
+ VCSRepo * VCSRepo `jsonapi:"attr,vcs-repo"`
82
+ WorkspaceCount int `jsonapi:"attr,workspace-count"`
83
+ CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"`
84
+ UpdatedAt time.Time `jsonapi:"attr,updated-at,iso8601"`
74
85
75
86
// Relations
76
87
// The organization to which the policy set belongs to.
@@ -105,6 +116,10 @@ type PolicySetListOptions struct {
105
116
// Optional: A search string (partial policy set name) used to filter the results.
106
117
Search string `url:"search[name],omitempty"`
107
118
119
+ // **Note: This field is still in BETA and subject to change.**
120
+ // Optional: A kind string used to filter the results by the policy set kind.
121
+ Kind PolicyKind `url:"filter[kind],omitempty"`
122
+
108
123
// Optional: A list of relations to include. See available resources
109
124
// https://www.terraform.io/cloud-docs/api-docs/policy-sets#available-related-resources
110
125
Include []PolicySetIncludeOpt `url:"include,omitempty"`
@@ -136,6 +151,14 @@ type PolicySetCreateOptions struct {
136
151
// Optional: Whether or not the policy set is global.
137
152
Global * bool `jsonapi:"attr,global,omitempty"`
138
153
154
+ // **Note: This field is still in BETA and subject to change.**
155
+ // Optional: The underlying technology that the policy set supports
156
+ Kind PolicyKind `jsonapi:"attr,kind,omitempty"`
157
+
158
+ // **Note: This field is still in BETA and subject to change.**
159
+ // Optional: Whether or not users can override this policy when it fails during a run. Only valid for OPA policies.
160
+ Overridable * bool `jsonapi:"attr,overridable,omitempty"`
161
+
139
162
// Optional: The sub-path within the attached VCS repository to ingress. All
140
163
// files and directories outside of this sub-path will be ignored.
141
164
// This option may only be specified when a VCS repo is present.
0 commit comments