@@ -73,18 +73,20 @@ type PolicySetList struct {
73
73
74
74
// PolicySet represents a Terraform Enterprise policy set.
75
75
type PolicySet struct {
76
- ID string `jsonapi:"primary,policy-sets"`
77
- Name string `jsonapi:"attr,name"`
78
- Description string `jsonapi:"attr,description"`
79
- Kind PolicyKind `jsonapi:"attr,kind"`
80
- Overridable * bool `jsonapi:"attr,overridable"`
81
- Global bool `jsonapi:"attr,global"`
82
- PoliciesPath string `jsonapi:"attr,policies-path"`
83
- PolicyCount int `jsonapi:"attr,policy-count"`
84
- VCSRepo * VCSRepo `jsonapi:"attr,vcs-repo"`
85
- WorkspaceCount int `jsonapi:"attr,workspace-count"`
86
- CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"`
87
- UpdatedAt time.Time `jsonapi:"attr,updated-at,iso8601"`
76
+ ID string `jsonapi:"primary,policy-sets"`
77
+ Name string `jsonapi:"attr,name"`
78
+ Description string `jsonapi:"attr,description"`
79
+ Kind PolicyKind `jsonapi:"attr,kind"`
80
+ Overridable * bool `jsonapi:"attr,overridable"`
81
+ Global bool `jsonapi:"attr,global"`
82
+ PoliciesPath string `jsonapi:"attr,policies-path"`
83
+ // **Note: This field is still in BETA and subject to change.**
84
+ PolicyCount int `jsonapi:"attr,policy-count"`
85
+ VCSRepo * VCSRepo `jsonapi:"attr,vcs-repo"`
86
+ WorkspaceCount int `jsonapi:"attr,workspace-count"`
87
+ ProjectCount int `jsonapi:"attr,project-count"`
88
+ CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"`
89
+ UpdatedAt time.Time `jsonapi:"attr,updated-at,iso8601"`
88
90
89
91
// Relations
90
92
// The organization to which the policy set belongs to.
@@ -99,6 +101,9 @@ type PolicySet struct {
99
101
NewestVersion * PolicySetVersion `jsonapi:"relation,newest-version"`
100
102
// The most recent successful policy set version.
101
103
CurrentVersion * PolicySetVersion `jsonapi:"relation,current-version"`
104
+ // **Note: This field is still in BETA and subject to change.**
105
+ // The projects to which the policy set applies.
106
+ Projects []* Project `jsonapi:"relation,projects"`
102
107
}
103
108
104
109
// PolicySetIncludeOpt represents the available options for include query params.
@@ -110,6 +115,8 @@ const (
110
115
PolicySetWorkspaces PolicySetIncludeOpt = "workspaces"
111
116
PolicySetCurrentVersion PolicySetIncludeOpt = "current_version"
112
117
PolicySetNewestVersion PolicySetIncludeOpt = "newest_version"
118
+ // **Note: This field is still in BETA and subject to change.**
119
+ PolicySetProjects PolicySetIncludeOpt = "projects"
113
120
)
114
121
115
122
// PolicySetListOptions represents the options for listing policy sets.
@@ -179,6 +186,10 @@ type PolicySetCreateOptions struct {
179
186
180
187
// Optional: The initial list of workspaces for which the policy set should be enforced.
181
188
Workspaces []* Workspace `jsonapi:"relation,workspaces,omitempty"`
189
+
190
+ // **Note: This field is still in BETA and subject to change.**
191
+ // Optional: The initial list of projects for which the policy set should be enforced.
192
+ Projects []* Project `jsonapi:"relation,projects,omitempty"`
182
193
}
183
194
184
195
// PolicySetUpdateOptions represents the options for updating a policy set.
@@ -501,7 +512,7 @@ func (o *PolicySetReadOptions) valid() error {
501
512
func validatePolicySetIncludeParams (params []PolicySetIncludeOpt ) error {
502
513
for _ , p := range params {
503
514
switch p {
504
- case PolicySetPolicies , PolicySetWorkspaces , PolicySetCurrentVersion , PolicySetNewestVersion :
515
+ case PolicySetPolicies , PolicySetWorkspaces , PolicySetCurrentVersion , PolicySetNewestVersion , PolicySetProjects :
505
516
// do nothing
506
517
default :
507
518
return ErrInvalidIncludeValue
0 commit comments