Skip to content

Commit

Permalink
Add IsDestroy attr to the RunCreateOption
Browse files Browse the repository at this point in the history
  • Loading branch information
vmotso committed Dec 23, 2023
1 parent cb4186a commit 5cb5898
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion run.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type runs struct {
// RunStatus represents a run state.
type RunStatus string

//List all available run statuses.
// List all available run statuses.
const (
RunApplied RunStatus = "applied"
RunApplyQueued RunStatus = "apply_queued"
Expand Down Expand Up @@ -90,6 +90,7 @@ type RunCreateOptions struct {
ConfigurationVersion *ConfigurationVersion `jsonapi:"relation,configuration-version"`
// Specifies the workspace where the run will be executed.
Workspace *Workspace `jsonapi:"relation,workspace"`
IsDestroy *bool `jsonapi:"attr,is-destroy,omitempty"`
}

func (o RunCreateOptions) valid() error {
Expand All @@ -99,6 +100,7 @@ func (o RunCreateOptions) valid() error {
if !validStringID(&o.Workspace.ID) {
return errors.New("invalid value for workspace ID")
}
// TODO: CV is not required, if it is omitted run will be triggered from the latest.
if o.ConfigurationVersion == nil {
return errors.New("configuration-version is required")
}
Expand Down

0 comments on commit 5cb5898

Please sign in to comment.