Skip to content

Commit db0e234

Browse files
Fixed #643
1 parent 9eba535 commit db0e234

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

dynatrace/api/automation/workflows/settings/workflow.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ type Workflow struct {
3737
SchemaVersion int `json:"schemaVersion,omitempty"` //
3838
Trigger *Trigger `json:"trigger,omitempty"` // Configures how executions of the workflows are getting triggered. If no trigger is specified it means the workflow is getting manually triggered
3939
Tasks Tasks `json:"tasks,omitempty"` // The tasks to run for every execution of this workflow
40+
Type string `json:"type"`
4041
}
4142

4243
func (me *Workflow) Name() string {
@@ -91,6 +92,12 @@ func (me *Workflow) Schema() map[string]*schema.Schema {
9192
Required: true,
9293
Elem: &schema.Resource{Schema: new(Tasks).Schema("tasks")},
9394
},
95+
"type": {
96+
Type: schema.TypeString,
97+
Description: "The type of the workflow. Possible values are `STANDARD` and `SIMPLE`. Defaults to `STANDARD`. Workflows of type `SIMPLE` are allowed to contain only one action",
98+
Optional: true,
99+
Default: "STANDARD",
100+
},
94101
}
95102
}
96103

@@ -117,6 +124,7 @@ func (me *Workflow) MarshalHCL(properties hcl.Properties) error {
117124
"private": me.Private,
118125
"trigger": me.Trigger,
119126
"tasks": me.Tasks,
127+
"type": me.Type,
120128
})
121129
}
122130

@@ -130,6 +138,7 @@ func (me *Workflow) UnmarshalHCL(decoder hcl.Decoder) error {
130138
// "private": &me.Private,
131139
"trigger": &me.Trigger,
132140
"tasks": &me.Tasks,
141+
"type": &me.Type,
133142
}); err != nil {
134143
return err
135144
}
@@ -173,6 +182,7 @@ func (me *Workflow) MarshalJSON() ([]byte, error) {
173182
SchemaVersion int `json:"schemaVersion,omitempty"`
174183
Trigger *Trigger `json:"trigger,omitempty"`
175184
Tasks Tasks `json:"tasks,omitempty"`
185+
Type string `json:"type,omitempty"`
176186
}{
177187
SchemaVersion: SchemaVersion, // adding the Schema Version is the purpose of this custome `MarshalJSON` function
178188
Title: me.Title,

0 commit comments

Comments
 (0)