Skip to content

Commit 3794619

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add readonly ID of synthetics test steps (DataDog#3326)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 8af659a commit 3794619

3 files changed

Lines changed: 82 additions & 2 deletions

File tree

.generator/schemas/v1/openapi.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14413,6 +14413,11 @@ components:
1441314413
extractedValuesFromScript:
1441414414
description: Generate variables using JavaScript.
1441514415
type: string
14416+
id:
14417+
description: ID of the step.
14418+
example: abc-def-123
14419+
readOnly: true
14420+
type: string
1441614421
isCritical:
1441714422
description: 'Determines whether or not to consider the entire test as failed
1441814423
if this step fails.
@@ -14469,6 +14474,11 @@ components:
1446914474
SyntheticsAPIWaitStep:
1447014475
description: The Wait step used in a Synthetic multi-step API test.
1447114476
properties:
14477+
id:
14478+
description: ID of the step.
14479+
example: abc-def-123
14480+
readOnly: true
14481+
type: string
1447214482
name:
1447314483
description: The name of the step.
1447414484
example: Example step name

api/datadogV1/model_synthetics_api_test_step.go

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ type SyntheticsAPITestStep struct {
2222
ExtractedValues []SyntheticsParsingOptions `json:"extractedValues,omitempty"`
2323
// Generate variables using JavaScript.
2424
ExtractedValuesFromScript *string `json:"extractedValuesFromScript,omitempty"`
25+
// ID of the step.
26+
Id *string `json:"id,omitempty"`
2527
// Determines whether or not to consider the entire test as failed if this step fails.
2628
// Can be used only if `allowFailure` is `true`.
2729
IsCritical *bool `json:"isCritical,omitempty"`
@@ -194,6 +196,34 @@ func (o *SyntheticsAPITestStep) SetExtractedValuesFromScript(v string) {
194196
o.ExtractedValuesFromScript = &v
195197
}
196198

199+
// GetId returns the Id field value if set, zero value otherwise.
200+
func (o *SyntheticsAPITestStep) GetId() string {
201+
if o == nil || o.Id == nil {
202+
var ret string
203+
return ret
204+
}
205+
return *o.Id
206+
}
207+
208+
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
209+
// and a boolean to check if the value has been set.
210+
func (o *SyntheticsAPITestStep) GetIdOk() (*string, bool) {
211+
if o == nil || o.Id == nil {
212+
return nil, false
213+
}
214+
return o.Id, true
215+
}
216+
217+
// HasId returns a boolean if a field has been set.
218+
func (o *SyntheticsAPITestStep) HasId() bool {
219+
return o != nil && o.Id != nil
220+
}
221+
222+
// SetId gets a reference to the given string and assigns it to the Id field.
223+
func (o *SyntheticsAPITestStep) SetId(v string) {
224+
o.Id = &v
225+
}
226+
197227
// GetIsCritical returns the IsCritical field value if set, zero value otherwise.
198228
func (o *SyntheticsAPITestStep) GetIsCritical() bool {
199229
if o == nil || o.IsCritical == nil {
@@ -338,6 +368,9 @@ func (o SyntheticsAPITestStep) MarshalJSON() ([]byte, error) {
338368
if o.ExtractedValuesFromScript != nil {
339369
toSerialize["extractedValuesFromScript"] = o.ExtractedValuesFromScript
340370
}
371+
if o.Id != nil {
372+
toSerialize["id"] = o.Id
373+
}
341374
if o.IsCritical != nil {
342375
toSerialize["isCritical"] = o.IsCritical
343376
}
@@ -362,6 +395,7 @@ func (o *SyntheticsAPITestStep) UnmarshalJSON(bytes []byte) (err error) {
362395
ExitIfSucceed *bool `json:"exitIfSucceed,omitempty"`
363396
ExtractedValues []SyntheticsParsingOptions `json:"extractedValues,omitempty"`
364397
ExtractedValuesFromScript *string `json:"extractedValuesFromScript,omitempty"`
398+
Id *string `json:"id,omitempty"`
365399
IsCritical *bool `json:"isCritical,omitempty"`
366400
Name *string `json:"name"`
367401
Request *SyntheticsTestRequest `json:"request"`
@@ -385,7 +419,7 @@ func (o *SyntheticsAPITestStep) UnmarshalJSON(bytes []byte) (err error) {
385419
}
386420
additionalProperties := make(map[string]interface{})
387421
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
388-
datadog.DeleteKeys(additionalProperties, &[]string{"allowFailure", "assertions", "exitIfSucceed", "extractedValues", "extractedValuesFromScript", "isCritical", "name", "request", "retry", "subtype"})
422+
datadog.DeleteKeys(additionalProperties, &[]string{"allowFailure", "assertions", "exitIfSucceed", "extractedValues", "extractedValuesFromScript", "id", "isCritical", "name", "request", "retry", "subtype"})
389423
} else {
390424
return err
391425
}
@@ -396,6 +430,7 @@ func (o *SyntheticsAPITestStep) UnmarshalJSON(bytes []byte) (err error) {
396430
o.ExitIfSucceed = all.ExitIfSucceed
397431
o.ExtractedValues = all.ExtractedValues
398432
o.ExtractedValuesFromScript = all.ExtractedValuesFromScript
433+
o.Id = all.Id
399434
o.IsCritical = all.IsCritical
400435
o.Name = *all.Name
401436
if all.Request.UnparsedObject != nil && o.UnparsedObject == nil {

api/datadogV1/model_synthetics_api_wait_step.go

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import (
1212

1313
// SyntheticsAPIWaitStep The Wait step used in a Synthetic multi-step API test.
1414
type SyntheticsAPIWaitStep struct {
15+
// ID of the step.
16+
Id *string `json:"id,omitempty"`
1517
// The name of the step.
1618
Name string `json:"name"`
1719
// The subtype of the Synthetic multi-step API wait step.
@@ -43,6 +45,34 @@ func NewSyntheticsAPIWaitStepWithDefaults() *SyntheticsAPIWaitStep {
4345
return &this
4446
}
4547

48+
// GetId returns the Id field value if set, zero value otherwise.
49+
func (o *SyntheticsAPIWaitStep) GetId() string {
50+
if o == nil || o.Id == nil {
51+
var ret string
52+
return ret
53+
}
54+
return *o.Id
55+
}
56+
57+
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
58+
// and a boolean to check if the value has been set.
59+
func (o *SyntheticsAPIWaitStep) GetIdOk() (*string, bool) {
60+
if o == nil || o.Id == nil {
61+
return nil, false
62+
}
63+
return o.Id, true
64+
}
65+
66+
// HasId returns a boolean if a field has been set.
67+
func (o *SyntheticsAPIWaitStep) HasId() bool {
68+
return o != nil && o.Id != nil
69+
}
70+
71+
// SetId gets a reference to the given string and assigns it to the Id field.
72+
func (o *SyntheticsAPIWaitStep) SetId(v string) {
73+
o.Id = &v
74+
}
75+
4676
// GetName returns the Name field value.
4777
func (o *SyntheticsAPIWaitStep) GetName() string {
4878
if o == nil {
@@ -118,6 +148,9 @@ func (o SyntheticsAPIWaitStep) MarshalJSON() ([]byte, error) {
118148
if o.UnparsedObject != nil {
119149
return datadog.Marshal(o.UnparsedObject)
120150
}
151+
if o.Id != nil {
152+
toSerialize["id"] = o.Id
153+
}
121154
toSerialize["name"] = o.Name
122155
toSerialize["subtype"] = o.Subtype
123156
toSerialize["value"] = o.Value
@@ -131,6 +164,7 @@ func (o SyntheticsAPIWaitStep) MarshalJSON() ([]byte, error) {
131164
// UnmarshalJSON deserializes the given payload.
132165
func (o *SyntheticsAPIWaitStep) UnmarshalJSON(bytes []byte) (err error) {
133166
all := struct {
167+
Id *string `json:"id,omitempty"`
134168
Name *string `json:"name"`
135169
Subtype *SyntheticsAPIWaitStepSubtype `json:"subtype"`
136170
Value *int32 `json:"value"`
@@ -149,12 +183,13 @@ func (o *SyntheticsAPIWaitStep) UnmarshalJSON(bytes []byte) (err error) {
149183
}
150184
additionalProperties := make(map[string]interface{})
151185
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
152-
datadog.DeleteKeys(additionalProperties, &[]string{"name", "subtype", "value"})
186+
datadog.DeleteKeys(additionalProperties, &[]string{"id", "name", "subtype", "value"})
153187
} else {
154188
return err
155189
}
156190

157191
hasInvalidField := false
192+
o.Id = all.Id
158193
o.Name = *all.Name
159194
if !all.Subtype.IsValid() {
160195
hasInvalidField = true

0 commit comments

Comments
 (0)