Skip to content

Commit 80d1ac8

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add originalFileName field to the SyntheticsTestRequestBodyFile definition (#1844)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent d9297e6 commit 80d1ac8

8 files changed

+43
-15
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-06-03 16:54:49.684837",
8-
"spec_repo_commit": "df6778e5"
7+
"regenerated": "2024-06-04 15:12:29.857988",
8+
"spec_repo_commit": "60183db6"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-06-03 16:54:49.702609",
13-
"spec_repo_commit": "df6778e5"
12+
"regenerated": "2024-06-04 15:12:29.875567",
13+
"spec_repo_commit": "60183db6"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16075,6 +16075,10 @@ components:
1607516075
description: Name of the file.
1607616076
maxLength: 1500
1607716077
type: string
16078+
originalFileName:
16079+
description: Original name of the file.
16080+
maxLength: 1500
16081+
type: string
1607816082
size:
1607916083
description: Size of the file.
1608016084
format: int64
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-04-02T15:35:39.188Z
1+
2024-05-30T13:32:57.127Z

cassettes/features/v1/synthetics/Create-an-API-test-with-a-file-payload-returns-OK-Returns-the-created-test-details-response.yml

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
files: [
7373
DatadogAPIClient::V1::SyntheticsTestRequestBodyFile.new({
7474
name: "file name",
75+
original_file_name: "image.png",
7576
content: "file content",
7677
type: "file type",
7778
}),

features/v1/synthetics.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ Feature: Synthetics
201201
Then the response status is 200 OK - Returns the created test details.
202202
And the response "name" is equal to "{{ unique }}"
203203
And the response "config.request.files[0].name" is equal to "file name"
204+
And the response "config.request.files[0].originalFileName" is equal to "image.png"
204205
And the response "config.request.files[0].type" is equal to "file type"
205206
And the response "config.request.files[0]" has field "bucketKey"
206207

features/v1/synthetics_api_http_test_with_file_payload.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"bodyType": "application/octet-stream",
6060
"files": [{
6161
"name": "file name",
62+
"originalFileName": "image.png",
6263
"content": "file content",
6364
"type": "file type"
6465
}],

lib/datadog_api_client/v1/models/synthetics_test_request_body_file.rb

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class SyntheticsTestRequestBodyFile
3030
# Name of the file.
3131
attr_reader :name
3232

33+
# Original name of the file.
34+
attr_reader :original_file_name
35+
3336
# Size of the file.
3437
attr_reader :size
3538

@@ -43,6 +46,7 @@ def self.attribute_map
4346
:'bucket_key' => :'bucketKey',
4447
:'content' => :'content',
4548
:'name' => :'name',
49+
:'original_file_name' => :'originalFileName',
4650
:'size' => :'size',
4751
:'type' => :'type'
4852
}
@@ -55,6 +59,7 @@ def self.openapi_types
5559
:'bucket_key' => :'String',
5660
:'content' => :'String',
5761
:'name' => :'String',
62+
:'original_file_name' => :'String',
5863
:'size' => :'Integer',
5964
:'type' => :'String'
6065
}
@@ -88,6 +93,10 @@ def initialize(attributes = {})
8893
self.name = attributes[:'name']
8994
end
9095

96+
if attributes.key?(:'original_file_name')
97+
self.original_file_name = attributes[:'original_file_name']
98+
end
99+
91100
if attributes.key?(:'size')
92101
self.size = attributes[:'size']
93102
end
@@ -103,6 +112,7 @@ def initialize(attributes = {})
103112
def valid?
104113
return false if !@content.nil? && @content.to_s.length > 3145728
105114
return false if !@name.nil? && @name.to_s.length > 1500
115+
return false if !@original_file_name.nil? && @original_file_name.to_s.length > 1500
106116
return false if !@size.nil? && @size > 3145728
107117
return false if !@size.nil? && @size < 1
108118
return false if !@type.nil? && @type.to_s.length > 1500
@@ -129,6 +139,16 @@ def name=(name)
129139
@name = name
130140
end
131141

142+
# Custom attribute writer method with validation
143+
# @param original_file_name [Object] Object to be assigned
144+
# @!visibility private
145+
def original_file_name=(original_file_name)
146+
if !original_file_name.nil? && original_file_name.to_s.length > 1500
147+
fail ArgumentError, 'invalid value for "original_file_name", the character length must be smaller than or equal to 1500.'
148+
end
149+
@original_file_name = original_file_name
150+
end
151+
132152
# Custom attribute writer method with validation
133153
# @param size [Object] Object to be assigned
134154
# @!visibility private
@@ -161,6 +181,7 @@ def ==(o)
161181
bucket_key == o.bucket_key &&
162182
content == o.content &&
163183
name == o.name &&
184+
original_file_name == o.original_file_name &&
164185
size == o.size &&
165186
type == o.type
166187
end
@@ -169,7 +190,7 @@ def ==(o)
169190
# @return [Integer] Hash code
170191
# @!visibility private
171192
def hash
172-
[bucket_key, content, name, size, type].hash
193+
[bucket_key, content, name, original_file_name, size, type].hash
173194
end
174195
end
175196
end

0 commit comments

Comments
 (0)