diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c7bd0af7..8a4f1bc41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Adds support for reading current state version outputs to StateVersionOutputs, which can be useful for reading outputs when users don't have the necessary permissions to read the entire state. * Adds Variable Set methods for `ApplyToWorkspaces` and `RemoveFromWorkspaces` [#375](https://github.com/hashicorp/go-tfe/pull/375) +* Adds Run Tasks API support by @glennsarti [#381](https://github.com/hashicorp/go-tfe/pull/381), [#382](https://github.com/hashicorp/go-tfe/pull/382) and [#383](https://github.com/hashicorp/go-tfe/pull/383) # v1.1.0 diff --git a/organization.go b/organization.go index 7c17ea885..8b3b3941b 100644 --- a/organization.go +++ b/organization.go @@ -94,6 +94,7 @@ type Entitlements struct { CostEstimation bool `jsonapi:"attr,cost-estimation"` Operations bool `jsonapi:"attr,operations"` PrivateModuleRegistry bool `jsonapi:"attr,private-module-registry"` + RunTasks bool `jsonapi:"attr,run-tasks"` SSO bool `jsonapi:"attr,sso"` Sentinel bool `jsonapi:"attr,sentinel"` StateStorage bool `jsonapi:"attr,state-storage"` diff --git a/organization_integration_test.go b/organization_integration_test.go index e6a5d8062..f84fe653d 100644 --- a/organization_integration_test.go +++ b/organization_integration_test.go @@ -481,3 +481,23 @@ func TestOrganizationsReadRunTasksPermission(t *testing.T) { }) }) } + +func TestOrganizationsReadRunTasksEntitlement(t *testing.T) { + skipIfEnterprise(t) + skipIfFreeOnly(t) + skipIfBeta(t) + + client := testClient(t) + ctx := context.Background() + + orgTest, orgTestCleanup := createOrganization(t, client) + defer orgTestCleanup() + + t.Run("when the org exists", func(t *testing.T) { + entitlements, err := client.Organizations.ReadEntitlements(ctx, orgTest.Name) + require.NoError(t, err) + + assert.NotEmpty(t, entitlements.ID) + assert.True(t, entitlements.RunTasks) + }) +}