diff --git a/.apigentools-info b/.apigentools-info index 7699c240d..3d61186e3 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-04-05 17:05:09.050525", - "spec_repo_commit": "9b7c8967" + "regenerated": "2024-04-05 19:46:20.796817", + "spec_repo_commit": "cdcf2ed6" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-04-05 17:05:09.094275", - "spec_repo_commit": "9b7c8967" + "regenerated": "2024-04-05 19:46:20.814022", + "spec_repo_commit": "cdcf2ed6" } } } \ No newline at end of file diff --git a/examples/v2_logs-custom-destinations_update_logs_custom_destination.rs b/examples/v2_logs-custom-destinations_update_logs_custom_destination.rs index 30ea195ae..6c5631f21 100644 --- a/examples/v2_logs-custom-destinations_update_logs_custom_destination.rs +++ b/examples/v2_logs-custom-destinations_update_logs_custom_destination.rs @@ -1,6 +1,7 @@ // Update a custom destination returns "OK" response use datadog_api_client::datadog::configuration::Configuration; use datadog_api_client::datadogV2::api::api_logs_custom_destinations::LogsCustomDestinationsAPI; +use datadog_api_client::datadogV2::model::CustomDestinationAttributeTagsRestrictionListType; use datadog_api_client::datadogV2::model::CustomDestinationType; use datadog_api_client::datadogV2::model::CustomDestinationUpdateRequest; use datadog_api_client::datadogV2::model::CustomDestinationUpdateRequestAttributes; @@ -17,7 +18,13 @@ async fn main() { ) .attributes( CustomDestinationUpdateRequestAttributes::new() - .name("Nginx logs (Updated)".to_string()), + .enabled(false) + .forward_tags(false) + .forward_tags_restriction_list_type( + CustomDestinationAttributeTagsRestrictionListType::BLOCK_LIST, + ) + .name("Nginx logs (Updated)".to_string()) + .query("source:nginx".to_string()), ), ); let configuration = Configuration::new(); diff --git a/tests/scenarios/cassettes/v2/logs_custom_destinations/Update-a-custom-destination-returns-OK-response.frozen b/tests/scenarios/cassettes/v2/logs_custom_destinations/Update-a-custom-destination-returns-OK-response.frozen index f79f9f1e9..800d78eaa 100644 --- a/tests/scenarios/cassettes/v2/logs_custom_destinations/Update-a-custom-destination-returns-OK-response.frozen +++ b/tests/scenarios/cassettes/v2/logs_custom_destinations/Update-a-custom-destination-returns-OK-response.frozen @@ -1 +1 @@ -2024-03-12T09:20:18.077Z \ No newline at end of file +2024-04-05T19:31:41.540Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/logs_custom_destinations/Update-a-custom-destination-returns-OK-response.json b/tests/scenarios/cassettes/v2/logs_custom_destinations/Update-a-custom-destination-returns-OK-response.json index 0b21ffbb3..1c48d8fec 100644 --- a/tests/scenarios/cassettes/v2/logs_custom_destinations/Update-a-custom-destination-returns-OK-response.json +++ b/tests/scenarios/cassettes/v2/logs_custom_destinations/Update-a-custom-destination-returns-OK-response.json @@ -3,7 +3,7 @@ { "request": { "body": { - "string": "{\"data\":{\"attributes\":{\"enabled\":false,\"forward_tags\":false,\"forward_tags_restriction_list\":[\"host\"],\"forward_tags_restriction_list_type\":\"BLOCK_LIST\",\"forwarder_destination\":{\"auth\":{\"password\":\"my-password\",\"type\":\"basic\",\"username\":\"my-username\"},\"endpoint\":\"https://example.com\",\"type\":\"http\"},\"name\":\"Test-Update_a_custom_destination_returns_OK_response-1710235218\",\"query\":\"source:nginx\"},\"type\":\"custom_destination\"}}", + "string": "{\"data\":{\"attributes\":{\"enabled\":false,\"forward_tags\":false,\"forward_tags_restriction_list\":[\"host\"],\"forward_tags_restriction_list_type\":\"BLOCK_LIST\",\"forwarder_destination\":{\"auth\":{\"password\":\"my-password\",\"type\":\"basic\",\"username\":\"my-username\"},\"endpoint\":\"https://example.com\",\"type\":\"http\"},\"name\":\"Test-Update_a_custom_destination_returns_OK_response-1712345501\",\"query\":\"source:nginx\"},\"type\":\"custom_destination\"}}", "encoding": null }, "headers": { @@ -19,7 +19,7 @@ }, "response": { "body": { - "string": "{\"data\":{\"id\":\"22ce0782-a48f-4340-98f5-fd3671b66e19\",\"attributes\":{\"name\":\"Test-Update_a_custom_destination_returns_OK_response-1710235218\",\"query\":\"source:nginx\",\"enabled\":false,\"forwarder_destination\":{\"endpoint\":\"https://example.com\",\"auth\":{\"type\":\"basic\"},\"type\":\"http\"},\"forward_tags_restriction_list_type\":\"BLOCK_LIST\",\"forward_tags_restriction_list\":[\"host\"],\"forward_tags\":false},\"type\":\"custom_destination\"}}\n", + "string": "{\"data\":{\"id\":\"60f4b01e-7853-4d48-8f6d-b98802dca889\",\"attributes\":{\"name\":\"Test-Update_a_custom_destination_returns_OK_response-1712345501\",\"query\":\"source:nginx\",\"enabled\":false,\"forwarder_destination\":{\"endpoint\":\"https://example.com\",\"auth\":{\"type\":\"basic\"},\"type\":\"http\"},\"forward_tags_restriction_list_type\":\"BLOCK_LIST\",\"forward_tags_restriction_list\":[\"host\"],\"forward_tags\":false},\"type\":\"custom_destination\"}}\n", "encoding": null }, "headers": { @@ -32,12 +32,12 @@ "message": "OK" } }, - "recorded_at": "Tue, 12 Mar 2024 09:20:18 GMT" + "recorded_at": "Fri, 05 Apr 2024 19:31:41 GMT" }, { "request": { "body": { - "string": "{\"data\":{\"attributes\":{\"name\":\"Nginx logs (Updated)\"},\"id\":\"22ce0782-a48f-4340-98f5-fd3671b66e19\",\"type\":\"custom_destination\"}}", + "string": "{\"data\":{\"attributes\":{\"enabled\":false,\"forward_tags\":false,\"forward_tags_restriction_list_type\":\"BLOCK_LIST\",\"name\":\"Nginx logs (Updated)\",\"query\":\"source:nginx\"},\"id\":\"60f4b01e-7853-4d48-8f6d-b98802dca889\",\"type\":\"custom_destination\"}}", "encoding": null }, "headers": { @@ -49,11 +49,11 @@ ] }, "method": "patch", - "uri": "https://api.datadoghq.com/api/v2/logs/config/custom-destinations/22ce0782-a48f-4340-98f5-fd3671b66e19" + "uri": "https://api.datadoghq.com/api/v2/logs/config/custom-destinations/60f4b01e-7853-4d48-8f6d-b98802dca889" }, "response": { "body": { - "string": "{\"data\":{\"id\":\"22ce0782-a48f-4340-98f5-fd3671b66e19\",\"attributes\":{\"name\":\"Nginx logs (Updated)\",\"query\":\"source:nginx\",\"enabled\":false,\"forwarder_destination\":{\"endpoint\":\"https://example.com\",\"auth\":{\"type\":\"basic\"},\"type\":\"http\"},\"forward_tags_restriction_list_type\":\"BLOCK_LIST\",\"forward_tags_restriction_list\":[\"host\"],\"forward_tags\":false},\"type\":\"custom_destination\"}}\n", + "string": "{\"data\":{\"id\":\"60f4b01e-7853-4d48-8f6d-b98802dca889\",\"attributes\":{\"name\":\"Nginx logs (Updated)\",\"query\":\"source:nginx\",\"enabled\":false,\"forwarder_destination\":{\"endpoint\":\"https://example.com\",\"auth\":{\"type\":\"basic\"},\"type\":\"http\"},\"forward_tags_restriction_list_type\":\"BLOCK_LIST\",\"forward_tags_restriction_list\":[\"host\"],\"forward_tags\":false},\"type\":\"custom_destination\"}}\n", "encoding": null }, "headers": { @@ -66,7 +66,7 @@ "message": "OK" } }, - "recorded_at": "Tue, 12 Mar 2024 09:20:18 GMT" + "recorded_at": "Fri, 05 Apr 2024 19:31:41 GMT" }, { "request": { @@ -77,7 +77,7 @@ ] }, "method": "delete", - "uri": "https://api.datadoghq.com/api/v2/logs/config/custom-destinations/22ce0782-a48f-4340-98f5-fd3671b66e19" + "uri": "https://api.datadoghq.com/api/v2/logs/config/custom-destinations/60f4b01e-7853-4d48-8f6d-b98802dca889" }, "response": { "body": { @@ -94,7 +94,7 @@ "message": "No Content" } }, - "recorded_at": "Tue, 12 Mar 2024 09:20:18 GMT" + "recorded_at": "Fri, 05 Apr 2024 19:31:41 GMT" } ], "recorded_with": "VCR 6.0.0" diff --git a/tests/scenarios/features/v2/logs_custom_destinations.feature b/tests/scenarios/features/v2/logs_custom_destinations.feature index 82f7ca885..4fca0b661 100644 --- a/tests/scenarios/features/v2/logs_custom_destinations.feature +++ b/tests/scenarios/features/v2/logs_custom_destinations.feature @@ -226,7 +226,7 @@ Feature: Logs Custom Destinations Given new "UpdateLogsCustomDestination" request And there is a valid "custom_destination" in the system And request contains "custom_destination_id" parameter from "custom_destination.data.id" - And body with value {"data": {"attributes": {"name": "Nginx logs (Updated)"}, "type": "custom_destination", "id": "{{ custom_destination.data.id }}" }} + And body with value {"data": {"attributes": {"name": "Nginx logs (Updated)", "query": "source:nginx", "enabled":false, "forward_tags":false, "forward_tags_restriction_list_type":"BLOCK_LIST"}, "type": "custom_destination", "id": "{{ custom_destination.data.id }}"}} When the request is sent Then the response status is 200 OK And the response "data.type" is equal to "custom_destination"