From e1eb23ac6fccc10f3d3dabc051af35457ec53e0e Mon Sep 17 00:00:00 2001 From: uturunku1 Date: Thu, 3 Mar 2022 08:21:37 -0800 Subject: [PATCH] remove include field from listoptions in policy set --- agent_pool_integration_test.go | 14 +++++++------- policy_set.go | 17 ----------------- policy_set_integration_test.go | 8 -------- 3 files changed, 7 insertions(+), 32 deletions(-) diff --git a/agent_pool_integration_test.go b/agent_pool_integration_test.go index d05802bd0..85082213a 100644 --- a/agent_pool_integration_test.go +++ b/agent_pool_integration_test.go @@ -115,13 +115,6 @@ func TestAgentPoolsRead(t *testing.T) { pool, poolCleanup := createAgentPool(t, client, orgTest) defer poolCleanup() - wTest, wTestCleanup := createWorkspaceWithVCS(t, client, orgTest, WorkspaceCreateOptions{ - Name: String("foo"), - ExecutionMode: String("agent"), - AgentPoolID: String(pool.ID), - }) - defer wTestCleanup() - t.Run("when the agent pool exists", func(t *testing.T) { k, err := client.AgentPools.Read(ctx, pool.ID) require.NoError(t, err) @@ -147,6 +140,13 @@ func TestAgentPoolsRead(t *testing.T) { // AgentPoolID: String(pool.ID), // }) + wTest, wTestCleanup := createWorkspaceWithVCS(t, client, orgTest, WorkspaceCreateOptions{ + Name: String("foo"), + ExecutionMode: String("agent"), + AgentPoolID: String(pool.ID), + }) + defer wTestCleanup() + fmt.Println(wTest.AgentPoolID) k, err := client.AgentPools.ReadWithOptions(ctx, pool.ID, &AgentPoolReadOptions{ diff --git a/policy_set.go b/policy_set.go index cd537d00b..26157fbc8 100644 --- a/policy_set.go +++ b/policy_set.go @@ -103,8 +103,6 @@ type PolicySetListOptions struct { // Optional: A search string (partial policy set name) used to filter the results. Search string `url:"search[name],omitempty"` - - Include []PolicySetIncludeOpt `url:"include,omitempty"` } // PolicySetReadOptions are read options. @@ -216,9 +214,6 @@ func (s *policySets) List(ctx context.Context, organization string, options *Pol if !validStringID(&organization) { return nil, ErrInvalidOrg } - if err := options.valid(); err != nil { - return nil, err - } u := fmt.Sprintf("organizations/%s/policy-sets", url.QueryEscape(organization)) req, err := s.client.newRequest("GET", u, options) @@ -456,18 +451,6 @@ func (o PolicySetAddWorkspacesOptions) valid() error { return nil } -func (o *PolicySetListOptions) valid() error { - if o == nil { - return nil // nothing to validate - } - - if err := validatePolicySetIncludeParams(o.Include); err != nil { - return err - } - - return nil -} - func (o *PolicySetReadOptions) valid() error { if o == nil { return nil // nothing to validate diff --git a/policy_set_integration_test.go b/policy_set_integration_test.go index 463cfc52e..340c1c8ae 100644 --- a/policy_set_integration_test.go +++ b/policy_set_integration_test.go @@ -68,14 +68,6 @@ func TestPolicySetsList(t *testing.T) { assert.Equal(t, 1, psl.TotalCount) }) - t.Run("with Include option", func(t *testing.T) { - psl, err := client.PolicySets.List(ctx, orgTest.Name, &PolicySetListOptions{ - Include: []PolicySetIncludeOpt{PolicySetWorkspaces}, - }) - require.NoError(t, err) - assert.NotEmpty(t, psl.Items[0].Workspaces[0].Name) - }) - t.Run("without a valid organization", func(t *testing.T) { ps, err := client.PolicySets.List(ctx, badIdentifier, nil) assert.Nil(t, ps)