Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add originalFileName field to the SyntheticsTestRequestBodyFile definition #1844

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-06-03 16:54:49.684837",
"spec_repo_commit": "df6778e5"
"regenerated": "2024-06-04 15:12:29.857988",
"spec_repo_commit": "60183db6"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-06-03 16:54:49.702609",
"spec_repo_commit": "df6778e5"
"regenerated": "2024-06-04 15:12:29.875567",
"spec_repo_commit": "60183db6"
}
}
}
4 changes: 4 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16075,6 +16075,10 @@ components:
description: Name of the file.
maxLength: 1500
type: string
originalFileName:
description: Original name of the file.
maxLength: 1500
type: string
size:
description: Size of the file.
format: int64
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-04-02T15:35:39.188Z
2024-05-30T13:32:57.127Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
files: [
DatadogAPIClient::V1::SyntheticsTestRequestBodyFile.new({
name: "file name",
original_file_name: "image.png",
content: "file content",
type: "file type",
}),
Expand Down
1 change: 1 addition & 0 deletions features/v1/synthetics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ Feature: Synthetics
Then the response status is 200 OK - Returns the created test details.
And the response "name" is equal to "{{ unique }}"
And the response "config.request.files[0].name" is equal to "file name"
And the response "config.request.files[0].originalFileName" is equal to "image.png"
And the response "config.request.files[0].type" is equal to "file type"
And the response "config.request.files[0]" has field "bucketKey"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"bodyType": "application/octet-stream",
"files": [{
"name": "file name",
"originalFileName": "image.png",
"content": "file content",
"type": "file type"
}],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class SyntheticsTestRequestBodyFile
# Name of the file.
attr_reader :name

# Original name of the file.
attr_reader :original_file_name

# Size of the file.
attr_reader :size

Expand All @@ -43,6 +46,7 @@ def self.attribute_map
:'bucket_key' => :'bucketKey',
:'content' => :'content',
:'name' => :'name',
:'original_file_name' => :'originalFileName',
:'size' => :'size',
:'type' => :'type'
}
Expand All @@ -55,6 +59,7 @@ def self.openapi_types
:'bucket_key' => :'String',
:'content' => :'String',
:'name' => :'String',
:'original_file_name' => :'String',
:'size' => :'Integer',
:'type' => :'String'
}
Expand Down Expand Up @@ -88,6 +93,10 @@ def initialize(attributes = {})
self.name = attributes[:'name']
end

if attributes.key?(:'original_file_name')
self.original_file_name = attributes[:'original_file_name']
end

if attributes.key?(:'size')
self.size = attributes[:'size']
end
Expand All @@ -103,6 +112,7 @@ def initialize(attributes = {})
def valid?
return false if !@content.nil? && @content.to_s.length > 3145728
return false if !@name.nil? && @name.to_s.length > 1500
return false if !@original_file_name.nil? && @original_file_name.to_s.length > 1500
return false if !@size.nil? && @size > 3145728
return false if !@size.nil? && @size < 1
return false if !@type.nil? && @type.to_s.length > 1500
Expand All @@ -129,6 +139,16 @@ def name=(name)
@name = name
end

# Custom attribute writer method with validation
# @param original_file_name [Object] Object to be assigned
# @!visibility private
def original_file_name=(original_file_name)
if !original_file_name.nil? && original_file_name.to_s.length > 1500
fail ArgumentError, 'invalid value for "original_file_name", the character length must be smaller than or equal to 1500.'
end
@original_file_name = original_file_name
end

# Custom attribute writer method with validation
# @param size [Object] Object to be assigned
# @!visibility private
Expand Down Expand Up @@ -161,6 +181,7 @@ def ==(o)
bucket_key == o.bucket_key &&
content == o.content &&
name == o.name &&
original_file_name == o.original_file_name &&
size == o.size &&
type == o.type
end
Expand All @@ -169,7 +190,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[bucket_key, content, name, size, type].hash
[bucket_key, content, name, original_file_name, size, type].hash
end
end
end
Loading