Skip to content

Commit

Permalink
SCALRCORE-32726 Add the ability to disable the Scalr backend to API/P…
Browse files Browse the repository at this point in the history
…rovider
  • Loading branch information
DayS1eeper committed Dec 17, 2024
1 parent 04afe7d commit 520118b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type Environment struct {
CostEstimationEnabled bool `jsonapi:"attr,cost-estimation-enabled"`
CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"`
Status EnvironmentStatus `jsonapi:"attr,status"`
RemoteBackend bool `jsonapi:"attr,remote-backend"`

// Relations
Account *Account `jsonapi:"relation,account"`
Expand Down Expand Up @@ -77,6 +78,7 @@ type EnvironmentCreateOptions struct {
ID string `jsonapi:"primary,environments"`
Name *string `jsonapi:"attr,name"`
CostEstimationEnabled *bool `jsonapi:"attr,cost-estimation-enabled,omitempty"`
RemoteBackend *bool `jsonapi:"attr,remote-backend,omitempty"`

// Relations
Account *Account `jsonapi:"relation,account"`
Expand Down
2 changes: 2 additions & 0 deletions environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ func TestEnvironmentsCreate(t *testing.T) {
Name: String("tst-" + randomString(t)),
Account: &Account{ID: defaultAccountID},
DefaultProviderConfigurations: []*ProviderConfiguration{provider_configuration},
RemoteBackend: Bool(false),
}

env, err := client.Environments.Create(ctx, options)
Expand All @@ -128,6 +129,7 @@ func TestEnvironmentsCreate(t *testing.T) {

assert.Equal(t, *options.Name, env.Name)
assert.Equal(t, options.Account.ID, env.Account.ID)
assert.Equal(t, false, env.RemoteBackend)
assert.Len(t, env.DefaultProviderConfigurations, 1)
assert.Equal(t, provider_configuration.ID, env.DefaultProviderConfigurations[0].ID)
})
Expand Down
8 changes: 8 additions & 0 deletions workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ type Workspace struct {
RunOperationTimeout *int `jsonapi:"attr,run-operation-timeout"`
VarFiles []string `jsonapi:"attr,var-files"`
EnvironmentType WorkspaceEnvironmentType `jsonapi:"attr,environment-type"`
TerragruntVersion string `jsonapi:"attr,terragrunt-version"`
TerragruntUseRunAll bool `jsonapi:"attr,terragrunt-use-run-all"`

// Relations
CurrentRun *Run `jsonapi:"relation,current-run"`
Expand Down Expand Up @@ -287,6 +289,9 @@ type WorkspaceCreateOptions struct {

// Specifies tags assigned to the workspace
Tags []*Tag `jsonapi:"relation,tags,omitempty"`

TerragruntVersion *string `jsonapi:"attr,terragrunt-version,omitempty"`
TerragruntUseRunAll *bool `jsonapi:"attr,terragrunt-use-run-all,omitempty"`
}

// WorkspaceVCSRepoOptions represents the configuration options of a VCS integration.
Expand Down Expand Up @@ -471,6 +476,9 @@ type WorkspaceUpdateOptions struct {

// Specifies the number of minutes run operation can be executed before termination.
RunOperationTimeout *int `jsonapi:"attr,run-operation-timeout"`

TerragruntVersion *string `jsonapi:"attr,terragrunt-version,omitempty"`
TerragruntUseRunAll *bool `jsonapi:"attr,terragrunt-use-run-all,omitempty"`
}

// Update settings of an existing workspace.
Expand Down

0 comments on commit 520118b

Please sign in to comment.