diff --git a/organization_tags.go b/organization_tags.go index 5434b70b6..bbf756f74 100644 --- a/organization_tags.go +++ b/organization_tags.go @@ -48,17 +48,11 @@ type OrganizationTag struct { Organization *Organization `jsonapi:"relation,organization"` } -type OrgTagsIncludeOp string - -const OrgTagsEntitlementSet OrgTagsIncludeOp = "entitlement_set" - // OrganizationTagsListOptions represents the options for listing organization tags type OrganizationTagsListOptions struct { ListOptions // Optional: Filter string `url:"filter[exclude][taggable][id],omitempty"` - - Include []OrgTagsIncludeOp `url:"include,omitempty"` } // OrganizationTagsDeleteOptions represents the request body for deleting a tag in an organization diff --git a/policy.go b/policy.go index 1da156a94..49a293a5a 100644 --- a/policy.go +++ b/policy.go @@ -84,18 +84,12 @@ type EnforcementOptions struct { Mode *EnforcementLevel `json:"mode"` } -type PolicyIncludeOp string - -const PolicyPolicySets PolicyIncludeOp = "policy_sets" - // PolicyListOptions represents the options for listing policies. type PolicyListOptions struct { ListOptions // Optional: A search string (partial policy name) used to filter the results. Search string `url:"search[name],omitempty"` - - Include []PolicyIncludeOp `url:"include,omitempty"` } // PolicyCreateOptions represents the options for creating a new policy. diff --git a/policy_check.go b/policy_check.go index ee51ebfdf..13fe861ef 100644 --- a/policy_check.go +++ b/policy_check.go @@ -110,6 +110,7 @@ type PolicyStatusTimestamps struct { SoftFailedAt time.Time `jsonapi:"attr,soft-failed-at,rfc3339"` } +// A list of relations to include type PolicyCheckIncludeOp string const ( @@ -121,7 +122,7 @@ const ( type PolicyCheckListOptions struct { ListOptions - Include []PolicyCheckIncludeOp `url:"include,omitempty"` + Include []PolicyCheckIncludeOp `url:"include,omitempty"` // optional } // List all policy checks of the given run. diff --git a/policy_check_integration_test.go b/policy_check_integration_test.go index d9e41f51e..09aff362b 100644 --- a/policy_check_integration_test.go +++ b/policy_check_integration_test.go @@ -63,6 +63,14 @@ func TestPolicyChecksList(t *testing.T) { assert.Equal(t, 1, pcl.TotalCount) }) + t.Run("with Include option", func(t *testing.T) { + pcl, err := client.PolicyChecks.List(ctx, rTest.ID, &PolicyCheckListOptions{ + Include: []PolicyCheckIncludeOp{PolicyCheckRun}, + }) + require.NoError(t, err) + assert.NotEmpty(t, pcl.Items[0].Run.Status) + }) + t.Run("without a valid run ID", func(t *testing.T) { pcl, err := client.PolicyChecks.List(ctx, badIdentifier, nil) assert.Nil(t, pcl)