Skip to content

Commit 8903c71

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Remove steps from certain expected synthetics api response (#2874)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent ec2f090 commit 8903c71

File tree

6 files changed

+276
-8
lines changed

6 files changed

+276
-8
lines changed

.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:

lib/datadog_api_client/inflector.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,7 @@ def overrides
727727
"v1.synthetics_test_details" => "SyntheticsTestDetails",
728728
"v1.synthetics_test_details_sub_type" => "SyntheticsTestDetailsSubType",
729729
"v1.synthetics_test_details_type" => "SyntheticsTestDetailsType",
730+
"v1.synthetics_test_details_without_steps" => "SyntheticsTestDetailsWithoutSteps",
730731
"v1.synthetics_test_execution_rule" => "SyntheticsTestExecutionRule",
731732
"v1.synthetics_test_monitor_status" => "SyntheticsTestMonitorStatus",
732733
"v1.synthetics_test_options" => "SyntheticsTestOptions",

lib/datadog_api_client/v1/api/synthetics_api.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ def get_test(public_id, opts = {})
14451445
#
14461446
# @param public_id [String] The public ID of the test to get details from.
14471447
# @param opts [Hash] the optional parameters
1448-
# @return [Array<(SyntheticsTestDetails, Integer, Hash)>] SyntheticsTestDetails data, response status code and response headers
1448+
# @return [Array<(SyntheticsTestDetailsWithoutSteps, Integer, Hash)>] SyntheticsTestDetailsWithoutSteps data, response status code and response headers
14491449
def get_test_with_http_info(public_id, opts = {})
14501450

14511451
if @api_client.config.debugging
@@ -1473,7 +1473,7 @@ def get_test_with_http_info(public_id, opts = {})
14731473
post_body = opts[:debug_body]
14741474

14751475
# return_type
1476-
return_type = opts[:debug_return_type] || 'SyntheticsTestDetails'
1476+
return_type = opts[:debug_return_type] || 'SyntheticsTestDetailsWithoutSteps'
14771477

14781478
# auth_names
14791479
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
@@ -1687,7 +1687,7 @@ def list_tests_with_http_info(opts = {})
16871687
#
16881688
# To use it you need to use a block: list_tests_with_pagination { |item| p item }
16891689
#
1690-
# @yield [SyntheticsTestDetails] Paginated items
1690+
# @yield [SyntheticsTestDetailsWithoutSteps] Paginated items
16911691
def list_tests_with_pagination(opts = {})
16921692
api_version = "V1"
16931693
page_size = @api_client.get_attribute_from_path(opts, "page_size", 100)

lib/datadog_api_client/v1/models/synthetics_list_tests_response.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def self.attribute_map
3838
# @!visibility private
3939
def self.openapi_types
4040
{
41-
:'tests' => :'Array<SyntheticsTestDetails>'
41+
:'tests' => :'Array<SyntheticsTestDetailsWithoutSteps>'
4242
}
4343
end
4444

lib/datadog_api_client/v1/models/synthetics_test_details.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class SyntheticsTestDetails
4949
# Synthetic test.
5050
attr_accessor :status
5151

52-
# For browser test, the steps of the test.
52+
# The steps of the test if they exist.
5353
attr_accessor :steps
5454

5555
# The subtype of the Synthetic API test, `http`, `ssl`, `tcp`,
Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
=begin
2+
#Datadog API V1 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V1
20+
# Object containing details about your Synthetic test, without test steps.
21+
class SyntheticsTestDetailsWithoutSteps
22+
include BaseGenericModel
23+
24+
# Configuration object for a Synthetic test.
25+
attr_accessor :config
26+
27+
# Object describing the creator of the shared element.
28+
attr_accessor :creator
29+
30+
# Array of locations used to run the test.
31+
attr_accessor :locations
32+
33+
# Notification message associated with the test.
34+
attr_accessor :message
35+
36+
# The associated monitor ID.
37+
attr_accessor :monitor_id
38+
39+
# Name of the test.
40+
attr_accessor :name
41+
42+
# Object describing the extra options for a Synthetic test.
43+
attr_accessor :options
44+
45+
# The test public ID.
46+
attr_accessor :public_id
47+
48+
# Define whether you want to start (`live`) or pause (`paused`) a
49+
# Synthetic test.
50+
attr_accessor :status
51+
52+
# The subtype of the Synthetic API test, `http`, `ssl`, `tcp`,
53+
# `dns`, `icmp`, `udp`, `websocket`, `grpc` or `multi`.
54+
attr_accessor :subtype
55+
56+
# Array of tags attached to the test.
57+
attr_accessor :tags
58+
59+
# Type of the Synthetic test, either `api` or `browser`.
60+
attr_accessor :type
61+
62+
attr_accessor :additional_properties
63+
64+
# Attribute mapping from ruby-style variable name to JSON key.
65+
# @!visibility private
66+
def self.attribute_map
67+
{
68+
:'config' => :'config',
69+
:'creator' => :'creator',
70+
:'locations' => :'locations',
71+
:'message' => :'message',
72+
:'monitor_id' => :'monitor_id',
73+
:'name' => :'name',
74+
:'options' => :'options',
75+
:'public_id' => :'public_id',
76+
:'status' => :'status',
77+
:'subtype' => :'subtype',
78+
:'tags' => :'tags',
79+
:'type' => :'type'
80+
}
81+
end
82+
83+
# Attribute type mapping.
84+
# @!visibility private
85+
def self.openapi_types
86+
{
87+
:'config' => :'SyntheticsTestConfig',
88+
:'creator' => :'Creator',
89+
:'locations' => :'Array<String>',
90+
:'message' => :'String',
91+
:'monitor_id' => :'Integer',
92+
:'name' => :'String',
93+
:'options' => :'SyntheticsTestOptions',
94+
:'public_id' => :'String',
95+
:'status' => :'SyntheticsTestPauseStatus',
96+
:'subtype' => :'SyntheticsTestDetailsSubType',
97+
:'tags' => :'Array<String>',
98+
:'type' => :'SyntheticsTestDetailsType'
99+
}
100+
end
101+
102+
# Initializes the object
103+
# @param attributes [Hash] Model attributes in the form of hash
104+
# @!visibility private
105+
def initialize(attributes = {})
106+
if (!attributes.is_a?(Hash))
107+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsTestDetailsWithoutSteps` initialize method"
108+
end
109+
110+
self.additional_properties = {}
111+
# check to see if the attribute exists and convert string to symbol for hash key
112+
attributes = attributes.each_with_object({}) { |(k, v), h|
113+
if (!self.class.attribute_map.key?(k.to_sym))
114+
self.additional_properties[k.to_sym] = v
115+
else
116+
h[k.to_sym] = v
117+
end
118+
}
119+
120+
if attributes.key?(:'config')
121+
self.config = attributes[:'config']
122+
end
123+
124+
if attributes.key?(:'creator')
125+
self.creator = attributes[:'creator']
126+
end
127+
128+
if attributes.key?(:'locations')
129+
if (value = attributes[:'locations']).is_a?(Array)
130+
self.locations = value
131+
end
132+
end
133+
134+
if attributes.key?(:'message')
135+
self.message = attributes[:'message']
136+
end
137+
138+
if attributes.key?(:'monitor_id')
139+
self.monitor_id = attributes[:'monitor_id']
140+
end
141+
142+
if attributes.key?(:'name')
143+
self.name = attributes[:'name']
144+
end
145+
146+
if attributes.key?(:'options')
147+
self.options = attributes[:'options']
148+
end
149+
150+
if attributes.key?(:'public_id')
151+
self.public_id = attributes[:'public_id']
152+
end
153+
154+
if attributes.key?(:'status')
155+
self.status = attributes[:'status']
156+
end
157+
158+
if attributes.key?(:'subtype')
159+
self.subtype = attributes[:'subtype']
160+
end
161+
162+
if attributes.key?(:'tags')
163+
if (value = attributes[:'tags']).is_a?(Array)
164+
self.tags = value
165+
end
166+
end
167+
168+
if attributes.key?(:'type')
169+
self.type = attributes[:'type']
170+
end
171+
end
172+
173+
# Returns the object in the form of hash, with additionalProperties support.
174+
# @return [Hash] Returns the object in the form of hash
175+
# @!visibility private
176+
def to_hash
177+
hash = {}
178+
self.class.attribute_map.each_pair do |attr, param|
179+
value = self.send(attr)
180+
if value.nil?
181+
is_nullable = self.class.openapi_nullable.include?(attr)
182+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
183+
end
184+
185+
hash[param] = _to_hash(value)
186+
end
187+
self.additional_properties.each_pair do |attr, value|
188+
hash[attr] = value
189+
end
190+
hash
191+
end
192+
193+
# Checks equality by comparing each attribute.
194+
# @param o [Object] Object to be compared
195+
# @!visibility private
196+
def ==(o)
197+
return true if self.equal?(o)
198+
self.class == o.class &&
199+
config == o.config &&
200+
creator == o.creator &&
201+
locations == o.locations &&
202+
message == o.message &&
203+
monitor_id == o.monitor_id &&
204+
name == o.name &&
205+
options == o.options &&
206+
public_id == o.public_id &&
207+
status == o.status &&
208+
subtype == o.subtype &&
209+
tags == o.tags &&
210+
type == o.type &&
211+
additional_properties == o.additional_properties
212+
end
213+
214+
# Calculates hash code according to all attributes.
215+
# @return [Integer] Hash code
216+
# @!visibility private
217+
def hash
218+
[config, creator, locations, message, monitor_id, name, options, public_id, status, subtype, tags, type, additional_properties].hash
219+
end
220+
end
221+
end

0 commit comments

Comments
 (0)