diff --git a/run_task.go b/run_task.go index c38c09a98..f63488292 100644 --- a/run_task.go +++ b/run_task.go @@ -48,6 +48,7 @@ type RunTask struct { URL string `jsonapi:"attr,url"` Category string `jsonapi:"attr,category"` HMACKey *string `jsonapi:"attr,hmac-key,omitempty"` + Enabled bool `jsonapi:"attr,enabled"` Organization *Organization `jsonapi:"relation,organization"` WorkspaceRunTasks []*WorkspaceRunTask `jsonapi:"relation,workspace-tasks"` @@ -102,6 +103,9 @@ type RunTaskCreateOptions struct { // Optional: An HMAC key to verify the run task HMACKey *string `jsonapi:"attr,hmac-key,omitempty"` + + // Optional: Whether the task should be enabled + Enabled *bool `jsonapi:"attr,enabled"` } // RunTaskUpdateOptions represents the set of options for updating an organization's run task @@ -123,6 +127,9 @@ type RunTaskUpdateOptions struct { // Optional: An HMAC key to verify the run task HMACKey *string `jsonapi:"attr,hmac-key,omitempty"` + + // Optional: Whether the task should be enabled + Enabled *bool `jsonapi:"attr,enabled"` } // Create is used to create a new run task for an organization diff --git a/run_task_integration_test.go b/run_task_integration_test.go index 7a1daafff..e9d08a4d3 100644 --- a/run_task_integration_test.go +++ b/run_task_integration_test.go @@ -33,6 +33,7 @@ func TestRunTasksCreate(t *testing.T) { Name: runTaskName, URL: runTaskServerURL, Category: "task", + Enabled: Bool(true), }) require.NoError(t, err) @@ -93,6 +94,7 @@ func TestRunTasksRead(t *testing.T) { assert.Equal(t, runTaskTest.URL, r.URL) assert.Equal(t, runTaskTest.Category, r.Category) assert.Equal(t, runTaskTest.HMACKey, r.HMACKey) + assert.Equal(t, runTaskTest.Enabled, r.Enabled) }) t.Run("with options", func(t *testing.T) {