From c59560021eda2ae76a0d1308590a92128923fbf5 Mon Sep 17 00:00:00 2001 From: Kevin Zou Date: Mon, 8 Jan 2024 16:36:39 -0500 Subject: [PATCH] fix nullables being propagated incorrectly, api tag capitalization, arbitrary json fields getting mixed up with additionalproperties, undo operation json strings being left unserialized --- .generator/src/generator/openapi.py | 9 +- .generator/src/generator/templates/api.j2 | 2 +- .../generator/templates/function_mappings.j2 | 13 +- src/datadogV1/api/api_aws_integration.rs | 6 +- src/datadogV1/api/api_aws_logs_integration.rs | 6 +- src/datadogV1/api/api_gcp_integration.rs | 6 +- src/datadogV1/api/api_ip_ranges.rs | 6 +- src/datadogV1/model/model_dashboard.rs | 5 +- .../model/model_distribution_points_series.rs | 7 +- src/datadogV1/model/model_host_meta.rs | 10 +- .../model/model_metrics_query_metadata.rs | 2 +- src/datadogV1/model/model_monitor_options.rs | 3 +- .../model/model_monitor_search_count_item.rs | 2 +- src/datadogV1/model/model_shared_dashboard.rs | 2 +- .../model_shared_dashboard_update_request.rs | 2 +- .../model/model_slo_history_response.rs | 2 +- .../model_synthetics_api_test_result_data.rs | 4 +- ...etics_assertion_json_path_target_target.rs | 2 +- .../model_synthetics_assertion_target.rs | 4 +- ...nthetics_assertion_x_path_target_target.rs | 2 +- .../model_synthetics_patch_test_operation.rs | 2 +- .../model/model_synthetics_step_detail.rs | 2 +- .../api/api_apm_retention_filters.rs | 6 +- .../api/api_ci_visibility_pipelines.rs | 6 +- src/datadogV2/api/api_ci_visibility_tests.rs | 6 +- src/datadogV2/api/api_dora_metrics.rs | 6 +- src/datadogV2/api/api_gcp_integration.rs | 6 +- src/datadogV2/api/api_ip_allowlist.rs | 6 +- src/datadogV2/api/api_rum.rs | 6 +- .../model_ci_app_pipelines_bucket_response.rs | 4 +- .../model_ci_app_tests_bucket_response.rs | 4 +- .../model_incident_response_attributes.rs | 2 +- .../model/model_logs_aggregate_bucket.rs | 4 +- ...ity_monitoring_signal_state_update_data.rs | 2 +- ...model_spans_aggregate_bucket_attributes.rs | 4 +- .../model/model_timeseries_response_series.rs | 2 +- tests/scenarios/fixtures.rs | 33 +- tests/scenarios/function_mappings.rs | 3739 ++++++++++++++--- 38 files changed, 3281 insertions(+), 654 deletions(-) diff --git a/.generator/src/generator/openapi.py b/.generator/src/generator/openapi.py index 7d8bbf250..5ca2b4c47 100644 --- a/.generator/src/generator/openapi.py +++ b/.generator/src/generator/openapi.py @@ -62,18 +62,15 @@ def type_to_rust(schema, alternative_name=None, render_nullable=False, render_op else: type_ = "object" warnings.warn(f"Unknown type for schema: {schema} ({name or alternative_name})") + return option_wrapper(f"serde_json::Value", render_option, render_nullable) if type_ == "array": if name and schema.get("x-generate-alias-as-model", False): return name if name or alternative_name: alternative_name = (name or alternative_name) + "Item" - name = type_to_rust(schema["items"], alternative_name=alternative_name, render_nullable=render_nullable, render_option=False, version=version) - # handle nullable arrays - if formatter.simple_type(schema["items"]) and schema["items"].get("nullable"): - name = f"Option<{name}>" - if schema.get("nullable") and formatter.is_primitive(schema["items"]): - name = formatter.simple_type(schema["items"], render_nullable=render_nullable, render_option=False) + nullable_item = schema["items"].get("nullable") + name = type_to_rust(schema["items"], alternative_name=alternative_name, render_nullable=nullable_item, render_option=False, version=version) return option_wrapper(f"Vec<{name}>", render_option, render_nullable) elif type_ == "object": name = "serde_json::Value" diff --git a/.generator/src/generator/templates/api.j2 b/.generator/src/generator/templates/api.j2 index 9067ed9e1..78d90fbc7 100644 --- a/.generator/src/generator/templates/api.j2 +++ b/.generator/src/generator/templates/api.j2 @@ -48,7 +48,7 @@ pub enum {{operation.operationId}}Error { } {% endfor %} -{%- set structName = name|camel_case +"API" %} +{%- set structName = name.replace(" ", "")+"API" %} #[derive(Debug, Clone)] pub struct {{ structName }} { config: configuration::Configuration, diff --git a/.generator/src/generator/templates/function_mappings.j2 b/.generator/src/generator/templates/function_mappings.j2 index db0127396..e18ae7797 100644 --- a/.generator/src/generator/templates/function_mappings.j2 +++ b/.generator/src/generator/templates/function_mappings.j2 @@ -13,7 +13,7 @@ pub struct ApiInstances { {%- for version, apis in all_apis.items() %} {%- for name, operations in apis.items() %} {%- set fieldName = "api_"+name %} -{%- set structName = name|camel_case +"API" %} +{%- set structName = name.replace(" ", "")+"API" %} pub {{version}}_{{fieldName | snake_case}}: Option, {%- endfor %} {%- endfor %} @@ -23,8 +23,8 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { match api.as_str() { {%- for name, versions in get_apis_and_versions(all_apis) %} {%- set fieldName = "api_"+name|snake_case %} - {%- set structName = name|camel_case +"API" %} - "{{name|camel_case}}" => { + {%- set structName = name.replace(" ", "")+"API" %} + "{{name.replace(" ", "")}}" => { {%- for version in versions %} if world.api_instances.{{version}}_{{fieldName}}.is_none() { world.api_instances.{{version}}_{{fieldName}} = Some(datadog{{ version.upper() }}::api::{{fieldName}}::{{structName}}::with_config(world.config.clone())); @@ -86,7 +86,12 @@ fn test_{{version}}_{{ operation['operationId'] | snake_case }}(world: &mut Data Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + }, _ => panic!("error parsing response: {}", error), }; } diff --git a/src/datadogV1/api/api_aws_integration.rs b/src/datadogV1/api/api_aws_integration.rs index 826678be0..86f3239ed 100644 --- a/src/datadogV1/api/api_aws_integration.rs +++ b/src/datadogV1/api/api_aws_integration.rs @@ -214,11 +214,11 @@ pub enum UpdateAWSAccountError { } #[derive(Debug, Clone)] -pub struct AwsIntegrationAPI { +pub struct AWSIntegrationAPI { config: configuration::Configuration, } -impl Default for AwsIntegrationAPI { +impl Default for AWSIntegrationAPI { fn default() -> Self { Self { config: configuration::Configuration::new(), @@ -226,7 +226,7 @@ impl Default for AwsIntegrationAPI { } } -impl AwsIntegrationAPI { +impl AWSIntegrationAPI { pub fn new() -> Self { Self::default() } diff --git a/src/datadogV1/api/api_aws_logs_integration.rs b/src/datadogV1/api/api_aws_logs_integration.rs index f9d819edb..a2357f42e 100644 --- a/src/datadogV1/api/api_aws_logs_integration.rs +++ b/src/datadogV1/api/api_aws_logs_integration.rs @@ -111,11 +111,11 @@ pub enum ListAWSLogsServicesError { } #[derive(Debug, Clone)] -pub struct AwsLogsIntegrationAPI { +pub struct AWSLogsIntegrationAPI { config: configuration::Configuration, } -impl Default for AwsLogsIntegrationAPI { +impl Default for AWSLogsIntegrationAPI { fn default() -> Self { Self { config: configuration::Configuration::new(), @@ -123,7 +123,7 @@ impl Default for AwsLogsIntegrationAPI { } } -impl AwsLogsIntegrationAPI { +impl AWSLogsIntegrationAPI { pub fn new() -> Self { Self::default() } diff --git a/src/datadogV1/api/api_gcp_integration.rs b/src/datadogV1/api/api_gcp_integration.rs index 8e579bc7f..ea75924c4 100644 --- a/src/datadogV1/api/api_gcp_integration.rs +++ b/src/datadogV1/api/api_gcp_integration.rs @@ -68,11 +68,11 @@ pub enum UpdateGCPIntegrationError { } #[derive(Debug, Clone)] -pub struct GcpIntegrationAPI { +pub struct GCPIntegrationAPI { config: configuration::Configuration, } -impl Default for GcpIntegrationAPI { +impl Default for GCPIntegrationAPI { fn default() -> Self { Self { config: configuration::Configuration::new(), @@ -80,7 +80,7 @@ impl Default for GcpIntegrationAPI { } } -impl GcpIntegrationAPI { +impl GCPIntegrationAPI { pub fn new() -> Self { Self::default() } diff --git a/src/datadogV1/api/api_ip_ranges.rs b/src/datadogV1/api/api_ip_ranges.rs index 69f19216a..5dcc3c1d0 100644 --- a/src/datadogV1/api/api_ip_ranges.rs +++ b/src/datadogV1/api/api_ip_ranges.rs @@ -15,11 +15,11 @@ pub enum GetIPRangesError { } #[derive(Debug, Clone)] -pub struct IpRangesAPI { +pub struct IPRangesAPI { config: configuration::Configuration, } -impl Default for IpRangesAPI { +impl Default for IPRangesAPI { fn default() -> Self { Self { config: configuration::Configuration::new(), @@ -27,7 +27,7 @@ impl Default for IpRangesAPI { } } -impl IpRangesAPI { +impl IPRangesAPI { pub fn new() -> Self { Self::default() } diff --git a/src/datadogV1/model/model_dashboard.rs b/src/datadogV1/model/model_dashboard.rs index 0f0863219..8cc5e1432 100644 --- a/src/datadogV1/model/model_dashboard.rs +++ b/src/datadogV1/model/model_dashboard.rs @@ -67,15 +67,14 @@ pub struct Dashboard { with = "::serde_with::rust::double_option" )] pub template_variable_presets: - Option>>>, + Option>>, /// List of template variables for this dashboard. #[serde( rename = "template_variables", default, with = "::serde_with::rust::double_option" )] - pub template_variables: - Option>>>, + pub template_variables: Option>>, /// Title of the dashboard. #[serde(rename = "title")] pub title: String, diff --git a/src/datadogV1/model/model_distribution_points_series.rs b/src/datadogV1/model/model_distribution_points_series.rs index 2ef2607f5..75b3b8b2a 100644 --- a/src/datadogV1/model/model_distribution_points_series.rs +++ b/src/datadogV1/model/model_distribution_points_series.rs @@ -16,7 +16,7 @@ pub struct DistributionPointsSeries { pub metric: String, /// Points relating to the distribution point metric. All points must be tuples with timestamp and a list of values (cannot be a string). Timestamps should be in POSIX time in seconds. #[serde(rename = "points")] - pub points: Vec>>, + pub points: Vec>, /// A list of tags associated with the distribution point metric. #[serde(rename = "tags")] pub tags: Option>, @@ -26,10 +26,7 @@ pub struct DistributionPointsSeries { } impl DistributionPointsSeries { - pub fn new( - metric: String, - points: Vec>>, - ) -> DistributionPointsSeries { + pub fn new(metric: String, points: Vec>) -> DistributionPointsSeries { DistributionPointsSeries { host: None, metric, diff --git a/src/datadogV1/model/model_host_meta.rs b/src/datadogV1/model/model_host_meta.rs index 5628efe85..cd6ee492c 100644 --- a/src/datadogV1/model/model_host_meta.rs +++ b/src/datadogV1/model/model_host_meta.rs @@ -10,7 +10,7 @@ use serde_with::skip_serializing_none; pub struct HostMeta { /// A list of Agent checks running on the host. #[serde(rename = "agent_checks")] - pub agent_checks: Option>>>, + pub agent_checks: Option>>, /// The Datadog Agent version. #[serde(rename = "agent_version")] pub agent_version: Option, @@ -19,7 +19,7 @@ pub struct HostMeta { pub cpu_cores: Option, /// An array of Mac versions. #[serde(rename = "fbsdV")] - pub fbsd_v: Option>>, + pub fbsd_v: Option>, /// JSON string containing system information. #[serde(rename = "gohai")] pub gohai: Option, @@ -28,13 +28,13 @@ pub struct HostMeta { pub install_method: Option>, /// An array of Mac versions. #[serde(rename = "macV")] - pub mac_v: Option>>, + pub mac_v: Option>, /// The machine architecture. #[serde(rename = "machine")] pub machine: Option, /// Array of Unix versions. #[serde(rename = "nixV")] - pub nix_v: Option>>, + pub nix_v: Option>, /// The OS platform. #[serde(rename = "platform")] pub platform: Option, @@ -52,7 +52,7 @@ pub struct HostMeta { pub socket_hostname: Option, /// An array of Windows versions. #[serde(rename = "winV")] - pub win_v: Option>>, + pub win_v: Option>, } impl HostMeta { diff --git a/src/datadogV1/model/model_metrics_query_metadata.rs b/src/datadogV1/model/model_metrics_query_metadata.rs index 25d4af834..bd823f481 100644 --- a/src/datadogV1/model/model_metrics_query_metadata.rs +++ b/src/datadogV1/model/model_metrics_query_metadata.rs @@ -49,7 +49,7 @@ pub struct MetricsQueryMetadata { /// The second element describes the "per unit" (for example, `second` in `bytes per second`). /// If the second element is not present, the API returns null. #[serde(rename = "unit")] - pub unit: Option>, + pub unit: Option>>, } impl MetricsQueryMetadata { diff --git a/src/datadogV1/model/model_monitor_options.rs b/src/datadogV1/model/model_monitor_options.rs index 7f90e95c7..6340a4ae6 100644 --- a/src/datadogV1/model/model_monitor_options.rs +++ b/src/datadogV1/model/model_monitor_options.rs @@ -150,8 +150,7 @@ pub struct MonitorOptions { default, with = "::serde_with::rust::double_option" )] - pub renotify_statuses: - Option>>>, + pub renotify_statuses: Option>>, /// A Boolean indicating whether this monitor needs a full window of data before it’s evaluated. /// We highly recommend you set this to `false` for sparse metrics, /// otherwise some evaluations are skipped. Default is false. diff --git a/src/datadogV1/model/model_monitor_search_count_item.rs b/src/datadogV1/model/model_monitor_search_count_item.rs index ac91b3715..10fdb43fb 100644 --- a/src/datadogV1/model/model_monitor_search_count_item.rs +++ b/src/datadogV1/model/model_monitor_search_count_item.rs @@ -13,7 +13,7 @@ pub struct MonitorSearchCountItem { pub count: Option, /// The facet value. #[serde(rename = "name")] - pub name: Option>, + pub name: Option, } impl MonitorSearchCountItem { diff --git a/src/datadogV1/model/model_shared_dashboard.rs b/src/datadogV1/model/model_shared_dashboard.rs index 2afc1303b..893d46d74 100644 --- a/src/datadogV1/model/model_shared_dashboard.rs +++ b/src/datadogV1/model/model_shared_dashboard.rs @@ -40,7 +40,7 @@ pub struct SharedDashboard { with = "::serde_with::rust::double_option" )] pub selectable_template_vars: - Option>>>, + Option>>, /// List of email addresses that can receive an invitation to access to the shared dashboard. #[serde( rename = "share_list", diff --git a/src/datadogV1/model/model_shared_dashboard_update_request.rs b/src/datadogV1/model/model_shared_dashboard_update_request.rs index 7a62a5a59..7d7ecd3ba 100644 --- a/src/datadogV1/model/model_shared_dashboard_update_request.rs +++ b/src/datadogV1/model/model_shared_dashboard_update_request.rs @@ -25,7 +25,7 @@ pub struct SharedDashboardUpdateRequest { with = "::serde_with::rust::double_option" )] pub selectable_template_vars: - Option>>>, + Option>>, /// List of email addresses that can be given access to the shared dashboard. #[serde( rename = "share_list", diff --git a/src/datadogV1/model/model_slo_history_response.rs b/src/datadogV1/model/model_slo_history_response.rs index b7063b487..0ba522784 100644 --- a/src/datadogV1/model/model_slo_history_response.rs +++ b/src/datadogV1/model/model_slo_history_response.rs @@ -13,7 +13,7 @@ pub struct SLOHistoryResponse { pub data: Option>, /// A list of errors while querying the history data for the service level objective. #[serde(rename = "errors", default, with = "::serde_with::rust::double_option")] - pub errors: Option>>>, + pub errors: Option>>, } impl SLOHistoryResponse { diff --git a/src/datadogV1/model/model_synthetics_api_test_result_data.rs b/src/datadogV1/model/model_synthetics_api_test_result_data.rs index e27fbf100..13a4a1130 100644 --- a/src/datadogV1/model/model_synthetics_api_test_result_data.rs +++ b/src/datadogV1/model/model_synthetics_api_test_result_data.rs @@ -30,9 +30,7 @@ pub struct SyntheticsAPITestResultData { pub response_body: Option, /// Response headers returned for the API test. #[serde(rename = "responseHeaders")] - pub response_headers: Option< - std::collections::HashMap>, - >, + pub response_headers: Option>, /// Global size in byte of the API test response. #[serde(rename = "responseSize")] pub response_size: Option, diff --git a/src/datadogV1/model/model_synthetics_assertion_json_path_target_target.rs b/src/datadogV1/model/model_synthetics_assertion_json_path_target_target.rs index c02b569e2..2578994f1 100644 --- a/src/datadogV1/model/model_synthetics_assertion_json_path_target_target.rs +++ b/src/datadogV1/model/model_synthetics_assertion_json_path_target_target.rs @@ -16,7 +16,7 @@ pub struct SyntheticsAssertionJSONPathTargetTarget { pub operator: Option, /// The path target value to compare to. #[serde(rename = "targetValue")] - pub target_value: Option>, + pub target_value: Option, } impl SyntheticsAssertionJSONPathTargetTarget { diff --git a/src/datadogV1/model/model_synthetics_assertion_target.rs b/src/datadogV1/model/model_synthetics_assertion_target.rs index c20e55945..224cd35dd 100644 --- a/src/datadogV1/model/model_synthetics_assertion_target.rs +++ b/src/datadogV1/model/model_synthetics_assertion_target.rs @@ -16,7 +16,7 @@ pub struct SyntheticsAssertionTarget { pub property: Option, /// Value used by the operator. #[serde(rename = "target")] - pub target: std::collections::HashMap, + pub target: serde_json::Value, /// Timings scope for response time assertions. #[serde(rename = "timingsScope")] pub timings_scope: Option, @@ -28,7 +28,7 @@ pub struct SyntheticsAssertionTarget { impl SyntheticsAssertionTarget { pub fn new( operator: crate::datadogV1::model::SyntheticsAssertionOperator, - target: std::collections::HashMap, + target: serde_json::Value, type_: crate::datadogV1::model::SyntheticsAssertionType, ) -> SyntheticsAssertionTarget { SyntheticsAssertionTarget { diff --git a/src/datadogV1/model/model_synthetics_assertion_x_path_target_target.rs b/src/datadogV1/model/model_synthetics_assertion_x_path_target_target.rs index bf7ca0a2e..185e80148 100644 --- a/src/datadogV1/model/model_synthetics_assertion_x_path_target_target.rs +++ b/src/datadogV1/model/model_synthetics_assertion_x_path_target_target.rs @@ -13,7 +13,7 @@ pub struct SyntheticsAssertionXPathTargetTarget { pub operator: Option, /// The path target value to compare to. #[serde(rename = "targetValue")] - pub target_value: Option>, + pub target_value: Option, /// The X path to assert. #[serde(rename = "xPath")] pub x_path: Option, diff --git a/src/datadogV1/model/model_synthetics_patch_test_operation.rs b/src/datadogV1/model/model_synthetics_patch_test_operation.rs index 7db4695c4..908826686 100644 --- a/src/datadogV1/model/model_synthetics_patch_test_operation.rs +++ b/src/datadogV1/model/model_synthetics_patch_test_operation.rs @@ -16,7 +16,7 @@ pub struct SyntheticsPatchTestOperation { pub path: Option, /// A value to use in a [JSON Patch](https://jsonpatch.com) operation #[serde(rename = "value")] - pub value: Option>, + pub value: Option, } impl SyntheticsPatchTestOperation { diff --git a/src/datadogV1/model/model_synthetics_step_detail.rs b/src/datadogV1/model/model_synthetics_step_detail.rs index fd69554b2..efe72ab1d 100644 --- a/src/datadogV1/model/model_synthetics_step_detail.rs +++ b/src/datadogV1/model/model_synthetics_step_detail.rs @@ -53,7 +53,7 @@ pub struct SyntheticsStepDetail { pub url: Option, /// Value for the step. #[serde(rename = "value")] - pub value: Option>, + pub value: Option, /// Array of Core Web Vitals metrics for the step. #[serde(rename = "vitalsMetrics")] pub vitals_metrics: Option>, diff --git a/src/datadogV2/api/api_apm_retention_filters.rs b/src/datadogV2/api/api_apm_retention_filters.rs index bb4990f18..384a538a5 100644 --- a/src/datadogV2/api/api_apm_retention_filters.rs +++ b/src/datadogV2/api/api_apm_retention_filters.rs @@ -105,11 +105,11 @@ pub enum UpdateApmRetentionFilterError { } #[derive(Debug, Clone)] -pub struct ApmRetentionFiltersAPI { +pub struct APMRetentionFiltersAPI { config: configuration::Configuration, } -impl Default for ApmRetentionFiltersAPI { +impl Default for APMRetentionFiltersAPI { fn default() -> Self { Self { config: configuration::Configuration::new(), @@ -117,7 +117,7 @@ impl Default for ApmRetentionFiltersAPI { } } -impl ApmRetentionFiltersAPI { +impl APMRetentionFiltersAPI { pub fn new() -> Self { Self::default() } diff --git a/src/datadogV2/api/api_ci_visibility_pipelines.rs b/src/datadogV2/api/api_ci_visibility_pipelines.rs index 7eecc81db..f8b0c0520 100644 --- a/src/datadogV2/api/api_ci_visibility_pipelines.rs +++ b/src/datadogV2/api/api_ci_visibility_pipelines.rs @@ -87,11 +87,11 @@ pub enum SearchCIAppPipelineEventsError { } #[derive(Debug, Clone)] -pub struct CiVisibilityPipelinesAPI { +pub struct CIVisibilityPipelinesAPI { config: configuration::Configuration, } -impl Default for CiVisibilityPipelinesAPI { +impl Default for CIVisibilityPipelinesAPI { fn default() -> Self { Self { config: configuration::Configuration::new(), @@ -99,7 +99,7 @@ impl Default for CiVisibilityPipelinesAPI { } } -impl CiVisibilityPipelinesAPI { +impl CIVisibilityPipelinesAPI { pub fn new() -> Self { Self::default() } diff --git a/src/datadogV2/api/api_ci_visibility_tests.rs b/src/datadogV2/api/api_ci_visibility_tests.rs index 0f67e3af2..485693bb2 100644 --- a/src/datadogV2/api/api_ci_visibility_tests.rs +++ b/src/datadogV2/api/api_ci_visibility_tests.rs @@ -66,11 +66,11 @@ pub enum SearchCIAppTestEventsError { } #[derive(Debug, Clone)] -pub struct CiVisibilityTestsAPI { +pub struct CIVisibilityTestsAPI { config: configuration::Configuration, } -impl Default for CiVisibilityTestsAPI { +impl Default for CIVisibilityTestsAPI { fn default() -> Self { Self { config: configuration::Configuration::new(), @@ -78,7 +78,7 @@ impl Default for CiVisibilityTestsAPI { } } -impl CiVisibilityTestsAPI { +impl CIVisibilityTestsAPI { pub fn new() -> Self { Self::default() } diff --git a/src/datadogV2/api/api_dora_metrics.rs b/src/datadogV2/api/api_dora_metrics.rs index 2003c78d6..4cd0c3f79 100644 --- a/src/datadogV2/api/api_dora_metrics.rs +++ b/src/datadogV2/api/api_dora_metrics.rs @@ -39,11 +39,11 @@ pub enum CreateDORAIncidentError { } #[derive(Debug, Clone)] -pub struct DoraMetricsAPI { +pub struct DORAMetricsAPI { config: configuration::Configuration, } -impl Default for DoraMetricsAPI { +impl Default for DORAMetricsAPI { fn default() -> Self { Self { config: configuration::Configuration::new(), @@ -51,7 +51,7 @@ impl Default for DoraMetricsAPI { } } -impl DoraMetricsAPI { +impl DORAMetricsAPI { pub fn new() -> Self { Self::default() } diff --git a/src/datadogV2/api/api_gcp_integration.rs b/src/datadogV2/api/api_gcp_integration.rs index 2ce07376c..773e268bd 100644 --- a/src/datadogV2/api/api_gcp_integration.rs +++ b/src/datadogV2/api/api_gcp_integration.rs @@ -97,11 +97,11 @@ pub enum UpdateGCPSTSAccountError { } #[derive(Debug, Clone)] -pub struct GcpIntegrationAPI { +pub struct GCPIntegrationAPI { config: configuration::Configuration, } -impl Default for GcpIntegrationAPI { +impl Default for GCPIntegrationAPI { fn default() -> Self { Self { config: configuration::Configuration::new(), @@ -109,7 +109,7 @@ impl Default for GcpIntegrationAPI { } } -impl GcpIntegrationAPI { +impl GCPIntegrationAPI { pub fn new() -> Self { Self::default() } diff --git a/src/datadogV2/api/api_ip_allowlist.rs b/src/datadogV2/api/api_ip_allowlist.rs index 5cd9a6167..7fb77b7e4 100644 --- a/src/datadogV2/api/api_ip_allowlist.rs +++ b/src/datadogV2/api/api_ip_allowlist.rs @@ -34,11 +34,11 @@ pub enum UpdateIPAllowlistError { } #[derive(Debug, Clone)] -pub struct IpAllowlistAPI { +pub struct IPAllowlistAPI { config: configuration::Configuration, } -impl Default for IpAllowlistAPI { +impl Default for IPAllowlistAPI { fn default() -> Self { Self { config: configuration::Configuration::new(), @@ -46,7 +46,7 @@ impl Default for IpAllowlistAPI { } } -impl IpAllowlistAPI { +impl IPAllowlistAPI { pub fn new() -> Self { Self::default() } diff --git a/src/datadogV2/api/api_rum.rs b/src/datadogV2/api/api_rum.rs index 637077969..338c6b8fe 100644 --- a/src/datadogV2/api/api_rum.rs +++ b/src/datadogV2/api/api_rum.rs @@ -141,11 +141,11 @@ pub enum UpdateRUMApplicationError { } #[derive(Debug, Clone)] -pub struct RumAPI { +pub struct RUMAPI { config: configuration::Configuration, } -impl Default for RumAPI { +impl Default for RUMAPI { fn default() -> Self { Self { config: configuration::Configuration::new(), @@ -153,7 +153,7 @@ impl Default for RumAPI { } } -impl RumAPI { +impl RUMAPI { pub fn new() -> Self { Self::default() } diff --git a/src/datadogV2/model/model_ci_app_pipelines_bucket_response.rs b/src/datadogV2/model/model_ci_app_pipelines_bucket_response.rs index 32c121b15..882c454d4 100644 --- a/src/datadogV2/model/model_ci_app_pipelines_bucket_response.rs +++ b/src/datadogV2/model/model_ci_app_pipelines_bucket_response.rs @@ -10,9 +10,7 @@ use serde_with::skip_serializing_none; pub struct CIAppPipelinesBucketResponse { /// The key-value pairs for each group-by. #[serde(rename = "by")] - pub by: Option< - std::collections::HashMap>, - >, + pub by: Option>, /// A map of the metric name to value for regular compute, or a list of values for a timeseries. #[serde(rename = "computes")] pub computes: Option< diff --git a/src/datadogV2/model/model_ci_app_tests_bucket_response.rs b/src/datadogV2/model/model_ci_app_tests_bucket_response.rs index 17f342674..e9c69e163 100644 --- a/src/datadogV2/model/model_ci_app_tests_bucket_response.rs +++ b/src/datadogV2/model/model_ci_app_tests_bucket_response.rs @@ -10,9 +10,7 @@ use serde_with::skip_serializing_none; pub struct CIAppTestsBucketResponse { /// The key-value pairs for each group-by. #[serde(rename = "by")] - pub by: Option< - std::collections::HashMap>, - >, + pub by: Option>, /// A map of the metric name to value for regular compute, or a list of values for a timeseries. #[serde(rename = "computes")] pub computes: Option< diff --git a/src/datadogV2/model/model_incident_response_attributes.rs b/src/datadogV2/model/model_incident_response_attributes.rs index 6f50a64ff..65eaf75cd 100644 --- a/src/datadogV2/model/model_incident_response_attributes.rs +++ b/src/datadogV2/model/model_incident_response_attributes.rs @@ -82,7 +82,7 @@ pub struct IncidentResponseAttributes { with = "::serde_with::rust::double_option" )] pub notification_handles: - Option>>>, + Option>>, /// The monotonically increasing integer ID for the incident. #[serde(rename = "public_id")] pub public_id: Option, diff --git a/src/datadogV2/model/model_logs_aggregate_bucket.rs b/src/datadogV2/model/model_logs_aggregate_bucket.rs index 76db6b04c..ad11533e1 100644 --- a/src/datadogV2/model/model_logs_aggregate_bucket.rs +++ b/src/datadogV2/model/model_logs_aggregate_bucket.rs @@ -10,9 +10,7 @@ use serde_with::skip_serializing_none; pub struct LogsAggregateBucket { /// The key, value pairs for each group by #[serde(rename = "by")] - pub by: Option< - std::collections::HashMap>, - >, + pub by: Option>, /// A map of the metric name -> value for regular compute or list of values for a timeseries #[serde(rename = "computes")] pub computes: Option< diff --git a/src/datadogV2/model/model_security_monitoring_signal_state_update_data.rs b/src/datadogV2/model/model_security_monitoring_signal_state_update_data.rs index 154204666..3ebc2340b 100644 --- a/src/datadogV2/model/model_security_monitoring_signal_state_update_data.rs +++ b/src/datadogV2/model/model_security_monitoring_signal_state_update_data.rs @@ -13,7 +13,7 @@ pub struct SecurityMonitoringSignalStateUpdateData { pub attributes: Box, /// The unique ID of the security signal. #[serde(rename = "id")] - pub id: Option>, + pub id: Option, /// The type of event. #[serde(rename = "type")] pub type_: Option, diff --git a/src/datadogV2/model/model_spans_aggregate_bucket_attributes.rs b/src/datadogV2/model/model_spans_aggregate_bucket_attributes.rs index 96f0e848d..d68e7fc6c 100644 --- a/src/datadogV2/model/model_spans_aggregate_bucket_attributes.rs +++ b/src/datadogV2/model/model_spans_aggregate_bucket_attributes.rs @@ -10,9 +10,7 @@ use serde_with::skip_serializing_none; pub struct SpansAggregateBucketAttributes { /// The key, value pairs for each group by. #[serde(rename = "by")] - pub by: Option< - std::collections::HashMap>, - >, + pub by: Option>, /// The compute data. #[serde(rename = "compute")] pub compute: Option>, diff --git a/src/datadogV2/model/model_timeseries_response_series.rs b/src/datadogV2/model/model_timeseries_response_series.rs index 865776216..489fb6321 100644 --- a/src/datadogV2/model/model_timeseries_response_series.rs +++ b/src/datadogV2/model/model_timeseries_response_series.rs @@ -19,7 +19,7 @@ pub struct TimeseriesResponseSeries { /// The second element describes the "per unit" (for example, `second` in `bytes per second`). /// If the second element is not present, the API returns null. #[serde(rename = "unit")] - pub unit: Option>, + pub unit: Option>>, } impl TimeseriesResponseSeries { diff --git a/tests/scenarios/fixtures.rs b/tests/scenarios/fixtures.rs index d33776502..c2335f4ac 100644 --- a/tests/scenarios/fixtures.rs +++ b/tests/scenarios/fixtures.rs @@ -266,20 +266,22 @@ fn given_resource_in_system(world: &mut DatadogWorld, given_key: String) { .function_mappings .get(&format!("v{}.{}", world.api_version, &operation_id)) .expect("given operation not found")(world, &given_parameters); - match build_undo(world, &operation_id) { - Ok(Some(undo)) => world.undo_operations.push(undo), - Ok(None) => {} - Err(err) => panic!("{err}"), - } + if let Some(source) = given.get("source") { let source_path = source.as_str().unwrap().to_string(); if let Some(fixture) = lookup(&source_path, &world.response.object) { if let Value::Object(ref mut map) = world.fixtures { - map.insert(given_key, fixture); + map.insert(given_key.clone(), fixture); } } } else if let Value::Object(ref mut map) = world.fixtures { - map.insert(given_key, world.response.object.clone()); + map.insert(given_key.clone(), world.response.object.clone()); + } + + match build_undo(world, &operation_id, Some(given_key)) { + Ok(Some(undo)) => world.undo_operations.push(undo), + Ok(None) => {} + Err(err) => panic!("{err}"), } } @@ -320,6 +322,11 @@ fn request_parameter_from_path(world: &mut DatadogWorld, param: String, path: St fn request_parameter_with_value(world: &mut DatadogWorld, param: String, value: String) { let trimmed_value = value.trim_matches('"').to_string(); let rendered = template(trimmed_value.clone(), &world.fixtures); + // check if the value was an explicit string + if trimmed_value != value { + world.parameters.insert(param, Value::String(rendered)); + return; + } if NUMBER_RE.is_match(&rendered) { let number = serde_json::Number::from_str(&rendered).expect("couldn't parse param as number"); @@ -344,7 +351,8 @@ fn request_sent(world: &mut DatadogWorld) { "{:?} request operation id not found", world.operation_id ))(world, &world.parameters.clone()); - match build_undo(world, &world.operation_id.clone()) { + + match build_undo(world, &world.operation_id.clone(), None) { Ok(Some(undo)) => { world.undo_operations.push(undo); } @@ -550,6 +558,7 @@ fn template(string: String, fixtures: &Value) -> String { fn build_undo( world: &mut DatadogWorld, operation_id: &String, + given_key: Option, ) -> Result, Value> { if world.response.code < 200 || world.response.code >= 300 { return Ok(None); @@ -585,9 +594,15 @@ fn build_undo( }; if let Some(template_value) = param.get("template") { if let Some(rendered) = template_value.as_str() { + let json_value = match given_key.clone() { + Some(key) => { + template(rendered.to_string(), &world.fixtures.get(key).unwrap()) + } + None => template(rendered.to_string(), &world.response.object), + }; undo_operation.parameters.insert( param_name.clone(), - template(rendered.to_string(), &world.fixtures).into(), + serde_json::from_str(json_value.as_str()).unwrap(), ); }; }; diff --git a/tests/scenarios/function_mappings.rs b/tests/scenarios/function_mappings.rs index 8b165bc11..dd7feb24b 100644 --- a/tests/scenarios/function_mappings.rs +++ b/tests/scenarios/function_mappings.rs @@ -9,7 +9,7 @@ use datadog_api_client::datadogV2; #[derive(Debug, Default)] pub struct ApiInstances { - pub v1_api_ip_ranges: Option, + pub v1_api_ip_ranges: Option, pub v1_api_key_management: Option, pub v1_api_service_checks: Option, pub v1_api_usage_metering: Option, @@ -20,10 +20,10 @@ pub struct ApiInstances { pub v1_api_events: Option, pub v1_api_snapshots: Option, pub v1_api_hosts: Option, - pub v1_api_aws_integration: Option, - pub v1_api_aws_logs_integration: Option, + pub v1_api_aws_integration: Option, + pub v1_api_aws_logs_integration: Option, pub v1_api_azure_integration: Option, - pub v1_api_gcp_integration: Option, + pub v1_api_gcp_integration: Option, pub v1_api_pager_duty_integration: Option, pub v1_api_slack_integration: Option, pub v1_api_webhooks_integration: Option, @@ -42,27 +42,27 @@ pub struct ApiInstances { pub v1_api_authentication: Option, pub v2_api_key_management: Option, pub v2_api_spans_metrics: Option, - pub v2_api_apm_retention_filters: Option, + pub v2_api_apm_retention_filters: Option, pub v2_api_audit: Option, pub v2_api_auth_n_mappings: Option, - pub v2_api_ci_visibility_pipelines: Option, - pub v2_api_ci_visibility_tests: Option, + pub v2_api_ci_visibility_pipelines: Option, + pub v2_api_ci_visibility_tests: Option, pub v2_api_container_images: Option, pub v2_api_containers: Option, pub v2_api_cloud_cost_management: Option, pub v2_api_usage_metering: Option, pub v2_api_dashboard_lists: Option, - pub v2_api_dora_metrics: Option, + pub v2_api_dora_metrics: Option, pub v2_api_downtimes: Option, pub v2_api_events: Option, pub v2_api_incidents: Option, - pub v2_api_gcp_integration: Option, + pub v2_api_gcp_integration: Option, pub v2_api_opsgenie_integration: Option, pub v2_api_cloudflare_integration: Option, pub v2_api_confluent_cloud: Option, pub v2_api_fastly_integration: Option, pub v2_api_okta_integration: Option, - pub v2_api_ip_allowlist: Option, + pub v2_api_ip_allowlist: Option, pub v2_api_logs: Option, pub v2_api_logs_archives: Option, pub v2_api_logs_metrics: Option, @@ -73,7 +73,7 @@ pub struct ApiInstances { pub v2_api_powerpack: Option, pub v2_api_processes: Option, pub v2_api_restriction_policies: Option, - pub v2_api_rum: Option, + pub v2_api_rum: Option, pub v2_api_organizations: Option, pub v2_api_service_scorecards: Option, pub v2_api_cloud_workload_security: Option, @@ -90,10 +90,10 @@ pub struct ApiInstances { pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { match api.as_str() { - "IpRanges" => { + "IPRanges" => { if world.api_instances.v1_api_ip_ranges.is_none() { world.api_instances.v1_api_ip_ranges = Some( - datadogV1::api::api_ip_ranges::IpRangesAPI::with_config(world.config.clone()), + datadogV1::api::api_ip_ranges::IPRangesAPI::with_config(world.config.clone()), ); } } @@ -212,19 +212,19 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { ); } } - "AwsIntegration" => { + "AWSIntegration" => { if world.api_instances.v1_api_aws_integration.is_none() { world.api_instances.v1_api_aws_integration = Some( - datadogV1::api::api_aws_integration::AwsIntegrationAPI::with_config( + datadogV1::api::api_aws_integration::AWSIntegrationAPI::with_config( world.config.clone(), ), ); } } - "AwsLogsIntegration" => { + "AWSLogsIntegration" => { if world.api_instances.v1_api_aws_logs_integration.is_none() { world.api_instances.v1_api_aws_logs_integration = Some( - datadogV1::api::api_aws_logs_integration::AwsLogsIntegrationAPI::with_config( + datadogV1::api::api_aws_logs_integration::AWSLogsIntegrationAPI::with_config( world.config.clone(), ), ); @@ -239,17 +239,17 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { ); } } - "GcpIntegration" => { + "GCPIntegration" => { if world.api_instances.v1_api_gcp_integration.is_none() { world.api_instances.v1_api_gcp_integration = Some( - datadogV1::api::api_gcp_integration::GcpIntegrationAPI::with_config( + datadogV1::api::api_gcp_integration::GCPIntegrationAPI::with_config( world.config.clone(), ), ); } if world.api_instances.v2_api_gcp_integration.is_none() { world.api_instances.v2_api_gcp_integration = Some( - datadogV2::api::api_gcp_integration::GcpIntegrationAPI::with_config( + datadogV2::api::api_gcp_integration::GCPIntegrationAPI::with_config( world.config.clone(), ), ); @@ -428,10 +428,10 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { ); } } - "ApmRetentionFilters" => { + "APMRetentionFilters" => { if world.api_instances.v2_api_apm_retention_filters.is_none() { world.api_instances.v2_api_apm_retention_filters = Some( - datadogV2::api::api_apm_retention_filters::ApmRetentionFiltersAPI::with_config( + datadogV2::api::api_apm_retention_filters::APMRetentionFiltersAPI::with_config( world.config.clone(), ), ); @@ -453,15 +453,15 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { ); } } - "CiVisibilityPipelines" => { + "CIVisibilityPipelines" => { if world.api_instances.v2_api_ci_visibility_pipelines.is_none() { - world.api_instances.v2_api_ci_visibility_pipelines = Some(datadogV2::api::api_ci_visibility_pipelines::CiVisibilityPipelinesAPI::with_config(world.config.clone())); + world.api_instances.v2_api_ci_visibility_pipelines = Some(datadogV2::api::api_ci_visibility_pipelines::CIVisibilityPipelinesAPI::with_config(world.config.clone())); } } - "CiVisibilityTests" => { + "CIVisibilityTests" => { if world.api_instances.v2_api_ci_visibility_tests.is_none() { world.api_instances.v2_api_ci_visibility_tests = Some( - datadogV2::api::api_ci_visibility_tests::CiVisibilityTestsAPI::with_config( + datadogV2::api::api_ci_visibility_tests::CIVisibilityTestsAPI::with_config( world.config.clone(), ), ); @@ -493,10 +493,10 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { ); } } - "DoraMetrics" => { + "DORAMetrics" => { if world.api_instances.v2_api_dora_metrics.is_none() { world.api_instances.v2_api_dora_metrics = Some( - datadogV2::api::api_dora_metrics::DoraMetricsAPI::with_config( + datadogV2::api::api_dora_metrics::DORAMetricsAPI::with_config( world.config.clone(), ), ); @@ -550,10 +550,10 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { ); } } - "IpAllowlist" => { + "IPAllowlist" => { if world.api_instances.v2_api_ip_allowlist.is_none() { world.api_instances.v2_api_ip_allowlist = Some( - datadogV2::api::api_ip_allowlist::IpAllowlistAPI::with_config( + datadogV2::api::api_ip_allowlist::IPAllowlistAPI::with_config( world.config.clone(), ), ); @@ -607,10 +607,10 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { ); } } - "Rum" => { + "RUM" => { if world.api_instances.v2_api_rum.is_none() { world.api_instances.v2_api_rum = Some( - datadogV2::api::api_rum::RumAPI::with_config(world.config.clone()), + datadogV2::api::api_rum::RUMAPI::with_config(world.config.clone()), ); } } @@ -2632,7 +2632,12 @@ fn test_v1_get_ip_ranges(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -2651,7 +2656,12 @@ fn test_v1_list_api_keys(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -2672,7 +2682,12 @@ fn test_v1_create_api_key(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -2693,7 +2708,12 @@ fn test_v1_delete_api_key(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -2714,7 +2734,12 @@ fn test_v1_get_api_key(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -2736,7 +2761,12 @@ fn test_v1_update_api_key(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -2755,7 +2785,12 @@ fn test_v1_list_application_keys(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -2776,7 +2811,12 @@ fn test_v1_create_application_key(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -2797,7 +2837,12 @@ fn test_v1_delete_application_key(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -2818,7 +2863,12 @@ fn test_v1_get_application_key(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -2840,7 +2890,12 @@ fn test_v1_update_application_key(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -2861,7 +2916,12 @@ fn test_v1_submit_service_check(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -2909,7 +2969,12 @@ fn test_v1_get_daily_custom_reports( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -2934,7 +2999,12 @@ fn test_v1_get_specified_daily_custom_reports( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -2982,7 +3052,12 @@ fn test_v1_get_monthly_custom_reports( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3007,7 +3082,12 @@ fn test_v1_get_specified_monthly_custom_reports( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3034,7 +3114,12 @@ fn test_v1_get_usage_analyzed_logs(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3096,7 +3181,12 @@ fn test_v1_get_usage_attribution(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3122,7 +3212,12 @@ fn test_v1_get_usage_audit_logs(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3148,7 +3243,12 @@ fn test_v1_get_usage_lambda(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3176,7 +3276,12 @@ fn test_v1_get_usage_billable_summary( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3202,7 +3307,12 @@ fn test_v1_get_usage_ci_app(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3235,7 +3345,12 @@ fn test_v1_get_usage_cloud_security_posture_management( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3261,7 +3376,12 @@ fn test_v1_get_usage_cws(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3287,7 +3407,12 @@ fn test_v1_get_usage_dbm(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3313,7 +3438,12 @@ fn test_v1_get_usage_fargate(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3339,7 +3469,12 @@ fn test_v1_get_usage_hosts(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3392,7 +3527,12 @@ fn test_v1_get_hourly_usage_attribution( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3419,7 +3559,12 @@ fn test_v1_get_incident_management(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3446,7 +3591,12 @@ fn test_v1_get_usage_indexed_spans(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3472,7 +3622,12 @@ fn test_v1_get_ingested_spans(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3502,7 +3657,12 @@ fn test_v1_get_usage_internet_of_things( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3528,7 +3688,12 @@ fn test_v1_get_usage_logs(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3558,7 +3723,12 @@ fn test_v1_get_usage_logs_by_retention( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3593,7 +3763,12 @@ fn test_v1_get_usage_logs_by_index(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3658,7 +3833,12 @@ fn test_v1_get_monthly_usage_attribution( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3685,7 +3865,12 @@ fn test_v1_get_usage_network_flows(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3712,7 +3897,12 @@ fn test_v1_get_usage_network_hosts(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3742,7 +3932,12 @@ fn test_v1_get_usage_online_archive( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3768,7 +3963,12 @@ fn test_v1_get_usage_profiling(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3794,7 +3994,12 @@ fn test_v1_get_usage_rum_units(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3829,7 +4034,12 @@ fn test_v1_get_usage_rum_sessions(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3855,7 +4065,12 @@ fn test_v1_get_usage_sds(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3881,7 +4096,12 @@ fn test_v1_get_usage_snmp(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3917,7 +4137,12 @@ fn test_v1_get_usage_summary(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3943,7 +4168,12 @@ fn test_v1_get_usage_synthetics(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -3973,7 +4203,12 @@ fn test_v1_get_usage_synthetics_api( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4003,7 +4238,12 @@ fn test_v1_get_usage_synthetics_browser( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4029,7 +4269,12 @@ fn test_v1_get_usage_timeseries(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4083,7 +4328,12 @@ fn test_v1_get_usage_top_avg_metrics( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4104,7 +4354,12 @@ fn test_v1_delete_dashboards(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4149,7 +4404,12 @@ fn test_v1_list_dashboards(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4170,7 +4430,12 @@ fn test_v1_restore_dashboards(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4191,7 +4456,12 @@ fn test_v1_create_dashboard(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4212,7 +4482,12 @@ fn test_v1_create_public_dashboard(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4233,7 +4508,12 @@ fn test_v1_delete_public_dashboard(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4254,7 +4534,12 @@ fn test_v1_get_public_dashboard(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4276,7 +4561,12 @@ fn test_v1_update_public_dashboard(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4302,7 +4592,12 @@ fn test_v1_delete_public_dashboard_invitation( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4340,7 +4635,12 @@ fn test_v1_get_public_dashboard_invitations( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4366,7 +4666,12 @@ fn test_v1_send_public_dashboard_invitation( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4388,7 +4693,12 @@ fn test_v1_delete_dashboard(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4410,7 +4720,12 @@ fn test_v1_get_dashboard(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4433,7 +4748,12 @@ fn test_v1_update_dashboard(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4452,7 +4772,12 @@ fn test_v1_list_dashboard_lists(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4473,7 +4798,12 @@ fn test_v1_create_dashboard_list(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4494,7 +4824,12 @@ fn test_v1_delete_dashboard_list(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4515,7 +4850,12 @@ fn test_v1_get_dashboard_list(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4537,7 +4877,12 @@ fn test_v1_update_dashboard_list(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4569,7 +4914,12 @@ fn test_v1_submit_distribution_points( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4604,7 +4954,12 @@ fn test_v1_list_active_metrics(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4626,7 +4981,12 @@ fn test_v1_get_metric_metadata(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4649,7 +5009,12 @@ fn test_v1_update_metric_metadata(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4672,7 +5037,12 @@ fn test_v1_query_metrics(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4693,7 +5063,12 @@ fn test_v1_list_metrics(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4722,7 +5097,12 @@ fn test_v1_submit_metrics(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4755,7 +5135,12 @@ fn test_v1_list_downtimes(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4776,7 +5161,12 @@ fn test_v1_create_downtime(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4800,7 +5190,12 @@ fn test_v1_cancel_downtimes_by_scope( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4822,7 +5217,12 @@ fn test_v1_cancel_downtime(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4844,7 +5244,12 @@ fn test_v1_get_downtime(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4867,7 +5272,12 @@ fn test_v1_update_downtime(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4889,7 +5299,12 @@ fn test_v1_list_monitor_downtimes(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4950,7 +5365,12 @@ fn test_v1_list_events(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4971,7 +5391,12 @@ fn test_v1_create_event(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -4992,7 +5417,12 @@ fn test_v1_get_event(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5053,7 +5483,12 @@ fn test_v1_get_graph_snapshot(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5075,7 +5510,12 @@ fn test_v1_mute_host(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5096,7 +5536,12 @@ fn test_v1_unmute_host(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5166,7 +5611,12 @@ fn test_v1_list_hosts(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5191,7 +5641,12 @@ fn test_v1_get_host_totals(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5212,7 +5667,12 @@ fn test_v1_delete_aws_account(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5251,7 +5711,12 @@ fn test_v1_list_aws_accounts(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5272,7 +5737,12 @@ fn test_v1_create_aws_account(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5313,7 +5783,12 @@ fn test_v1_update_aws_account(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5335,7 +5810,12 @@ fn test_v1_list_available_aws_namespaces( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5359,7 +5839,12 @@ fn test_v1_delete_aws_event_bridge_source( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5381,7 +5866,12 @@ fn test_v1_list_aws_event_bridge_sources( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5405,7 +5895,12 @@ fn test_v1_create_aws_event_bridge_source( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5426,7 +5921,12 @@ fn test_v1_delete_aws_tag_filter(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5448,7 +5948,12 @@ fn test_v1_list_aws_tag_filters(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5469,7 +5974,12 @@ fn test_v1_create_aws_tag_filter(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5493,7 +6003,12 @@ fn test_v1_create_new_aws_external_id( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5514,7 +6029,12 @@ fn test_v1_delete_aws_lambda_arn(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5536,7 +6056,12 @@ fn test_v1_list_aws_logs_integrations( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5557,7 +6082,12 @@ fn test_v1_create_aws_lambda_arn(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5581,7 +6111,12 @@ fn test_v1_check_aws_logs_lambda_async( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5600,7 +6135,12 @@ fn test_v1_list_aws_logs_services(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5621,7 +6161,12 @@ fn test_v1_enable_aws_log_services(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5645,7 +6190,12 @@ fn test_v1_check_aws_logs_services_async( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5669,7 +6219,12 @@ fn test_v1_delete_azure_integration( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5688,7 +6243,12 @@ fn test_v1_list_azure_integration(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5712,7 +6272,12 @@ fn test_v1_create_azure_integration( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5736,7 +6301,12 @@ fn test_v1_update_azure_integration( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5760,7 +6330,12 @@ fn test_v1_update_azure_host_filters( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5781,7 +6356,12 @@ fn test_v1_delete_gcp_integration(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5800,7 +6380,12 @@ fn test_v1_list_gcp_integration(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5821,7 +6406,12 @@ fn test_v1_create_gcp_integration(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5842,7 +6432,12 @@ fn test_v1_update_gcp_integration(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5870,7 +6465,12 @@ fn test_v1_create_pager_duty_integration_service( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5899,7 +6499,12 @@ fn test_v1_delete_pager_duty_integration_service( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5926,7 +6531,12 @@ fn test_v1_get_pager_duty_integration_service( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5957,7 +6567,12 @@ fn test_v1_update_pager_duty_integration_service( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -5983,7 +6598,12 @@ fn test_v1_get_slack_integration_channels( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6012,7 +6632,12 @@ fn test_v1_create_slack_integration_channel( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6042,7 +6667,12 @@ fn test_v1_remove_slack_integration_channel( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6072,7 +6702,12 @@ fn test_v1_get_slack_integration_channel( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6104,7 +6739,12 @@ fn test_v1_update_slack_integration_channel( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6132,7 +6772,12 @@ fn test_v1_create_webhooks_integration_custom_variable( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6161,7 +6806,12 @@ fn test_v1_delete_webhooks_integration_custom_variable( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6190,7 +6840,12 @@ fn test_v1_get_webhooks_integration_custom_variable( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6221,7 +6876,12 @@ fn test_v1_update_webhooks_integration_custom_variable( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6245,7 +6905,12 @@ fn test_v1_create_webhooks_integration( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6271,7 +6936,12 @@ fn test_v1_delete_webhooks_integration( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6297,7 +6967,12 @@ fn test_v1_get_webhooks_integration( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6326,7 +7001,12 @@ fn test_v1_update_webhooks_integration( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6347,7 +7027,12 @@ fn test_v1_list_logs(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6382,7 +7067,12 @@ fn test_v1_submit_log(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6401,7 +7091,12 @@ fn test_v1_get_logs_index_order(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6422,7 +7117,12 @@ fn test_v1_update_logs_index_order(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6441,7 +7141,12 @@ fn test_v1_list_log_indexes(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6462,7 +7167,12 @@ fn test_v1_create_logs_index(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6483,7 +7193,12 @@ fn test_v1_get_logs_index(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6505,7 +7220,12 @@ fn test_v1_update_logs_index(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6524,7 +7244,12 @@ fn test_v1_get_logs_pipeline_order(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6548,7 +7273,12 @@ fn test_v1_update_logs_pipeline_order( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6567,7 +7297,12 @@ fn test_v1_list_logs_pipelines(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6588,7 +7323,12 @@ fn test_v1_create_logs_pipeline(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6610,7 +7350,12 @@ fn test_v1_delete_logs_pipeline(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6632,7 +7377,12 @@ fn test_v1_get_logs_pipeline(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6655,7 +7405,12 @@ fn test_v1_update_logs_pipeline(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6724,7 +7479,12 @@ fn test_v1_list_monitors(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6745,7 +7505,12 @@ fn test_v1_create_monitor(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6770,7 +7535,12 @@ fn test_v1_check_can_delete_monitor( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6815,7 +7585,12 @@ fn test_v1_search_monitor_groups(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6860,7 +7635,12 @@ fn test_v1_search_monitors(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6881,7 +7661,12 @@ fn test_v1_validate_monitor(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6908,7 +7693,12 @@ fn test_v1_delete_monitor(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6944,7 +7734,12 @@ fn test_v1_get_monitor(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6967,7 +7762,12 @@ fn test_v1_update_monitor(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -6993,7 +7793,12 @@ fn test_v1_validate_existing_monitor( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7074,7 +7879,12 @@ fn test_v1_list_notebooks(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7095,7 +7905,12 @@ fn test_v1_create_notebook(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7117,7 +7932,12 @@ fn test_v1_delete_notebook(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7139,7 +7959,12 @@ fn test_v1_get_notebook(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7162,7 +7987,12 @@ fn test_v1_update_notebook(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7181,7 +8011,12 @@ fn test_v1_list_orgs(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7202,7 +8037,12 @@ fn test_v1_create_child_org(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7223,7 +8063,12 @@ fn test_v1_get_org(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7245,7 +8090,12 @@ fn test_v1_update_org(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7266,7 +8116,12 @@ fn test_v1_downgrade_org(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7297,7 +8152,12 @@ fn test_v1_upload_id_p_for_org(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7327,7 +8187,12 @@ fn test_v1_add_security_monitoring_signal_to_incident( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7357,7 +8222,12 @@ fn test_v1_edit_security_monitoring_signal_assignee( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7386,7 +8256,12 @@ fn test_v1_edit_security_monitoring_signal_state( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7443,7 +8318,12 @@ fn test_v1_list_sl_os(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7464,7 +8344,12 @@ fn test_v1_create_slo(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7489,7 +8374,12 @@ fn test_v1_delete_slo_timeframe_in_bulk( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7510,7 +8400,12 @@ fn test_v1_check_can_delete_slo(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7555,7 +8450,12 @@ fn test_v1_search_slo(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7581,7 +8481,12 @@ fn test_v1_delete_slo(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7611,7 +8516,12 @@ fn test_v1_get_slo(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7633,7 +8543,12 @@ fn test_v1_update_slo(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7654,7 +8569,12 @@ fn test_v1_get_slo_corrections(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7693,7 +8613,12 @@ fn test_v1_get_slo_history(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7726,7 +8651,12 @@ fn test_v1_list_slo_correction(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7748,7 +8678,12 @@ fn test_v1_create_slo_correction(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7773,7 +8708,12 @@ fn test_v1_delete_slo_correction(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7797,7 +8737,12 @@ fn test_v1_get_slo_correction(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7824,7 +8769,12 @@ fn test_v1_update_slo_correction(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7845,7 +8795,12 @@ fn test_v1_get_synthetics_ci_batch(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7864,7 +8819,12 @@ fn test_v1_list_locations(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7885,7 +8845,12 @@ fn test_v1_create_private_location(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7907,7 +8872,12 @@ fn test_v1_delete_private_location(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7929,7 +8899,12 @@ fn test_v1_get_private_location(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7952,7 +8927,12 @@ fn test_v1_update_private_location(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -7974,7 +8954,12 @@ fn test_v1_get_synthetics_default_locations( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8007,7 +8992,12 @@ fn test_v1_list_tests(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8031,7 +9021,12 @@ fn test_v1_create_synthetics_api_test( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8052,7 +9047,12 @@ fn test_v1_get_api_test(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8074,7 +9074,12 @@ fn test_v1_update_api_test(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8098,7 +9103,12 @@ fn test_v1_create_synthetics_browser_test( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8119,7 +9129,12 @@ fn test_v1_get_browser_test(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8141,7 +9156,12 @@ fn test_v1_update_browser_test(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8185,7 +9205,12 @@ fn test_v1_get_browser_test_latest_results( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8210,7 +9235,12 @@ fn test_v1_get_browser_test_result(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8231,7 +9261,12 @@ fn test_v1_delete_tests(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8252,7 +9287,12 @@ fn test_v1_trigger_tests(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8273,7 +9313,12 @@ fn test_v1_trigger_ci_tests(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8294,7 +9339,12 @@ fn test_v1_get_test(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8316,7 +9366,12 @@ fn test_v1_patch_test(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8360,7 +9415,12 @@ fn test_v1_get_api_test_latest_results( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8385,7 +9445,12 @@ fn test_v1_get_api_test_result(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8410,7 +9475,12 @@ fn test_v1_update_test_pause_status( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8429,7 +9499,12 @@ fn test_v1_list_global_variables(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8450,7 +9525,12 @@ fn test_v1_create_global_variable(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8472,7 +9552,12 @@ fn test_v1_delete_global_variable(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8494,7 +9579,12 @@ fn test_v1_get_global_variable(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8517,7 +9607,12 @@ fn test_v1_edit_global_variable(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8542,7 +9637,12 @@ fn test_v1_list_host_tags(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8568,7 +9668,12 @@ fn test_v1_delete_host_tags(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8594,7 +9699,12 @@ fn test_v1_get_host_tags(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8625,7 +9735,12 @@ fn test_v1_create_host_tags(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8656,7 +9771,12 @@ fn test_v1_update_host_tags(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8675,7 +9795,12 @@ fn test_v1_list_users(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8696,7 +9821,12 @@ fn test_v1_create_user(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8718,7 +9848,12 @@ fn test_v1_disable_user(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8740,7 +9875,12 @@ fn test_v1_get_user(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8763,7 +9903,12 @@ fn test_v1_update_user(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8782,7 +9927,12 @@ fn test_v1_validate(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8872,7 +10022,12 @@ fn test_v2_list_api_keys(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8893,7 +10048,12 @@ fn test_v2_create_api_key(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8915,7 +10075,12 @@ fn test_v2_delete_api_key(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8945,7 +10110,12 @@ fn test_v2_get_api_key(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -8968,7 +10138,12 @@ fn test_v2_update_api_key(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9032,7 +10207,12 @@ fn test_v2_list_application_keys(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9054,7 +10234,12 @@ fn test_v2_delete_application_key(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9084,7 +10269,12 @@ fn test_v2_get_application_key(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9108,7 +10298,12 @@ fn test_v2_update_application_key(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9175,7 +10370,12 @@ fn test_v2_list_current_user_application_keys( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9199,7 +10399,12 @@ fn test_v2_create_current_user_application_key( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9225,7 +10430,12 @@ fn test_v2_delete_current_user_application_key( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9251,7 +10461,12 @@ fn test_v2_get_current_user_application_key( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9280,7 +10495,12 @@ fn test_v2_update_current_user_application_key( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9299,7 +10519,12 @@ fn test_v2_list_spans_metrics(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9320,7 +10545,12 @@ fn test_v2_create_spans_metric(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9341,7 +10571,12 @@ fn test_v2_delete_spans_metric(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9362,7 +10597,12 @@ fn test_v2_get_spans_metric(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9384,7 +10624,12 @@ fn test_v2_update_spans_metric(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9406,7 +10651,12 @@ fn test_v2_list_apm_retention_filters( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9430,7 +10680,12 @@ fn test_v2_create_apm_retention_filter( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9455,7 +10710,12 @@ fn test_v2_reorder_apm_retention_filters( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9480,7 +10740,12 @@ fn test_v2_delete_apm_retention_filter( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9505,7 +10770,12 @@ fn test_v2_get_apm_retention_filter( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9533,7 +10803,12 @@ fn test_v2_update_apm_retention_filter( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9590,7 +10865,12 @@ fn test_v2_list_audit_logs(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9615,7 +10895,12 @@ fn test_v2_search_audit_logs(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9660,7 +10945,12 @@ fn test_v2_list_auth_n_mappings(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9681,7 +10971,12 @@ fn test_v2_create_auth_n_mapping(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9703,7 +10998,12 @@ fn test_v2_delete_auth_n_mapping(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9725,7 +11025,12 @@ fn test_v2_get_auth_n_mapping(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9751,7 +11056,12 @@ fn test_v2_update_auth_n_mapping(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9776,7 +11086,12 @@ fn test_v2_create_ci_app_pipeline_event( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9801,7 +11116,12 @@ fn test_v2_aggregate_ci_app_pipeline_events( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9861,7 +11181,12 @@ fn test_v2_list_ci_app_pipeline_events( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9890,7 +11215,12 @@ fn test_v2_search_ci_app_pipeline_events( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9914,7 +11244,12 @@ fn test_v2_aggregate_ci_app_test_events( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9971,7 +11306,12 @@ fn test_v2_list_ci_app_test_events(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -9999,7 +11339,12 @@ fn test_v2_search_ci_app_test_events( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10050,7 +11395,12 @@ fn test_v2_list_container_images(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10101,7 +11451,12 @@ fn test_v2_list_containers(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10123,7 +11478,12 @@ fn test_v2_list_cost_awscur_configs( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10147,7 +11507,12 @@ fn test_v2_create_cost_awscur_config( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10174,7 +11539,12 @@ fn test_v2_delete_cost_awscur_config( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10203,7 +11573,12 @@ fn test_v2_update_cost_awscur_config( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10235,7 +11610,12 @@ fn test_v2_list_aws_related_accounts( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10257,7 +11637,12 @@ fn test_v2_list_cost_azure_uc_configs( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10281,7 +11666,12 @@ fn test_v2_create_cost_azure_uc_configs( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10308,7 +11698,12 @@ fn test_v2_delete_cost_azure_uc_config( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10337,7 +11732,12 @@ fn test_v2_update_cost_azure_uc_configs( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10356,7 +11756,12 @@ fn test_v2_get_cloud_cost_activity(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10378,7 +11783,12 @@ fn test_v2_get_active_billing_dimensions( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10439,7 +11849,12 @@ fn test_v2_get_monthly_cost_attribution( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10472,7 +11887,12 @@ fn test_v2_get_usage_application_security_monitoring( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10502,7 +11922,12 @@ fn test_v2_get_cost_by_org(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10556,7 +11981,12 @@ fn test_v2_get_estimated_cost_by_org( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10595,7 +12025,12 @@ fn test_v2_get_historical_cost_by_org( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10662,7 +12097,12 @@ fn test_v2_get_hourly_usage(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10694,7 +12134,12 @@ fn test_v2_get_usage_lambda_traced_invocations( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10726,7 +12171,12 @@ fn test_v2_get_usage_observability_pipelines( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10751,7 +12201,12 @@ fn test_v2_get_projected_cost(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10780,7 +12235,12 @@ fn test_v2_delete_dashboard_list_items( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10806,7 +12266,12 @@ fn test_v2_get_dashboard_list_items( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10835,7 +12300,12 @@ fn test_v2_create_dashboard_list_items( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10864,7 +12334,12 @@ fn test_v2_update_dashboard_list_items( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10885,7 +12360,12 @@ fn test_v2_create_dora_deployment(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10906,7 +12386,12 @@ fn test_v2_create_dora_incident(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10951,7 +12436,12 @@ fn test_v2_list_downtimes(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10972,7 +12462,12 @@ fn test_v2_create_downtime(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -10994,7 +12489,12 @@ fn test_v2_cancel_downtime(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11024,7 +12524,12 @@ fn test_v2_get_downtime(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11047,7 +12552,12 @@ fn test_v2_update_downtime(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11083,7 +12593,12 @@ fn test_v2_list_monitor_downtimes(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11140,7 +12655,12 @@ fn test_v2_list_events(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11165,7 +12685,12 @@ fn test_v2_search_events(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11204,7 +12729,12 @@ fn test_v2_list_incidents(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11225,7 +12755,12 @@ fn test_v2_create_incident(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11272,7 +12807,12 @@ fn test_v2_search_incidents(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11294,7 +12834,12 @@ fn test_v2_delete_incident(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11324,7 +12869,12 @@ fn test_v2_get_incident(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11356,7 +12906,12 @@ fn test_v2_update_incident(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11395,7 +12950,12 @@ fn test_v2_list_incident_attachments( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11430,7 +12990,12 @@ fn test_v2_update_incident_attachments( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11455,7 +13020,12 @@ fn test_v2_list_incident_integrations( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11482,7 +13052,12 @@ fn test_v2_create_incident_integration( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11513,7 +13088,12 @@ fn test_v2_delete_incident_integration( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11544,7 +13124,12 @@ fn test_v2_get_incident_integration( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11577,7 +13162,12 @@ fn test_v2_update_incident_integration( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11599,7 +13189,12 @@ fn test_v2_list_incident_todos(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11622,7 +13217,12 @@ fn test_v2_create_incident_todo(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11648,7 +13248,12 @@ fn test_v2_delete_incident_todo(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11674,7 +13279,12 @@ fn test_v2_get_incident_todo(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11702,7 +13312,12 @@ fn test_v2_update_incident_todo(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11721,7 +13336,12 @@ fn test_v2_list_gcpsts_accounts(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11742,7 +13362,12 @@ fn test_v2_create_gcpsts_account(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11764,7 +13389,12 @@ fn test_v2_delete_gcpsts_account(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11788,7 +13418,12 @@ fn test_v2_update_gcpsts_account(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11807,7 +13442,12 @@ fn test_v2_get_gcpsts_delegate(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11832,7 +13472,12 @@ fn test_v2_make_gcpsts_delegate(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11851,7 +13496,12 @@ fn test_v2_list_opsgenie_services(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11872,7 +13522,12 @@ fn test_v2_create_opsgenie_service(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11896,7 +13551,12 @@ fn test_v2_delete_opsgenie_service(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11920,7 +13580,12 @@ fn test_v2_get_opsgenie_service(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11946,7 +13611,12 @@ fn test_v2_update_opsgenie_service(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11968,7 +13638,12 @@ fn test_v2_list_cloudflare_accounts( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -11992,7 +13667,12 @@ fn test_v2_create_cloudflare_account( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12018,7 +13698,12 @@ fn test_v2_delete_cloudflare_account( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12041,7 +13726,12 @@ fn test_v2_get_cloudflare_account(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12070,7 +13760,12 @@ fn test_v2_update_cloudflare_account( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12089,7 +13784,12 @@ fn test_v2_list_confluent_account(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12113,7 +13813,12 @@ fn test_v2_create_confluent_account( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12138,7 +13843,12 @@ fn test_v2_delete_confluent_account( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12160,7 +13870,12 @@ fn test_v2_get_confluent_account(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12187,7 +13902,12 @@ fn test_v2_update_confluent_account( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12209,7 +13929,12 @@ fn test_v2_list_confluent_resource(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12236,7 +13961,12 @@ fn test_v2_create_confluent_resource( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12266,7 +13996,12 @@ fn test_v2_delete_confluent_resource( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12293,7 +14028,12 @@ fn test_v2_get_confluent_resource(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12325,7 +14065,12 @@ fn test_v2_update_confluent_resource( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12344,7 +14089,12 @@ fn test_v2_list_fastly_accounts(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12365,7 +14115,12 @@ fn test_v2_create_fastly_account(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12387,7 +14142,12 @@ fn test_v2_delete_fastly_account(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12409,7 +14169,12 @@ fn test_v2_get_fastly_account(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12433,7 +14198,12 @@ fn test_v2_update_fastly_account(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12455,7 +14225,12 @@ fn test_v2_list_fastly_services(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12479,7 +14254,12 @@ fn test_v2_create_fastly_service(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12506,7 +14286,12 @@ fn test_v2_delete_fastly_service(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12533,7 +14318,12 @@ fn test_v2_get_fastly_service(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12562,7 +14352,12 @@ fn test_v2_update_fastly_service(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12581,7 +14376,12 @@ fn test_v2_list_okta_accounts(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12602,7 +14402,12 @@ fn test_v2_create_okta_account(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12624,7 +14429,12 @@ fn test_v2_delete_okta_account(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12646,7 +14456,12 @@ fn test_v2_get_okta_account(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12669,7 +14484,12 @@ fn test_v2_update_okta_account(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12688,7 +14508,12 @@ fn test_v2_get_ip_allowlist(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12709,7 +14534,12 @@ fn test_v2_update_ip_allowlist(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12744,7 +14574,12 @@ fn test_v2_submit_log(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12765,7 +14600,12 @@ fn test_v2_aggregate_logs(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12834,7 +14674,12 @@ fn test_v2_list_logs_get(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12859,7 +14704,12 @@ fn test_v2_list_logs(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12878,7 +14728,12 @@ fn test_v2_get_logs_archive_order(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12902,7 +14757,12 @@ fn test_v2_update_logs_archive_order( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12921,7 +14781,12 @@ fn test_v2_list_logs_archives(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12942,7 +14807,12 @@ fn test_v2_create_logs_archive(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12964,7 +14834,12 @@ fn test_v2_delete_logs_archive(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -12986,7 +14861,12 @@ fn test_v2_get_logs_archive(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13009,7 +14889,12 @@ fn test_v2_update_logs_archive(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13036,7 +14921,12 @@ fn test_v2_remove_role_from_archive( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13058,7 +14948,12 @@ fn test_v2_list_archive_read_roles(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13084,7 +14979,12 @@ fn test_v2_add_read_role_to_archive( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13103,7 +15003,12 @@ fn test_v2_list_logs_metrics(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13124,7 +15029,12 @@ fn test_v2_create_logs_metric(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13145,7 +15055,12 @@ fn test_v2_delete_logs_metric(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13166,7 +15081,12 @@ fn test_v2_get_logs_metric(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13188,7 +15108,12 @@ fn test_v2_update_logs_metric(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13252,7 +15177,12 @@ fn test_v2_list_tag_configurations(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13277,7 +15207,12 @@ fn test_v2_delete_bulk_tags_metrics_configuration( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13302,7 +15237,12 @@ fn test_v2_create_bulk_tags_metrics_configuration( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13335,7 +15275,12 @@ fn test_v2_list_active_metric_configurations( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13360,7 +15305,12 @@ fn test_v2_list_tags_by_metric_name( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13417,7 +15367,12 @@ fn test_v2_estimate_metrics_output_series( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13442,7 +15397,12 @@ fn test_v2_delete_tag_configuration( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13467,7 +15427,12 @@ fn test_v2_list_tag_configuration_by_name( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13493,7 +15458,12 @@ fn test_v2_update_tag_configuration( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13519,7 +15489,12 @@ fn test_v2_create_tag_configuration( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13544,7 +15519,12 @@ fn test_v2_list_volumes_by_metric_name( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13565,7 +15545,12 @@ fn test_v2_query_scalar_data(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13586,7 +15571,12 @@ fn test_v2_query_timeseries_data(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13615,7 +15605,12 @@ fn test_v2_submit_metrics(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13637,7 +15632,12 @@ fn test_v2_list_monitor_config_policies( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13661,7 +15661,12 @@ fn test_v2_create_monitor_config_policy( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13685,7 +15690,12 @@ fn test_v2_delete_monitor_config_policy( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13709,7 +15719,12 @@ fn test_v2_get_monitor_config_policy( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13734,7 +15749,12 @@ fn test_v2_update_monitor_config_policy( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13753,7 +15773,12 @@ fn test_v2_list_permissions(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13804,7 +15829,12 @@ fn test_v2_list_roles(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13825,7 +15855,12 @@ fn test_v2_create_role(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13846,7 +15881,12 @@ fn test_v2_delete_role(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13867,7 +15907,12 @@ fn test_v2_get_role(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13889,7 +15934,12 @@ fn test_v2_update_role(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13911,7 +15961,12 @@ fn test_v2_clone_role(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13936,7 +15991,12 @@ fn test_v2_remove_permission_from_role( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13957,7 +16017,12 @@ fn test_v2_list_role_permissions(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -13979,7 +16044,12 @@ fn test_v2_add_permission_to_role(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14001,7 +16071,12 @@ fn test_v2_remove_user_from_role(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14048,7 +16123,12 @@ fn test_v2_list_role_users(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14070,7 +16150,12 @@ fn test_v2_add_user_to_role(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14165,7 +16250,12 @@ fn test_v2_list_findings(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14186,7 +16276,12 @@ fn test_v2_mute_findings(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14216,7 +16311,12 @@ fn test_v2_get_finding(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14235,7 +16335,12 @@ fn test_v2_list_security_filters(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14256,7 +16361,12 @@ fn test_v2_create_security_filter(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14279,7 +16389,12 @@ fn test_v2_delete_security_filter(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14302,7 +16417,12 @@ fn test_v2_get_security_filter(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14328,7 +16448,12 @@ fn test_v2_update_security_filter(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14364,7 +16489,12 @@ fn test_v2_list_security_monitoring_rules( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14389,7 +16519,12 @@ fn test_v2_create_security_monitoring_rule( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14414,7 +16549,12 @@ fn test_v2_delete_security_monitoring_rule( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14439,7 +16579,12 @@ fn test_v2_get_security_monitoring_rule( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14467,7 +16612,12 @@ fn test_v2_update_security_monitoring_rule( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14527,7 +16677,12 @@ fn test_v2_list_security_monitoring_signals( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14556,7 +16711,12 @@ fn test_v2_search_security_monitoring_signals( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14581,7 +16741,12 @@ fn test_v2_get_security_monitoring_signal( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14611,7 +16776,12 @@ fn test_v2_edit_security_monitoring_signal_assignee( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14641,7 +16811,12 @@ fn test_v2_edit_security_monitoring_signal_incidents( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14670,7 +16845,12 @@ fn test_v2_edit_security_monitoring_signal_state( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14703,7 +16883,12 @@ fn test_v2_list_powerpacks(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14724,7 +16909,12 @@ fn test_v2_create_powerpack(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14746,7 +16936,12 @@ fn test_v2_delete_powerpack(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14768,7 +16963,12 @@ fn test_v2_get_powerpack(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14791,7 +16991,12 @@ fn test_v2_update_powerpack(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14848,7 +17053,12 @@ fn test_v2_list_processes(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14874,7 +17084,12 @@ fn test_v2_delete_restriction_policy( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14897,7 +17112,12 @@ fn test_v2_get_restriction_policy(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14926,7 +17146,12 @@ fn test_v2_update_restriction_policy( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14947,7 +17172,12 @@ fn test_v2_aggregate_rum_events(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14966,7 +17196,12 @@ fn test_v2_get_rum_applications(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -14987,7 +17222,12 @@ fn test_v2_create_rum_application(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15008,7 +17248,12 @@ fn test_v2_delete_rum_application(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15029,7 +17274,12 @@ fn test_v2_get_rum_application(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15051,7 +17301,12 @@ fn test_v2_update_rum_application(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15108,7 +17363,12 @@ fn test_v2_list_rum_events(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15129,7 +17389,12 @@ fn test_v2_search_rum_events(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15154,7 +17419,12 @@ fn test_v2_upload_id_p_metadata(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15236,7 +17506,12 @@ fn test_v2_list_scorecard_outcomes(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15261,7 +17536,12 @@ fn test_v2_create_scorecard_outcomes_batch( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15343,7 +17623,12 @@ fn test_v2_list_scorecard_rules(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15364,7 +17649,12 @@ fn test_v2_create_scorecard_rule(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15385,7 +17675,12 @@ fn test_v2_delete_scorecard_rule(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15407,7 +17702,12 @@ fn test_v2_download_cloud_workload_policy_file( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15429,7 +17729,12 @@ fn test_v2_list_cloud_workload_security_agent_rules( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15457,7 +17762,12 @@ fn test_v2_create_cloud_workload_security_agent_rule( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15486,7 +17796,12 @@ fn test_v2_delete_cloud_workload_security_agent_rule( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15515,7 +17830,12 @@ fn test_v2_get_cloud_workload_security_agent_rule( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15546,7 +17866,12 @@ fn test_v2_update_cloud_workload_security_agent_rule( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15565,7 +17890,12 @@ fn test_v2_list_scanning_groups(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15586,7 +17916,12 @@ fn test_v2_reorder_scanning_groups(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15607,7 +17942,12 @@ fn test_v2_create_scanning_group(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15630,7 +17970,12 @@ fn test_v2_delete_scanning_group(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15653,7 +17998,12 @@ fn test_v2_update_scanning_group(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15674,7 +18024,12 @@ fn test_v2_create_scanning_rule(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15697,7 +18052,12 @@ fn test_v2_delete_scanning_rule(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15720,7 +18080,12 @@ fn test_v2_update_scanning_rule(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15739,7 +18104,12 @@ fn test_v2_list_standard_patterns(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15760,7 +18130,12 @@ fn test_v2_create_service_account(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15825,7 +18200,12 @@ fn test_v2_list_service_account_application_keys( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15855,7 +18235,12 @@ fn test_v2_create_service_account_application_key( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15886,7 +18271,12 @@ fn test_v2_delete_service_account_application_key( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15916,7 +18306,12 @@ fn test_v2_get_service_account_application_key( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15949,7 +18344,12 @@ fn test_v2_update_service_account_application_key( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -15994,7 +18394,12 @@ fn test_v2_list_incident_services(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16015,7 +18420,12 @@ fn test_v2_create_incident_service(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16037,7 +18447,12 @@ fn test_v2_delete_incident_service(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16067,7 +18482,12 @@ fn test_v2_get_incident_service(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16091,7 +18511,12 @@ fn test_v2_update_incident_service(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16133,7 +18558,12 @@ fn test_v2_list_service_definitions( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16158,7 +18588,12 @@ fn test_v2_create_or_update_service_definitions( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16184,7 +18619,12 @@ fn test_v2_delete_service_definition( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16214,7 +18654,12 @@ fn test_v2_get_service_definition(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16235,7 +18680,12 @@ fn test_v2_aggregate_spans(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16292,7 +18742,12 @@ fn test_v2_list_spans_get(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16313,7 +18768,12 @@ fn test_v2_list_spans(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16335,7 +18795,12 @@ fn test_v2_get_on_demand_concurrency_cap( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16359,7 +18824,12 @@ fn test_v2_set_on_demand_concurrency_cap( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16422,7 +18892,12 @@ fn test_v2_list_teams(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16443,7 +18918,12 @@ fn test_v2_create_team(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16464,7 +18944,12 @@ fn test_v2_delete_team(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16485,7 +18970,12 @@ fn test_v2_get_team(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16507,7 +18997,12 @@ fn test_v2_update_team(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16528,7 +19023,12 @@ fn test_v2_get_team_links(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16550,7 +19050,12 @@ fn test_v2_create_team_link(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16572,7 +19077,12 @@ fn test_v2_delete_team_link(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16594,7 +19104,12 @@ fn test_v2_get_team_link(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16621,7 +19136,12 @@ fn test_v2_update_team_link(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16668,7 +19188,12 @@ fn test_v2_get_team_memberships(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16690,7 +19215,12 @@ fn test_v2_create_team_membership(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16712,7 +19242,12 @@ fn test_v2_delete_team_membership(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16739,7 +19274,12 @@ fn test_v2_update_team_membership(world: &mut DatadogWorld, _parameters: &HashMa Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16763,7 +19303,12 @@ fn test_v2_get_team_permission_settings( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16793,7 +19338,12 @@ fn test_v2_update_team_permission_setting( Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16814,7 +19364,12 @@ fn test_v2_get_user_memberships(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16859,7 +19414,12 @@ fn test_v2_list_incident_teams(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16880,7 +19440,12 @@ fn test_v2_create_incident_team(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16901,7 +19466,12 @@ fn test_v2_delete_incident_team(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16927,7 +19497,12 @@ fn test_v2_get_incident_team(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16949,7 +19524,12 @@ fn test_v2_update_incident_team(world: &mut DatadogWorld, _parameters: &HashMap< Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16970,7 +19550,12 @@ fn test_v2_send_invitations(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -16994,7 +19579,12 @@ fn test_v2_get_invitation(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -17051,7 +19641,12 @@ fn test_v2_list_users(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -17072,7 +19667,12 @@ fn test_v2_create_user(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -17093,7 +19693,12 @@ fn test_v2_disable_user(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -17114,7 +19719,12 @@ fn test_v2_get_user(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -17136,7 +19746,12 @@ fn test_v2_update_user(world: &mut DatadogWorld, _parameters: &HashMap response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -17157,7 +19772,12 @@ fn test_v2_list_user_organizations(world: &mut DatadogWorld, _parameters: &HashM Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; } @@ -17178,7 +19798,12 @@ fn test_v2_list_user_permissions(world: &mut DatadogWorld, _parameters: &HashMap Ok(response) => response, Err(error) => { return match error { - Error::ResponseError(e) => world.response.code = e.status.as_u16(), + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } _ => panic!("error parsing response: {}", error), }; }