diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 48f45d0bc2..7b7153fb2e 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.py b/examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.py index 496168ad0e..2fd80959f4 100644 --- a/examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.py +++ b/examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.py @@ -110,6 +110,7 @@ original_file_name="image.png", content="file content", type="file type", + encoding="base64", ), ], basic_auth=SyntheticsBasicAuthOauthClient( diff --git a/src/datadog_api_client/v1/model/synthetics_test_request_body_file.py b/src/datadog_api_client/v1/model/synthetics_test_request_body_file.py index a785218f19..83a36ee155 100644 --- a/src/datadog_api_client/v1/model/synthetics_test_request_body_file.py +++ b/src/datadog_api_client/v1/model/synthetics_test_request_body_file.py @@ -38,6 +38,7 @@ def openapi_types(_): return { "bucket_key": (str,), "content": (str,), + "encoding": (str,), "name": (str,), "original_file_name": (str,), "size": (int,), @@ -47,6 +48,7 @@ def openapi_types(_): attribute_map = { "bucket_key": "bucketKey", "content": "content", + "encoding": "encoding", "name": "name", "original_file_name": "originalFileName", "size": "size", @@ -57,6 +59,7 @@ def __init__( self_, bucket_key: Union[str, UnsetType] = unset, content: Union[str, UnsetType] = unset, + encoding: Union[str, UnsetType] = unset, name: Union[str, UnsetType] = unset, original_file_name: Union[str, UnsetType] = unset, size: Union[int, UnsetType] = unset, @@ -72,6 +75,9 @@ def __init__( :param content: Content of the file. :type content: str, optional + :param encoding: Encoding of the file content. The only supported value is ``base64`` , indicating the ``content`` field contains base64-encoded data. + :type encoding: str, optional + :param name: Name of the file. :type name: str, optional @@ -88,6 +94,8 @@ def __init__( kwargs["bucket_key"] = bucket_key if content is not unset: kwargs["content"] = content + if encoding is not unset: + kwargs["encoding"] = encoding if name is not unset: kwargs["name"] = name if original_file_name is not unset: diff --git a/tests/v1/cassettes/test_scenarios/test_create_an_api_test_with_a_file_payload_returns_ok_returns_the_created_test_details_response.frozen b/tests/v1/cassettes/test_scenarios/test_create_an_api_test_with_a_file_payload_returns_ok_returns_the_created_test_details_response.frozen index 140038a835..09e3dbdb99 100644 --- a/tests/v1/cassettes/test_scenarios/test_create_an_api_test_with_a_file_payload_returns_ok_returns_the_created_test_details_response.frozen +++ b/tests/v1/cassettes/test_scenarios/test_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/tests/v1/cassettes/test_scenarios/test_create_an_api_test_with_a_file_payload_returns_ok_returns_the_created_test_details_response.yaml b/tests/v1/cassettes/test_scenarios/test_create_an_api_test_with_a_file_payload_returns_ok_returns_the_created_test_details_response.yaml index 0e203bc0f6..8c20f7785e 100644 --- a/tests/v1/cassettes/test_scenarios/test_create_an_api_test_with_a_file_payload_returns_ok_returns_the_created_test_details_response.yaml +++ b/tests/v1/cassettes/test_scenarios/test_create_an_api_test_with_a_file_payload_returns_ok_returns_the_created_test_details_response.yaml @@ -1,8 +1,9 @@ interactions: - request: body: '{"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 @@ -12,10 +13,10 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/api response: body: - 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 @@ -23,7 +24,7 @@ interactions: code: 200 message: OK - request: - body: '{"public_ids":["pbm-cwk-hzr"]}' + body: '{"public_ids":["x96-ukc-pvk"]}' headers: accept: - application/json @@ -33,7 +34,7 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete response: body: - 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/tests/v1/features/synthetics_api_http_test_with_file_payload.json b/tests/v1/features/synthetics_api_http_test_with_file_payload.json index 42bc5a46f8..b70df5e3d5 100644 --- a/tests/v1/features/synthetics_api_http_test_with_file_payload.json +++ b/tests/v1/features/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",