diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 48f45d0bc2b8..7b7153fb2ed7 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -18642,6 +18642,10 @@ components: description: Content of the file. maxLength: 3145728 type: string + encoding: + description: Encoding of the file content. The only supported value is `base64`, + indicating the `content` field contains base64-encoded data. + type: string name: description: Name of the file. maxLength: 1500 diff --git a/cassettes/features/v1/synthetics/Create-an-API-test-with-a-file-payload-returns-OK-Returns-the-created-test-details-response.frozen b/cassettes/features/v1/synthetics/Create-an-API-test-with-a-file-payload-returns-OK-Returns-the-created-test-details-response.frozen index 140038a835a9..09e3dbdb9971 100644 --- a/cassettes/features/v1/synthetics/Create-an-API-test-with-a-file-payload-returns-OK-Returns-the-created-test-details-response.frozen +++ b/cassettes/features/v1/synthetics/Create-an-API-test-with-a-file-payload-returns-OK-Returns-the-created-test-details-response.frozen @@ -1 +1 @@ -2024-12-09T11:18:08.137Z \ No newline at end of file +2026-03-03T11:12:53.062Z \ No newline at end of file diff --git a/cassettes/features/v1/synthetics/Create-an-API-test-with-a-file-payload-returns-OK-Returns-the-created-test-details-response.yml b/cassettes/features/v1/synthetics/Create-an-API-test-with-a-file-payload-returns-OK-Returns-the-created-test-details-response.yml index c952d77886b9..0ac3bfe20fb9 100644 --- a/cassettes/features/v1/synthetics/Create-an-API-test-with-a-file-payload-returns-OK-Returns-the-created-test-details-response.yml +++ b/cassettes/features/v1/synthetics/Create-an-API-test-with-a-file-payload-returns-OK-Returns-the-created-test-details-response.yml @@ -1,11 +1,12 @@ http_interactions: -- recorded_at: Mon, 09 Dec 2024 11:18:08 GMT +- recorded_at: Tue, 03 Mar 2026 11:12:53 GMT request: body: encoding: UTF-8 string: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"bodyType":"application/octet-stream","certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"files":[{"content":"file - content","name":"file name","originalFileName":"image.png","type":"file type"}],"headers":{"unique":"testcreateanapitestwithafilepayloadreturnsokreturnsthecreatedtestdetailsresponse1733743088"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"}},"locations":["aws:us-east-2"],"message":"BDD - test payload: synthetics_api_http_test_payload.json","name":"Test-Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response-1733743088","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response-1733743088","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' + content","encoding":"base64","name":"file name","originalFileName":"image.png","type":"file + type"}],"headers":{"unique":"testcreateanapitestwithafilepayloadreturnsokreturnsthecreatedtestdetailsresponse1772536373"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"}},"locations":["aws:us-east-2"],"message":"BDD + test payload: synthetics_api_http_test_payload.json","name":"Test-Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response-1772536373","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response-1772536373","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' headers: Accept: - application/json @@ -16,21 +17,21 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"public_id":"pbm-cwk-hzr","name":"Test-Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response-1733743088","status":"live","type":"api","subtype":"http","tags":["testing:api"],"created_at":"2024-12-09T11:18:08.979546+00:00","modified_at":"2024-12-09T11:18:08.979546+00:00","config":{"assertions":[{"operator":"is","property":"{{ - PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"bodyType":"application/octet-stream","certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"files":[{"name":"file - name","originalFileName":"image.png","type":"file type","bucketKey":"api-upload-file/pbm-cwk-hzr/2024-12-09T11:18:08.684149_ee770695-2a7a-48ef-aa76-148a8425ce69.json"}],"headers":{"unique":"testcreateanapitestwithafilepayloadreturnsokreturnsthecreatedtestdetailsresponse1733743088"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"}},"message":"BDD - test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response-1733743088","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":159881040,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + string: '{"public_id":"x96-ukc-pvk","name":"Test-Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response-1772536373","status":"live","type":"api","subtype":"http","tags":["testing:api"],"created_at":"2026-03-03T11:12:53.933929+00:00","modified_at":"2026-03-03T11:12:53.933929+00:00","config":{"assertions":[{"operator":"is","property":"{{ + PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"bodyType":"application/octet-stream","certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"files":[{"encoding":"base64","name":"file + name","originalFileName":"image.png","type":"file type","bucketKey":"api-upload-file/x96-ukc-pvk/2026-03-03T11:12:53.730968_6541a914-12d5-43ca-8dc6-387726057eb6.json"}],"headers":{"unique":"testcreateanapitestwithafilepayloadreturnsokreturnsthecreatedtestdetailsresponse1772536373"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"}},"message":"BDD + test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response-1772536373","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"created_by":{"name":"frog","handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":263059097,"org_id":321813,"modified_by":{"name":"frog","handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Mon, 09 Dec 2024 11:18:08 GMT +- recorded_at: Tue, 03 Mar 2026 11:12:53 GMT request: body: encoding: UTF-8 - string: '{"public_ids":["pbm-cwk-hzr"]}' + string: '{"public_ids":["x96-ukc-pvk"]}' headers: Accept: - application/json @@ -41,7 +42,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"deleted_tests":[{"public_id":"pbm-cwk-hzr","deleted_at":"2024-12-09T11:18:09.927667+00:00"}]} + string: '{"deleted_tests":[{"public_id":"x96-ukc-pvk","deleted_at":"2026-03-03T11:12:54.336119+00:00"}]} ' headers: diff --git a/examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.rb b/examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.rb index 6f4fd0acad21..8bf9702ddae7 100644 --- a/examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.rb +++ b/examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.rb @@ -75,6 +75,7 @@ original_file_name: "image.png", content: "file content", type: "file type", + encoding: "base64", }), ], basic_auth: DatadogAPIClient::V1::SyntheticsBasicAuthOauthClient.new({ diff --git a/features/v1/synthetics_api_http_test_with_file_payload.json b/features/v1/synthetics_api_http_test_with_file_payload.json index 42bc5a46f813..b70df5e3d525 100644 --- a/features/v1/synthetics_api_http_test_with_file_payload.json +++ b/features/v1/synthetics_api_http_test_with_file_payload.json @@ -61,7 +61,8 @@ "name": "file name", "originalFileName": "image.png", "content": "file content", - "type": "file type" + "type": "file type", + "encoding": "base64" }], "basicAuth": { "accessTokenUrl": "https://datadog-token.com", diff --git a/lib/datadog_api_client/v1/models/synthetics_test_request_body_file.rb b/lib/datadog_api_client/v1/models/synthetics_test_request_body_file.rb index 575b21ca722f..bf9bbbdfc044 100644 --- a/lib/datadog_api_client/v1/models/synthetics_test_request_body_file.rb +++ b/lib/datadog_api_client/v1/models/synthetics_test_request_body_file.rb @@ -27,6 +27,9 @@ class SyntheticsTestRequestBodyFile # Content of the file. attr_reader :content + # Encoding of the file content. The only supported value is `base64`, indicating the `content` field contains base64-encoded data. + attr_accessor :encoding + # Name of the file. attr_reader :name @@ -47,6 +50,7 @@ def self.attribute_map { :'bucket_key' => :'bucketKey', :'content' => :'content', + :'encoding' => :'encoding', :'name' => :'name', :'original_file_name' => :'originalFileName', :'size' => :'size', @@ -60,6 +64,7 @@ def self.openapi_types { :'bucket_key' => :'String', :'content' => :'String', + :'encoding' => :'String', :'name' => :'String', :'original_file_name' => :'String', :'size' => :'Integer', @@ -93,6 +98,10 @@ def initialize(attributes = {}) self.content = attributes[:'content'] end + if attributes.key?(:'encoding') + self.encoding = attributes[:'encoding'] + end + if attributes.key?(:'name') self.name = attributes[:'name'] end @@ -204,6 +213,7 @@ def ==(o) self.class == o.class && bucket_key == o.bucket_key && content == o.content && + encoding == o.encoding && name == o.name && original_file_name == o.original_file_name && size == o.size && @@ -215,7 +225,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [bucket_key, content, name, original_file_name, size, type, additional_properties].hash + [bucket_key, content, encoding, name, original_file_name, size, type, additional_properties].hash end end end