Skip to content

Commit

Permalink
Add alwaysExecute and exitIfSucceed to Synthetics steps (#2761)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <[email protected]>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Nov 5, 2024
1 parent 3f66245 commit 3f1f0b8
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-11-05 15:05:36.498494",
"spec_repo_commit": "8d63eae4"
"regenerated": "2024-11-05 20:16:07.638582",
"spec_repo_commit": "1a56bfda"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-11-05 15:05:36.516859",
"spec_repo_commit": "8d63eae4"
"regenerated": "2024-11-05 20:16:07.656833",
"spec_repo_commit": "1a56bfda"
}
}
}
9 changes: 8 additions & 1 deletion .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16227,6 +16227,13 @@ components:
allowFailure:
description: A boolean set to allow this step to fail.
type: boolean
alwaysExecute:
description: A boolean set to always execute this step even if the previous
step failed or was skipped.
type: boolean
exitIfSucceed:
description: A boolean set to exit the test if the step succeeds.
type: boolean
isCritical:
description: A boolean to use in addition to `allowFailure` to determine
if the test should be marked as failed when the step fails.
Expand All @@ -16235,7 +16242,7 @@ components:
description: The name of the step.
type: string
noScreenshot:
description: A boolean set to not take a screenshot for the step.
description: A boolean set to skip taking a screenshot for the step.
type: boolean
params:
description: The parameters of the step.
Expand Down
88 changes: 79 additions & 9 deletions api/datadogV1/model_synthetics_step.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ import (
type SyntheticsStep struct {
// A boolean set to allow this step to fail.
AllowFailure *bool `json:"allowFailure,omitempty"`
// A boolean set to always execute this step even if the previous step failed or was skipped.
AlwaysExecute *bool `json:"alwaysExecute,omitempty"`
// A boolean set to exit the test if the step succeeds.
ExitIfSucceed *bool `json:"exitIfSucceed,omitempty"`
// A boolean to use in addition to `allowFailure` to determine if the test should be marked as failed when the step fails.
IsCritical *bool `json:"isCritical,omitempty"`
// The name of the step.
Name *string `json:"name,omitempty"`
// A boolean set to not take a screenshot for the step.
// A boolean set to skip taking a screenshot for the step.
NoScreenshot *bool `json:"noScreenshot,omitempty"`
// The parameters of the step.
Params interface{} `json:"params,omitempty"`
Expand Down Expand Up @@ -74,6 +78,62 @@ func (o *SyntheticsStep) SetAllowFailure(v bool) {
o.AllowFailure = &v
}

// GetAlwaysExecute returns the AlwaysExecute field value if set, zero value otherwise.
func (o *SyntheticsStep) GetAlwaysExecute() bool {
if o == nil || o.AlwaysExecute == nil {
var ret bool
return ret
}
return *o.AlwaysExecute
}

// GetAlwaysExecuteOk returns a tuple with the AlwaysExecute field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyntheticsStep) GetAlwaysExecuteOk() (*bool, bool) {
if o == nil || o.AlwaysExecute == nil {
return nil, false
}
return o.AlwaysExecute, true
}

// HasAlwaysExecute returns a boolean if a field has been set.
func (o *SyntheticsStep) HasAlwaysExecute() bool {
return o != nil && o.AlwaysExecute != nil
}

// SetAlwaysExecute gets a reference to the given bool and assigns it to the AlwaysExecute field.
func (o *SyntheticsStep) SetAlwaysExecute(v bool) {
o.AlwaysExecute = &v
}

// GetExitIfSucceed returns the ExitIfSucceed field value if set, zero value otherwise.
func (o *SyntheticsStep) GetExitIfSucceed() bool {
if o == nil || o.ExitIfSucceed == nil {
var ret bool
return ret
}
return *o.ExitIfSucceed
}

// GetExitIfSucceedOk returns a tuple with the ExitIfSucceed field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyntheticsStep) GetExitIfSucceedOk() (*bool, bool) {
if o == nil || o.ExitIfSucceed == nil {
return nil, false
}
return o.ExitIfSucceed, true
}

// HasExitIfSucceed returns a boolean if a field has been set.
func (o *SyntheticsStep) HasExitIfSucceed() bool {
return o != nil && o.ExitIfSucceed != nil
}

// SetExitIfSucceed gets a reference to the given bool and assigns it to the ExitIfSucceed field.
func (o *SyntheticsStep) SetExitIfSucceed(v bool) {
o.ExitIfSucceed = &v
}

// GetIsCritical returns the IsCritical field value if set, zero value otherwise.
func (o *SyntheticsStep) GetIsCritical() bool {
if o == nil || o.IsCritical == nil {
Expand Down Expand Up @@ -251,6 +311,12 @@ func (o SyntheticsStep) MarshalJSON() ([]byte, error) {
if o.AllowFailure != nil {
toSerialize["allowFailure"] = o.AllowFailure
}
if o.AlwaysExecute != nil {
toSerialize["alwaysExecute"] = o.AlwaysExecute
}
if o.ExitIfSucceed != nil {
toSerialize["exitIfSucceed"] = o.ExitIfSucceed
}
if o.IsCritical != nil {
toSerialize["isCritical"] = o.IsCritical
}
Expand Down Expand Up @@ -279,26 +345,30 @@ func (o SyntheticsStep) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *SyntheticsStep) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
AllowFailure *bool `json:"allowFailure,omitempty"`
IsCritical *bool `json:"isCritical,omitempty"`
Name *string `json:"name,omitempty"`
NoScreenshot *bool `json:"noScreenshot,omitempty"`
Params interface{} `json:"params,omitempty"`
Timeout *int64 `json:"timeout,omitempty"`
Type *SyntheticsStepType `json:"type,omitempty"`
AllowFailure *bool `json:"allowFailure,omitempty"`
AlwaysExecute *bool `json:"alwaysExecute,omitempty"`
ExitIfSucceed *bool `json:"exitIfSucceed,omitempty"`
IsCritical *bool `json:"isCritical,omitempty"`
Name *string `json:"name,omitempty"`
NoScreenshot *bool `json:"noScreenshot,omitempty"`
Params interface{} `json:"params,omitempty"`
Timeout *int64 `json:"timeout,omitempty"`
Type *SyntheticsStepType `json:"type,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"allowFailure", "isCritical", "name", "noScreenshot", "params", "timeout", "type"})
datadog.DeleteKeys(additionalProperties, &[]string{"allowFailure", "alwaysExecute", "exitIfSucceed", "isCritical", "name", "noScreenshot", "params", "timeout", "type"})
} else {
return err
}

hasInvalidField := false
o.AllowFailure = all.AllowFailure
o.AlwaysExecute = all.AlwaysExecute
o.ExitIfSucceed = all.ExitIfSucceed
o.IsCritical = all.IsCritical
o.Name = all.Name
o.NoScreenshot = all.NoScreenshot
Expand Down

0 comments on commit 3f1f0b8

Please sign in to comment.