diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 48f45d0bc2b..7b7153fb2ed 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/examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.java b/examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.java index a95422ca3cb..1a8c22d5226 100644 --- a/examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.java +++ b/examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.java @@ -116,7 +116,8 @@ public static void main(String[] args) { .name("file name") .originalFileName("image.png") .content("file content") - .type("file type"))) + .type("file type") + .encoding("base64"))) .basicAuth( new SyntheticsBasicAuth( new SyntheticsBasicAuthOauthClient() diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestRequestBodyFile.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestRequestBodyFile.java index 08f51ac0b48..f5301bb83af 100644 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestRequestBodyFile.java +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestRequestBodyFile.java @@ -20,6 +20,7 @@ @JsonPropertyOrder({ SyntheticsTestRequestBodyFile.JSON_PROPERTY_BUCKET_KEY, SyntheticsTestRequestBodyFile.JSON_PROPERTY_CONTENT, + SyntheticsTestRequestBodyFile.JSON_PROPERTY_ENCODING, SyntheticsTestRequestBodyFile.JSON_PROPERTY_NAME, SyntheticsTestRequestBodyFile.JSON_PROPERTY_ORIGINAL_FILE_NAME, SyntheticsTestRequestBodyFile.JSON_PROPERTY_SIZE, @@ -35,6 +36,9 @@ public class SyntheticsTestRequestBodyFile { public static final String JSON_PROPERTY_CONTENT = "content"; private String content; + public static final String JSON_PROPERTY_ENCODING = "encoding"; + private String encoding; + public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -89,6 +93,28 @@ public void setContent(String content) { this.content = content; } + public SyntheticsTestRequestBodyFile encoding(String encoding) { + this.encoding = encoding; + return this; + } + + /** + * Encoding of the file content. The only supported value is base64, indicating the + * content field contains base64-encoded data. + * + * @return encoding + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENCODING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEncoding() { + return encoding; + } + + public void setEncoding(String encoding) { + this.encoding = encoding; + } + public SyntheticsTestRequestBodyFile name(String name) { this.name = name; return this; @@ -231,6 +257,7 @@ public boolean equals(Object o) { SyntheticsTestRequestBodyFile syntheticsTestRequestBodyFile = (SyntheticsTestRequestBodyFile) o; return Objects.equals(this.bucketKey, syntheticsTestRequestBodyFile.bucketKey) && Objects.equals(this.content, syntheticsTestRequestBodyFile.content) + && Objects.equals(this.encoding, syntheticsTestRequestBodyFile.encoding) && Objects.equals(this.name, syntheticsTestRequestBodyFile.name) && Objects.equals(this.originalFileName, syntheticsTestRequestBodyFile.originalFileName) && Objects.equals(this.size, syntheticsTestRequestBodyFile.size) @@ -242,7 +269,7 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - bucketKey, content, name, originalFileName, size, type, additionalProperties); + bucketKey, content, encoding, name, originalFileName, size, type, additionalProperties); } @Override @@ -251,6 +278,7 @@ public String toString() { sb.append("class SyntheticsTestRequestBodyFile {\n"); sb.append(" bucketKey: ").append(toIndentedString(bucketKey)).append("\n"); sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" encoding: ").append(toIndentedString(encoding)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" originalFileName: ").append(toIndentedString(originalFileName)).append("\n"); sb.append(" size: ").append(toIndentedString(size)).append("\n"); diff --git a/src/test/resources/cassettes/features/v1/Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response.freeze b/src/test/resources/cassettes/features/v1/Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response.freeze index 140038a835a..09e3dbdb997 100644 --- a/src/test/resources/cassettes/features/v1/Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response.freeze +++ b/src/test/resources/cassettes/features/v1/Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response.freeze @@ -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/src/test/resources/cassettes/features/v1/Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response.json b/src/test/resources/cassettes/features/v1/Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response.json index f0188c8d465..cae7f69249a 100644 --- a/src/test/resources/cassettes/features/v1/Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response.json +++ b/src/test/resources/cassettes/features/v1/Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"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\"}" + "json": "{\"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\",\"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": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"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\"}}", + "body": "{\"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" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "775e3cb8-0e68-31f4-0122-b5501d328e3d" + "id": "e639d1e3-5610-b828-89e1-74523f7328d4" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"public_ids\":[\"pbm-cwk-hzr\"]}" + "json": "{\"public_ids\":[\"x96-ukc-pvk\"]}" }, "headers": {}, "method": "POST", @@ -42,7 +42,7 @@ "secure": true }, "httpResponse": { - "body": "{\"deleted_tests\":[{\"public_id\":\"pbm-cwk-hzr\",\"deleted_at\":\"2024-12-09T11:18:09.927667+00:00\"}]}\n", + "body": "{\"deleted_tests\":[{\"public_id\":\"x96-ukc-pvk\",\"deleted_at\":\"2026-03-03T11:12:54.336119+00:00\"}]}\n", "headers": { "Content-Type": [ "application/json" @@ -57,6 +57,6 @@ "timeToLive": { "unlimited": true }, - "id": "f8a3f039-59e9-8d4a-79a5-b3902d97f300" + "id": "3002cecd-3dbc-3efb-a2f8-01efe3b6daa3" } ] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v1/api/synthetics_api_http_test_with_file_payload.json b/src/test/resources/com/datadog/api/client/v1/api/synthetics_api_http_test_with_file_payload.json index 42bc5a46f81..b70df5e3d52 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/synthetics_api_http_test_with_file_payload.json +++ b/src/test/resources/com/datadog/api/client/v1/api/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",