Skip to content

Commit e60f30b

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add synthetics browser step public_id field (#2709)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 2a26be6 commit e60f30b

File tree

6 files changed

+51
-12
lines changed

6 files changed

+51
-12
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-12-19 07:26:27.191303",
8-
"spec_repo_commit": "5dd2cbe4"
7+
"regenerated": "2024-12-23 17:20:35.684562",
8+
"spec_repo_commit": "19946d35"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-12-19 07:26:27.207255",
13-
"spec_repo_commit": "5dd2cbe4"
12+
"regenerated": "2024-12-23 17:20:35.701251",
13+
"spec_repo_commit": "19946d35"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16274,6 +16274,9 @@ components:
1627416274
params:
1627516275
description: The parameters of the step.
1627616276
type: object
16277+
public_id:
16278+
description: The public ID of the step.
16279+
type: string
1627716280
timeout:
1627816281
description: The time before declaring a step failed.
1627916282
format: int64

api/datadogV1/model_synthetics_step.go

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ type SyntheticsStep struct {
2424
NoScreenshot *bool `json:"noScreenshot,omitempty"`
2525
// The parameters of the step.
2626
Params interface{} `json:"params,omitempty"`
27+
// The public ID of the step.
28+
PublicId *string `json:"public_id,omitempty"`
2729
// The time before declaring a step failed.
2830
Timeout *int64 `json:"timeout,omitempty"`
2931
// Step type used in your Synthetic test.
@@ -246,6 +248,34 @@ func (o *SyntheticsStep) SetParams(v interface{}) {
246248
o.Params = v
247249
}
248250

251+
// GetPublicId returns the PublicId field value if set, zero value otherwise.
252+
func (o *SyntheticsStep) GetPublicId() string {
253+
if o == nil || o.PublicId == nil {
254+
var ret string
255+
return ret
256+
}
257+
return *o.PublicId
258+
}
259+
260+
// GetPublicIdOk returns a tuple with the PublicId field value if set, nil otherwise
261+
// and a boolean to check if the value has been set.
262+
func (o *SyntheticsStep) GetPublicIdOk() (*string, bool) {
263+
if o == nil || o.PublicId == nil {
264+
return nil, false
265+
}
266+
return o.PublicId, true
267+
}
268+
269+
// HasPublicId returns a boolean if a field has been set.
270+
func (o *SyntheticsStep) HasPublicId() bool {
271+
return o != nil && o.PublicId != nil
272+
}
273+
274+
// SetPublicId gets a reference to the given string and assigns it to the PublicId field.
275+
func (o *SyntheticsStep) SetPublicId(v string) {
276+
o.PublicId = &v
277+
}
278+
249279
// GetTimeout returns the Timeout field value if set, zero value otherwise.
250280
func (o *SyntheticsStep) GetTimeout() int64 {
251281
if o == nil || o.Timeout == nil {
@@ -329,6 +359,9 @@ func (o SyntheticsStep) MarshalJSON() ([]byte, error) {
329359
if o.Params != nil {
330360
toSerialize["params"] = o.Params
331361
}
362+
if o.PublicId != nil {
363+
toSerialize["public_id"] = o.PublicId
364+
}
332365
if o.Timeout != nil {
333366
toSerialize["timeout"] = o.Timeout
334367
}
@@ -352,6 +385,7 @@ func (o *SyntheticsStep) UnmarshalJSON(bytes []byte) (err error) {
352385
Name *string `json:"name,omitempty"`
353386
NoScreenshot *bool `json:"noScreenshot,omitempty"`
354387
Params interface{} `json:"params,omitempty"`
388+
PublicId *string `json:"public_id,omitempty"`
355389
Timeout *int64 `json:"timeout,omitempty"`
356390
Type *SyntheticsStepType `json:"type,omitempty"`
357391
}{}
@@ -360,7 +394,7 @@ func (o *SyntheticsStep) UnmarshalJSON(bytes []byte) (err error) {
360394
}
361395
additionalProperties := make(map[string]interface{})
362396
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
363-
datadog.DeleteKeys(additionalProperties, &[]string{"allowFailure", "alwaysExecute", "exitIfSucceed", "isCritical", "name", "noScreenshot", "params", "timeout", "type"})
397+
datadog.DeleteKeys(additionalProperties, &[]string{"allowFailure", "alwaysExecute", "exitIfSucceed", "isCritical", "name", "noScreenshot", "params", "public_id", "timeout", "type"})
364398
} else {
365399
return err
366400
}
@@ -373,6 +407,7 @@ func (o *SyntheticsStep) UnmarshalJSON(bytes []byte) (err error) {
373407
o.Name = all.Name
374408
o.NoScreenshot = all.NoScreenshot
375409
o.Params = all.Params
410+
o.PublicId = all.PublicId
376411
o.Timeout = all.Timeout
377412
if all.Type != nil && !all.Type.IsValid() {
378413
hasInvalidField = true
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-12-09T11:17:43.729Z
1+
2024-12-23T09:47:16.115Z

tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_a_browser_test_returns_OK_-_Returns_saved_rumSettings._response.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
33
body: |
4-
{"config":{"assertions":[],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"certificateDomains":["https://datadoghq.com"],"method":"GET","url":"https://datadoghq.com"},"setCookie":"name:test"},"locations":["aws:us-east-2"],"message":"Test message","name":"Test-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response-1733743063","options":{"accept_self_signed":false,"allow_insecure":true,"ci":{"executionRule":"skipped"},"device_ids":["tablet"],"disableCors":true,"disableCsp":true,"follow_redirects":true,"ignoreServerCertificateError":true,"initialNavigationTimeout":200,"min_failure_duration":10,"min_location_failed":1,"noScreenshot":true,"retry":{"count":2,"interval":10},"rumSettings":{"applicationId":"mockApplicationId","clientTokenId":12345,"isEnabled":true},"tick_every":300},"steps":[{"allowFailure":false,"isCritical":true,"name":"Refresh page","params":{},"type":"refresh"}],"tags":["testing:browser"],"type":"browser"}
4+
{"config":{"assertions":[],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"certificateDomains":["https://datadoghq.com"],"method":"GET","url":"https://datadoghq.com"},"setCookie":"name:test"},"locations":["aws:us-east-2"],"message":"Test message","name":"Test-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response-1734947236","options":{"accept_self_signed":false,"allow_insecure":true,"ci":{"executionRule":"skipped"},"device_ids":["tablet"],"disableCors":true,"disableCsp":true,"follow_redirects":true,"ignoreServerCertificateError":true,"initialNavigationTimeout":200,"min_failure_duration":10,"min_location_failed":1,"noScreenshot":true,"retry":{"count":2,"interval":10},"rumSettings":{"applicationId":"mockApplicationId","clientTokenId":12345,"isEnabled":true},"tick_every":300},"steps":[{"allowFailure":false,"isCritical":true,"name":"Refresh page","params":{},"type":"refresh"}],"tags":["testing:browser"],"type":"browser"}
55
form: {}
66
headers:
77
Accept:
@@ -12,9 +12,9 @@ interactions:
1212
method: POST
1313
url: https://api.datadoghq.com/api/v1/synthetics/tests/browser
1414
response:
15-
body: '{"public_id":"jj5-nke-dq2","name":"Test-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response-1733743063","status":"paused","type":"browser","tags":["testing:browser"],"created_at":"2024-12-09T11:17:44.348239+00:00","modified_at":"2024-12-09T11:17:44.348239+00:00","config":{"assertions":[],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"certificateDomains":["https://datadoghq.com"],"method":"GET","url":"https://datadoghq.com"},"setCookie":"name:test"},"message":"Test
16-
message","options":{"accept_self_signed":false,"allow_insecure":true,"ci":{"executionRule":"skipped"},"device_ids":["tablet"],"disableCors":true,"disableCsp":true,"follow_redirects":true,"ignoreServerCertificateError":true,"initialNavigationTimeout":200,"min_failure_duration":10,"min_location_failed":1,"noScreenshot":true,"retry":{"count":2,"interval":10},"rumSettings":{"applicationId":"mockApplicationId","clientTokenId":12345,"isEnabled":true},"tick_every":300},"locations":["aws:us-east-2"],"created_by":{"name":null,"handle":"[email protected]","email":"[email protected]"},"deleted_at":null,"monitor_id":159881000,"org_id":321813,"modified_by":{"name":null,"handle":"[email protected]","email":"[email protected]"},"steps":[{"name":"Refresh
17-
page","params":{},"type":"refresh","public_id":"yb6-rim-kwp","allowFailure":false,"isCritical":true}],"stepCount":{"assertions":0,"subtests":0,"total":1}}'
15+
body: '{"public_id":"2pq-h6b-phj","name":"Test-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response-1734947236","status":"paused","type":"browser","tags":["testing:browser"],"created_at":"2024-12-23T09:47:16.924773+00:00","modified_at":"2024-12-23T09:47:16.924773+00:00","config":{"assertions":[],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"certificateDomains":["https://datadoghq.com"],"method":"GET","url":"https://datadoghq.com"},"setCookie":"name:test"},"message":"Test
16+
message","options":{"accept_self_signed":false,"allow_insecure":true,"ci":{"executionRule":"skipped"},"device_ids":["tablet"],"disableCors":true,"disableCsp":true,"follow_redirects":true,"ignoreServerCertificateError":true,"initialNavigationTimeout":200,"min_failure_duration":10,"min_location_failed":1,"noScreenshot":true,"retry":{"count":2,"interval":10},"rumSettings":{"applicationId":"mockApplicationId","clientTokenId":12345,"isEnabled":true},"tick_every":300},"locations":["aws:us-east-2"],"created_by":{"name":"frog","handle":"[email protected]","email":"[email protected]"},"deleted_at":null,"monitor_id":161011666,"org_id":321813,"modified_by":{"name":"frog","handle":"[email protected]","email":"[email protected]"},"steps":[{"name":"Refresh
17+
page","params":{},"type":"refresh","public_id":"uwt-8ia-g4p","allowFailure":false,"isCritical":true}],"stepCount":{"assertions":0,"subtests":0,"total":1}}'
1818
code: 200
1919
duration: 0ms
2020
headers:
@@ -23,7 +23,7 @@ interactions:
2323
status: 200 OK
2424
- request:
2525
body: |
26-
{"public_ids":["jj5-nke-dq2"]}
26+
{"public_ids":["2pq-h6b-phj"]}
2727
form: {}
2828
headers:
2929
Accept:
@@ -34,7 +34,7 @@ interactions:
3434
method: POST
3535
url: https://api.datadoghq.com/api/v1/synthetics/tests/delete
3636
response:
37-
body: '{"deleted_tests":[{"public_id":"jj5-nke-dq2","deleted_at":"2024-12-09T11:17:45.340410+00:00"}]}
37+
body: '{"deleted_tests":[{"public_id":"2pq-h6b-phj","deleted_at":"2024-12-23T09:47:17.898440+00:00"}]}
3838
3939
'
4040
code: 200

tests/scenarios/features/v1/synthetics.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Feature: Synthetics
6565
And the response "options.rumSettings.isEnabled" is equal to true
6666
And the response "options.rumSettings.applicationId" is equal to "mockApplicationId"
6767
And the response "options.rumSettings.clientTokenId" is equal to 12345
68+
And the response "steps[0]" has field "public_id"
6869

6970
@team:DataDog/synthetics-ct
7071
Scenario: Create a browser test returns "OK - Returns the created test details." response

0 commit comments

Comments
 (0)