Skip to content

Commit edc4fc6

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Remove steps from certain expected synthetics api response (#3565)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 372d9f9 commit edc4fc6

5 files changed

Lines changed: 580 additions & 18 deletions

File tree

.generator/schemas/v1/openapi.yaml

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16582,7 +16582,7 @@ components:
1658216582
tests:
1658316583
description: Array of Synthetic tests configuration.
1658416584
items:
16585-
$ref: '#/components/schemas/SyntheticsTestDetails'
16585+
$ref: '#/components/schemas/SyntheticsTestDetailsWithoutSteps'
1658616586
type: array
1658716587
type: object
1658816588
SyntheticsLocalVariableParsingOptionsType:
@@ -17613,7 +17613,7 @@ components:
1761317613
status:
1761417614
$ref: '#/components/schemas/SyntheticsTestPauseStatus'
1761517615
steps:
17616-
description: For browser test, the steps of the test.
17616+
description: The steps of the test if they exist.
1761717617
items:
1761817618
$ref: '#/components/schemas/SyntheticsStep'
1761917619
type: array
@@ -17665,6 +17665,52 @@ components:
1766517665
- API
1766617666
- BROWSER
1766717667
- MOBILE
17668+
SyntheticsTestDetailsWithoutSteps:
17669+
description: Object containing details about your Synthetic test, without test
17670+
steps.
17671+
properties:
17672+
config:
17673+
$ref: '#/components/schemas/SyntheticsTestConfig'
17674+
creator:
17675+
$ref: '#/components/schemas/Creator'
17676+
locations:
17677+
description: Array of locations used to run the test.
17678+
example:
17679+
- aws:eu-west-3
17680+
items:
17681+
description: A location from which the test was run.
17682+
type: string
17683+
type: array
17684+
message:
17685+
description: Notification message associated with the test.
17686+
type: string
17687+
monitor_id:
17688+
description: The associated monitor ID.
17689+
format: int64
17690+
readOnly: true
17691+
type: integer
17692+
name:
17693+
description: Name of the test.
17694+
type: string
17695+
options:
17696+
$ref: '#/components/schemas/SyntheticsTestOptions'
17697+
public_id:
17698+
description: The test public ID.
17699+
readOnly: true
17700+
type: string
17701+
status:
17702+
$ref: '#/components/schemas/SyntheticsTestPauseStatus'
17703+
subtype:
17704+
$ref: '#/components/schemas/SyntheticsTestDetailsSubType'
17705+
tags:
17706+
description: Array of tags attached to the test.
17707+
items:
17708+
description: A tag attached to the test.
17709+
type: string
17710+
type: array
17711+
type:
17712+
$ref: '#/components/schemas/SyntheticsTestDetailsType'
17713+
type: object
1766817714
SyntheticsTestExecutionRule:
1766917715
description: Execution rule for a Synthetic test.
1767017716
enum:
@@ -35257,7 +35303,7 @@ paths:
3525735303
content:
3525835304
application/json:
3525935305
schema:
35260-
$ref: '#/components/schemas/SyntheticsTestDetails'
35306+
$ref: '#/components/schemas/SyntheticsTestDetailsWithoutSteps'
3526135307
description: OK
3526235308
'403':
3526335309
content:

api/datadogV1/api_synthetics.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,11 +1769,11 @@ func (a *SyntheticsApi) GetSyntheticsDefaultLocations(ctx _context.Context) ([]s
17691769

17701770
// GetTest Get a test configuration.
17711771
// Get the detailed configuration associated with a Synthetic test.
1772-
func (a *SyntheticsApi) GetTest(ctx _context.Context, publicId string) (SyntheticsTestDetails, *_nethttp.Response, error) {
1772+
func (a *SyntheticsApi) GetTest(ctx _context.Context, publicId string) (SyntheticsTestDetailsWithoutSteps, *_nethttp.Response, error) {
17731773
var (
17741774
localVarHTTPMethod = _nethttp.MethodGet
17751775
localVarPostBody interface{}
1776-
localVarReturnValue SyntheticsTestDetails
1776+
localVarReturnValue SyntheticsTestDetailsWithoutSteps
17771777
)
17781778

17791779
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v1.SyntheticsApi.GetTest")
@@ -2116,7 +2116,7 @@ func (a *SyntheticsApi) ListTests(ctx _context.Context, o ...ListTestsOptionalPa
21162116
}
21172117

21182118
// ListTestsWithPagination provides a paginated version of ListTests returning a channel with all items.
2119-
func (a *SyntheticsApi) ListTestsWithPagination(ctx _context.Context, o ...ListTestsOptionalParameters) (<-chan datadog.PaginationResult[SyntheticsTestDetails], func()) {
2119+
func (a *SyntheticsApi) ListTestsWithPagination(ctx _context.Context, o ...ListTestsOptionalParameters) (<-chan datadog.PaginationResult[SyntheticsTestDetailsWithoutSteps], func()) {
21202120
ctx, cancel := _context.WithCancel(ctx)
21212121
pageSize_ := int64(100)
21222122
if len(o) == 0 {
@@ -2129,13 +2129,13 @@ func (a *SyntheticsApi) ListTestsWithPagination(ctx _context.Context, o ...ListT
21292129
page_ := int64(0)
21302130
o[0].PageNumber = &page_
21312131

2132-
items := make(chan datadog.PaginationResult[SyntheticsTestDetails], pageSize_)
2132+
items := make(chan datadog.PaginationResult[SyntheticsTestDetailsWithoutSteps], pageSize_)
21332133
go func() {
21342134
for {
21352135
resp, _, err := a.ListTests(ctx, o...)
21362136
if err != nil {
2137-
var returnItem SyntheticsTestDetails
2138-
items <- datadog.PaginationResult[SyntheticsTestDetails]{Item: returnItem, Error: err}
2137+
var returnItem SyntheticsTestDetailsWithoutSteps
2138+
items <- datadog.PaginationResult[SyntheticsTestDetailsWithoutSteps]{Item: returnItem, Error: err}
21392139
break
21402140
}
21412141
respTests, ok := resp.GetTestsOk()
@@ -2146,7 +2146,7 @@ func (a *SyntheticsApi) ListTestsWithPagination(ctx _context.Context, o ...ListT
21462146

21472147
for _, item := range results {
21482148
select {
2149-
case items <- datadog.PaginationResult[SyntheticsTestDetails]{Item: item, Error: nil}:
2149+
case items <- datadog.PaginationResult[SyntheticsTestDetailsWithoutSteps]{Item: item, Error: nil}:
21502150
case <-ctx.Done():
21512151
close(items)
21522152
return

api/datadogV1/model_synthetics_list_tests_response.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
// SyntheticsListTestsResponse Object containing an array of Synthetic tests configuration.
1212
type SyntheticsListTestsResponse struct {
1313
// Array of Synthetic tests configuration.
14-
Tests []SyntheticsTestDetails `json:"tests,omitempty"`
14+
Tests []SyntheticsTestDetailsWithoutSteps `json:"tests,omitempty"`
1515
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
1616
UnparsedObject map[string]interface{} `json:"-"`
1717
AdditionalProperties map[string]interface{} `json:"-"`
@@ -35,17 +35,17 @@ func NewSyntheticsListTestsResponseWithDefaults() *SyntheticsListTestsResponse {
3535
}
3636

3737
// GetTests returns the Tests field value if set, zero value otherwise.
38-
func (o *SyntheticsListTestsResponse) GetTests() []SyntheticsTestDetails {
38+
func (o *SyntheticsListTestsResponse) GetTests() []SyntheticsTestDetailsWithoutSteps {
3939
if o == nil || o.Tests == nil {
40-
var ret []SyntheticsTestDetails
40+
var ret []SyntheticsTestDetailsWithoutSteps
4141
return ret
4242
}
4343
return o.Tests
4444
}
4545

4646
// GetTestsOk returns a tuple with the Tests field value if set, nil otherwise
4747
// and a boolean to check if the value has been set.
48-
func (o *SyntheticsListTestsResponse) GetTestsOk() (*[]SyntheticsTestDetails, bool) {
48+
func (o *SyntheticsListTestsResponse) GetTestsOk() (*[]SyntheticsTestDetailsWithoutSteps, bool) {
4949
if o == nil || o.Tests == nil {
5050
return nil, false
5151
}
@@ -57,8 +57,8 @@ func (o *SyntheticsListTestsResponse) HasTests() bool {
5757
return o != nil && o.Tests != nil
5858
}
5959

60-
// SetTests gets a reference to the given []SyntheticsTestDetails and assigns it to the Tests field.
61-
func (o *SyntheticsListTestsResponse) SetTests(v []SyntheticsTestDetails) {
60+
// SetTests gets a reference to the given []SyntheticsTestDetailsWithoutSteps and assigns it to the Tests field.
61+
func (o *SyntheticsListTestsResponse) SetTests(v []SyntheticsTestDetailsWithoutSteps) {
6262
o.Tests = v
6363
}
6464

@@ -81,7 +81,7 @@ func (o SyntheticsListTestsResponse) MarshalJSON() ([]byte, error) {
8181
// UnmarshalJSON deserializes the given payload.
8282
func (o *SyntheticsListTestsResponse) UnmarshalJSON(bytes []byte) (err error) {
8383
all := struct {
84-
Tests []SyntheticsTestDetails `json:"tests,omitempty"`
84+
Tests []SyntheticsTestDetailsWithoutSteps `json:"tests,omitempty"`
8585
}{}
8686
if err = datadog.Unmarshal(bytes, &all); err != nil {
8787
return datadog.Unmarshal(bytes, &o.UnparsedObject)

api/datadogV1/model_synthetics_test_details.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type SyntheticsTestDetails struct {
2929
// Define whether you want to start (`live`) or pause (`paused`) a
3030
// Synthetic test.
3131
Status *SyntheticsTestPauseStatus `json:"status,omitempty"`
32-
// For browser test, the steps of the test.
32+
// The steps of the test if they exist.
3333
Steps []SyntheticsStep `json:"steps,omitempty"`
3434
// The subtype of the Synthetic API test, `http`, `ssl`, `tcp`,
3535
// `dns`, `icmp`, `udp`, `websocket`, `grpc` or `multi`.

0 commit comments

Comments
 (0)