From aacc4cb748144bd9a879bca908bb1aec641cdae9 Mon Sep 17 00:00:00 2001 From: Kevin Zou <17015060+nkzou@users.noreply.github.com> Date: Tue, 9 Apr 2024 13:16:13 -0400 Subject: [PATCH] Refactor imports (#69) Co-authored-by: ci.datadog-api-spec --- .generator/src/generator/formatter.py | 2 +- .generator/src/generator/templates/api.j2 | 47 +- .../src/generator/templates/common_mod.j2 | 36 +- .generator/src/generator/templates/example.j2 | 6 +- .../generator/templates/function_mappings.j2 | 8 +- .generator/src/generator/templates/mod.j2 | 4 + README.md | 4 +- examples/v1_authentication_validate.rs | 6 +- .../v1_aws-integration_create_aws_account.rs | 6 +- ...egration_create_aws_event_bridge_source.rs | 6 +- ...1_aws-integration_create_aws_tag_filter.rs | 6 +- ...-integration_create_new_aws_external_id.rs | 6 +- .../v1_aws-integration_delete_aws_account.rs | 6 +- ...egration_delete_aws_event_bridge_source.rs | 6 +- ...1_aws-integration_delete_aws_tag_filter.rs | 6 +- ...tegration_list_available_aws_namespaces.rs | 6 +- .../v1_aws-integration_list_aws_accounts.rs | 8 +- ...tegration_list_aws_event_bridge_sources.rs | 6 +- ...v1_aws-integration_list_aws_tag_filters.rs | 6 +- .../v1_aws-integration_update_aws_account.rs | 8 +- ...integration_check_aws_logs_lambda_async.rs | 6 +- ...tegration_check_aws_logs_services_async.rs | 6 +- ...-logs-integration_create_aws_lambda_arn.rs | 6 +- ...-logs-integration_delete_aws_lambda_arn.rs | 6 +- ...ogs-integration_enable_aws_log_services.rs | 6 +- ...-integration_list_aws_logs_integrations.rs | 6 +- ...logs-integration_list_aws_logs_services.rs | 6 +- ...re-integration_create_azure_integration.rs | 6 +- ...re-integration_delete_azure_integration.rs | 6 +- ...zure-integration_list_azure_integration.rs | 6 +- ...e-integration_update_azure_host_filters.rs | 6 +- ...re-integration_update_azure_integration.rs | 6 +- ...1_dashboard-lists_create_dashboard_list.rs | 6 +- ...1_dashboard-lists_delete_dashboard_list.rs | 6 +- .../v1_dashboard-lists_get_dashboard_list.rs | 6 +- ...v1_dashboard-lists_list_dashboard_lists.rs | 6 +- ...1_dashboard-lists_update_dashboard_list.rs | 6 +- examples/v1_dashboards_create_dashboard.rs | 6 +- ..._dashboards_create_dashboard_1024858348.rs | 6 +- ..._dashboards_create_dashboard_1039800684.rs | 6 +- ...1_dashboards_create_dashboard_109450134.rs | 6 +- ..._dashboards_create_dashboard_1094917386.rs | 6 +- ..._dashboards_create_dashboard_1177423752.rs | 6 +- ..._dashboards_create_dashboard_1200099236.rs | 6 +- ..._dashboards_create_dashboard_1213075383.rs | 6 +- ..._dashboards_create_dashboard_1284514532.rs | 6 +- ..._dashboards_create_dashboard_1307120899.rs | 6 +- ..._dashboards_create_dashboard_1423904722.rs | 6 +- ..._dashboards_create_dashboard_1442588603.rs | 6 +- ...1_dashboards_create_dashboard_145494973.rs | 6 +- ...1_dashboards_create_dashboard_173805046.rs | 6 +- ..._dashboards_create_dashboard_1738608750.rs | 6 +- ..._dashboards_create_dashboard_1754992756.rs | 6 +- ..._dashboards_create_dashboard_1877023900.rs | 6 +- ..._dashboards_create_dashboard_2029850837.rs | 6 +- ..._dashboards_create_dashboard_2034634967.rs | 6 +- ..._dashboards_create_dashboard_2064651578.rs | 6 +- ..._dashboards_create_dashboard_2104498738.rs | 6 +- ..._dashboards_create_dashboard_2261785072.rs | 6 +- ..._dashboards_create_dashboard_2278756614.rs | 6 +- ..._dashboards_create_dashboard_2308247857.rs | 6 +- ..._dashboards_create_dashboard_2316374332.rs | 6 +- ..._dashboards_create_dashboard_2336428357.rs | 6 +- ..._dashboards_create_dashboard_2338918735.rs | 6 +- ..._dashboards_create_dashboard_2342457693.rs | 6 +- ..._dashboards_create_dashboard_2349863258.rs | 6 +- ..._dashboards_create_dashboard_2361531620.rs | 6 +- ..._dashboards_create_dashboard_2432046716.rs | 6 +- ..._dashboards_create_dashboard_2490110261.rs | 6 +- ...1_dashboards_create_dashboard_252716965.rs | 6 +- ..._dashboards_create_dashboard_2607944105.rs | 6 +- ..._dashboards_create_dashboard_2610827685.rs | 6 +- ..._dashboards_create_dashboard_2618036642.rs | 6 +- ..._dashboards_create_dashboard_2634813877.rs | 6 +- ..._dashboards_create_dashboard_2644712913.rs | 6 +- ..._dashboards_create_dashboard_2652180930.rs | 6 +- ..._dashboards_create_dashboard_2705593938.rs | 6 +- ..._dashboards_create_dashboard_2800096921.rs | 6 +- ..._dashboards_create_dashboard_2843286292.rs | 6 +- ..._dashboards_create_dashboard_2850365602.rs | 6 +- ..._dashboards_create_dashboard_2917274132.rs | 6 +- ..._dashboards_create_dashboard_2921337351.rs | 6 +- ..._dashboards_create_dashboard_3117424216.rs | 6 +- ..._dashboards_create_dashboard_3195475781.rs | 6 +- ..._dashboards_create_dashboard_3250131584.rs | 6 +- ..._dashboards_create_dashboard_3513586382.rs | 6 +- ..._dashboards_create_dashboard_3562282606.rs | 6 +- ..._dashboards_create_dashboard_3669695268.rs | 6 +- ..._dashboards_create_dashboard_3777304439.rs | 6 +- ..._dashboards_create_dashboard_3882428227.rs | 6 +- ..._dashboards_create_dashboard_3982498788.rs | 6 +- ..._dashboards_create_dashboard_4026341408.rs | 6 +- ..._dashboards_create_dashboard_4076476470.rs | 6 +- ...v1_dashboards_create_dashboard_41622531.rs | 6 +- ...1_dashboards_create_dashboard_417992286.rs | 6 +- ...1_dashboards_create_dashboard_578885732.rs | 6 +- ...1_dashboards_create_dashboard_651038379.rs | 6 +- ...1_dashboards_create_dashboard_765140092.rs | 6 +- ...1_dashboards_create_dashboard_798168180.rs | 6 +- ...1_dashboards_create_dashboard_803346562.rs | 6 +- ...1_dashboards_create_dashboard_858397694.rs | 6 +- ...1_dashboards_create_dashboard_913313564.rs | 6 +- ...1_dashboards_create_dashboard_915214113.rs | 6 +- ...1_dashboards_create_dashboard_927141680.rs | 6 +- .../v1_dashboards_create_public_dashboard.rs | 6 +- examples/v1_dashboards_delete_dashboard.rs | 6 +- examples/v1_dashboards_delete_dashboards.rs | 6 +- .../v1_dashboards_delete_public_dashboard.rs | 6 +- ...ards_delete_public_dashboard_invitation.rs | 6 +- examples/v1_dashboards_get_dashboard.rs | 6 +- .../v1_dashboards_get_dashboard_4262333854.rs | 6 +- .../v1_dashboards_get_public_dashboard.rs | 6 +- ...boards_get_public_dashboard_invitations.rs | 8 +- examples/v1_dashboards_list_dashboards.rs | 8 +- ...1_dashboards_list_dashboards_1062671515.rs | 8 +- ...1_dashboards_list_dashboards_1773932563.rs | 8 +- examples/v1_dashboards_restore_dashboards.rs | 6 +- ...boards_send_public_dashboard_invitation.rs | 6 +- examples/v1_dashboards_update_dashboard.rs | 6 +- ..._dashboards_update_dashboard_3454865944.rs | 6 +- .../v1_dashboards_update_public_dashboard.rs | 6 +- examples/v1_downtimes_cancel_downtime.rs | 6 +- .../v1_downtimes_cancel_downtimes_by_scope.rs | 6 +- examples/v1_downtimes_create_downtime.rs | 6 +- ...v1_downtimes_create_downtime_1393233946.rs | 6 +- ...v1_downtimes_create_downtime_2908359488.rs | 6 +- ...v1_downtimes_create_downtime_3059354445.rs | 6 +- ...v1_downtimes_create_downtime_3355644446.rs | 6 +- examples/v1_downtimes_get_downtime.rs | 6 +- examples/v1_downtimes_list_downtimes.rs | 8 +- .../v1_downtimes_list_monitor_downtimes.rs | 6 +- examples/v1_downtimes_update_downtime.rs | 6 +- examples/v1_events_create_event.rs | 6 +- examples/v1_events_create_event_19927815.rs | 6 +- examples/v1_events_get_event.rs | 6 +- examples/v1_events_list_events.rs | 8 +- ..._gcp-integration_create_gcp_integration.rs | 6 +- ..._gcp-integration_delete_gcp_integration.rs | 6 +- ...v1_gcp-integration_list_gcp_integration.rs | 6 +- ..._gcp-integration_update_gcp_integration.rs | 6 +- ...ation_update_gcp_integration_3544259255.rs | 6 +- examples/v1_hosts_get_host_totals.rs | 8 +- examples/v1_hosts_list_hosts.rs | 8 +- examples/v1_hosts_list_hosts_2975406675.rs | 8 +- examples/v1_hosts_list_hosts_347346033.rs | 8 +- examples/v1_hosts_mute_host.rs | 6 +- examples/v1_hosts_unmute_host.rs | 6 +- examples/v1_ip-ranges_get_ip_ranges.rs | 6 +- examples/v1_key-management_create_api_key.rs | 6 +- ...1_key-management_create_application_key.rs | 6 +- examples/v1_key-management_delete_api_key.rs | 6 +- ...1_key-management_delete_application_key.rs | 6 +- examples/v1_key-management_get_api_key.rs | 6 +- .../v1_key-management_get_application_key.rs | 6 +- examples/v1_key-management_list_api_keys.rs | 6 +- ...v1_key-management_list_application_keys.rs | 6 +- examples/v1_key-management_update_api_key.rs | 6 +- ...1_key-management_update_application_key.rs | 6 +- examples/v1_logs-indexes_create_logs_index.rs | 6 +- examples/v1_logs-indexes_get_logs_index.rs | 6 +- .../v1_logs-indexes_get_logs_index_order.rs | 6 +- examples/v1_logs-indexes_list_log_indexes.rs | 6 +- examples/v1_logs-indexes_update_logs_index.rs | 6 +- ...v1_logs-indexes_update_logs_index_order.rs | 6 +- .../v1_logs-pipelines_create_logs_pipeline.rs | 6 +- .../v1_logs-pipelines_delete_logs_pipeline.rs | 6 +- .../v1_logs-pipelines_get_logs_pipeline.rs | 6 +- ..._logs-pipelines_get_logs_pipeline_order.rs | 6 +- .../v1_logs-pipelines_list_logs_pipelines.rs | 6 +- .../v1_logs-pipelines_update_logs_pipeline.rs | 6 +- ...gs-pipelines_update_logs_pipeline_order.rs | 6 +- examples/v1_logs_list_logs.rs | 6 +- examples/v1_logs_list_logs_235998668.rs | 6 +- examples/v1_logs_submit_log.rs | 8 +- examples/v1_logs_submit_log_1920474053.rs | 8 +- examples/v1_logs_submit_log_3418823904.rs | 8 +- examples/v1_metrics_get_metric_metadata.rs | 6 +- examples/v1_metrics_list_active_metrics.rs | 8 +- examples/v1_metrics_list_metrics.rs | 6 +- examples/v1_metrics_query_metrics.rs | 6 +- .../v1_metrics_submit_distribution_points.rs | 8 +- ...s_submit_distribution_points_3109558960.rs | 8 +- examples/v1_metrics_submit_metrics.rs | 8 +- .../v1_metrics_submit_metrics_2203981258.rs | 8 +- examples/v1_metrics_update_metric_metadata.rs | 6 +- .../v1_monitors_check_can_delete_monitor.rs | 6 +- examples/v1_monitors_create_monitor.rs | 6 +- .../v1_monitors_create_monitor_1539578087.rs | 6 +- .../v1_monitors_create_monitor_1969035628.rs | 6 +- .../v1_monitors_create_monitor_2012680290.rs | 6 +- .../v1_monitors_create_monitor_2520912138.rs | 6 +- .../v1_monitors_create_monitor_3790803616.rs | 6 +- .../v1_monitors_create_monitor_3824294658.rs | 6 +- .../v1_monitors_create_monitor_3883669300.rs | 6 +- .../v1_monitors_create_monitor_440013737.rs | 6 +- examples/v1_monitors_delete_monitor.rs | 8 +- examples/v1_monitors_get_monitor.rs | 8 +- .../v1_monitors_get_monitor_2200114573.rs | 8 +- .../v1_monitors_get_monitor_3691711704.rs | 8 +- examples/v1_monitors_list_monitors.rs | 8 +- .../v1_monitors_list_monitors_2966492814.rs | 8 +- .../v1_monitors_list_monitors_3448441939.rs | 8 +- examples/v1_monitors_search_monitor_groups.rs | 8 +- examples/v1_monitors_search_monitors.rs | 8 +- examples/v1_monitors_update_monitor.rs | 6 +- .../v1_monitors_validate_existing_monitor.rs | 6 +- examples/v1_monitors_validate_monitor.rs | 6 +- ...v1_monitors_validate_monitor_4247196452.rs | 6 +- examples/v1_notebooks_create_notebook.rs | 6 +- examples/v1_notebooks_delete_notebook.rs | 6 +- examples/v1_notebooks_get_notebook.rs | 6 +- examples/v1_notebooks_list_notebooks.rs | 8 +- .../v1_notebooks_list_notebooks_788665428.rs | 8 +- examples/v1_notebooks_update_notebook.rs | 6 +- examples/v1_organizations_create_child_org.rs | 6 +- examples/v1_organizations_downgrade_org.rs | 6 +- examples/v1_organizations_get_org.rs | 6 +- examples/v1_organizations_list_orgs.rs | 6 +- examples/v1_organizations_update_org.rs | 6 +- .../v1_organizations_upload_idp_for_org.rs | 6 +- ...n_create_pager_duty_integration_service.rs | 6 +- ...n_delete_pager_duty_integration_service.rs | 6 +- ...tion_get_pager_duty_integration_service.rs | 6 +- ...n_update_pager_duty_integration_service.rs | 6 +- ..._security_monitoring_signal_to_incident.rs | 6 +- ...dit_security_monitoring_signal_assignee.rs | 6 +- ...g_edit_security_monitoring_signal_state.rs | 6 +- .../v1_service-checks_submit_service_check.rs | 6 +- ...ctive-corrections_create_slo_correction.rs | 6 +- ...ctions_create_slo_correction_1326388368.rs | 6 +- ...ctive-corrections_delete_slo_correction.rs | 6 +- ...bjective-corrections_get_slo_correction.rs | 6 +- ...jective-corrections_list_slo_correction.rs | 8 +- ...rections_list_slo_correction_2647266873.rs | 8 +- ...ctive-corrections_update_slo_correction.rs | 6 +- ...e-level-objectives_check_can_delete_slo.rs | 6 +- .../v1_service-level-objectives_create_slo.rs | 6 +- ...-level-objectives_create_slo_3765703239.rs | 6 +- .../v1_service-level-objectives_delete_slo.rs | 8 +- ...objectives_delete_slo_timeframe_in_bulk.rs | 6 +- .../v1_service-level-objectives_get_slo.rs | 8 +- ...ce-level-objectives_get_slo_corrections.rs | 6 +- ...ervice-level-objectives_get_slo_history.rs | 8 +- .../v1_service-level-objectives_list_slos.rs | 8 +- ...e-level-objectives_list_slos_3036942817.rs | 8 +- .../v1_service-level-objectives_search_slo.rs | 8 +- .../v1_service-level-objectives_update_slo.rs | 6 +- ...ration_create_slack_integration_channel.rs | 6 +- ...tegration_get_slack_integration_channel.rs | 6 +- ...egration_get_slack_integration_channels.rs | 6 +- ...ration_remove_slack_integration_channel.rs | 6 +- ...ration_update_slack_integration_channel.rs | 6 +- examples/v1_snapshots_get_graph_snapshot.rs | 8 +- .../v1_synthetics_create_global_variable.rs | 6 +- ...etics_create_global_variable_1068962881.rs | 6 +- .../v1_synthetics_create_private_location.rs | 6 +- ...1_synthetics_create_synthetics_api_test.rs | 6 +- ...s_create_synthetics_api_test_1072503741.rs | 6 +- ...s_create_synthetics_api_test_1241981394.rs | 6 +- ...s_create_synthetics_api_test_1279271422.rs | 6 +- ...s_create_synthetics_api_test_1402674167.rs | 6 +- ...s_create_synthetics_api_test_1487281163.rs | 6 +- ...s_create_synthetics_api_test_2472747642.rs | 6 +- ...s_create_synthetics_api_test_3829801148.rs | 6 +- ...cs_create_synthetics_api_test_960766374.rs | 6 +- ...nthetics_create_synthetics_browser_test.rs | 6 +- ...eate_synthetics_browser_test_2932742688.rs | 6 +- ...reate_synthetics_browser_test_397420811.rs | 6 +- .../v1_synthetics_delete_global_variable.rs | 6 +- .../v1_synthetics_delete_private_location.rs | 6 +- examples/v1_synthetics_delete_tests.rs | 6 +- .../v1_synthetics_edit_global_variable.rs | 6 +- examples/v1_synthetics_get_api_test.rs | 6 +- ..._synthetics_get_api_test_latest_results.rs | 8 +- examples/v1_synthetics_get_api_test_result.rs | 6 +- ...nthetics_get_api_test_result_1321866518.rs | 6 +- examples/v1_synthetics_get_browser_test.rs | 6 +- ...thetics_get_browser_test_latest_results.rs | 8 +- .../v1_synthetics_get_browser_test_result.rs | 6 +- examples/v1_synthetics_get_global_variable.rs | 6 +- .../v1_synthetics_get_private_location.rs | 6 +- .../v1_synthetics_get_synthetics_ci_batch.rs | 6 +- ...hetics_get_synthetics_default_locations.rs | 6 +- ..._synthetics_default_locations_746853380.rs | 6 +- examples/v1_synthetics_get_test.rs | 6 +- .../v1_synthetics_list_global_variables.rs | 6 +- examples/v1_synthetics_list_locations.rs | 6 +- examples/v1_synthetics_list_tests.rs | 8 +- .../v1_synthetics_list_tests_1938827783.rs | 8 +- .../v1_synthetics_list_tests_2779190961.rs | 8 +- examples/v1_synthetics_patch_test.rs | 6 +- examples/v1_synthetics_trigger_ci_tests.rs | 6 +- examples/v1_synthetics_trigger_tests.rs | 6 +- examples/v1_synthetics_update_api_test.rs | 6 +- examples/v1_synthetics_update_browser_test.rs | 6 +- .../v1_synthetics_update_private_location.rs | 6 +- .../v1_synthetics_update_test_pause_status.rs | 6 +- examples/v1_tags_create_host_tags.rs | 8 +- examples/v1_tags_delete_host_tags.rs | 8 +- examples/v1_tags_get_host_tags.rs | 8 +- examples/v1_tags_list_host_tags.rs | 8 +- examples/v1_tags_update_host_tags.rs | 8 +- ...usage-metering_get_daily_custom_reports.rs | 8 +- ...e-metering_get_hourly_usage_attribution.rs | 8 +- ..._usage-metering_get_incident_management.rs | 8 +- .../v1_usage-metering_get_ingested_spans.rs | 8 +- ...age-metering_get_monthly_custom_reports.rs | 8 +- ...-metering_get_monthly_usage_attribution.rs | 8 +- ...et_monthly_usage_attribution_3849653599.rs | 8 +- ...ring_get_specified_daily_custom_reports.rs | 6 +- ...ng_get_specified_monthly_custom_reports.rs | 6 +- ..._usage-metering_get_usage_analyzed_logs.rs | 8 +- .../v1_usage-metering_get_usage_audit_logs.rs | 8 +- ...age-metering_get_usage_billable_summary.rs | 8 +- .../v1_usage-metering_get_usage_ci_app.rs | 8 +- ...usage_cloud_security_posture_management.rs | 8 +- examples/v1_usage-metering_get_usage_cws.rs | 8 +- examples/v1_usage-metering_get_usage_dbm.rs | 8 +- ...usage-metering_get_usage_dbm_3446806203.rs | 8 +- .../v1_usage-metering_get_usage_fargate.rs | 8 +- examples/v1_usage-metering_get_usage_hosts.rs | 8 +- ..._usage-metering_get_usage_indexed_spans.rs | 8 +- ...e-metering_get_usage_internet_of_things.rs | 8 +- .../v1_usage-metering_get_usage_lambda.rs | 8 +- examples/v1_usage-metering_get_usage_logs.rs | 8 +- ...sage-metering_get_usage_logs_2562396405.rs | 8 +- ..._usage-metering_get_usage_logs_by_index.rs | 8 +- ...ring_get_usage_logs_by_index_1025184776.rs | 8 +- ...ge-metering_get_usage_logs_by_retention.rs | 8 +- ..._usage-metering_get_usage_network_flows.rs | 8 +- ...ring_get_usage_network_flows_1239422069.rs | 8 +- ..._usage-metering_get_usage_network_hosts.rs | 8 +- ...ring_get_usage_network_hosts_1249907835.rs | 8 +- ...usage-metering_get_usage_online_archive.rs | 8 +- ...ing_get_usage_online_archive_1501172903.rs | 8 +- .../v1_usage-metering_get_usage_profiling.rs | 8 +- ...1_usage-metering_get_usage_rum_sessions.rs | 8 +- ...ering_get_usage_rum_sessions_3271366243.rs | 8 +- ...tering_get_usage_rum_sessions_714937291.rs | 8 +- .../v1_usage-metering_get_usage_rum_units.rs | 8 +- ...metering_get_usage_rum_units_3959755399.rs | 8 +- examples/v1_usage-metering_get_usage_sds.rs | 8 +- ..._usage-metering_get_usage_sds_271128478.rs | 8 +- examples/v1_usage-metering_get_usage_snmp.rs | 8 +- .../v1_usage-metering_get_usage_summary.rs | 8 +- .../v1_usage-metering_get_usage_synthetics.rs | 8 +- ...usage-metering_get_usage_synthetics_api.rs | 8 +- ...ing_get_usage_synthetics_api_4048033529.rs | 8 +- ...e-metering_get_usage_synthetics_browser.rs | 8 +- ...get_usage_synthetics_browser_1704663299.rs | 8 +- .../v1_usage-metering_get_usage_timeseries.rs | 8 +- ...sage-metering_get_usage_top_avg_metrics.rs | 8 +- examples/v1_users_create_user.rs | 6 +- examples/v1_users_create_user_266604071.rs | 6 +- examples/v1_users_disable_user.rs | 6 +- examples/v1_users_get_user.rs | 6 +- examples/v1_users_list_users.rs | 6 +- examples/v1_users_update_user.rs | 6 +- ...integration_create_webhooks_integration.rs | 6 +- ...te_webhooks_integration_custom_variable.rs | 6 +- ...integration_delete_webhooks_integration.rs | 6 +- ...te_webhooks_integration_custom_variable.rs | 6 +- ...ks-integration_get_webhooks_integration.rs | 6 +- ...et_webhooks_integration_custom_variable.rs | 6 +- ...integration_update_webhooks_integration.rs | 6 +- ...te_webhooks_integration_custom_variable.rs | 6 +- examples/v2_api-management_create_open_api.rs | 8 +- examples/v2_api-management_delete_open_api.rs | 6 +- examples/v2_api-management_get_open_api.rs | 6 +- examples/v2_api-management_update_open_api.rs | 8 +- ...ion-filters_create_apm_retention_filter.rs | 6 +- ...ion-filters_delete_apm_retention_filter.rs | 6 +- ...ention-filters_get_apm_retention_filter.rs | 6 +- ...tion-filters_list_apm_retention_filters.rs | 6 +- ...n-filters_reorder_apm_retention_filters.rs | 6 +- ...ion-filters_update_apm_retention_filter.rs | 6 +- examples/v2_audit_list_audit_logs.rs | 8 +- .../v2_audit_list_audit_logs_1275402458.rs | 8 +- examples/v2_audit_search_audit_logs.rs | 8 +- .../v2_audit_search_audit_logs_3215529662.rs | 8 +- .../v2_authn-mappings_create_authn_mapping.rs | 6 +- .../v2_authn-mappings_delete_authn_mapping.rs | 6 +- .../v2_authn-mappings_get_authn_mapping.rs | 6 +- .../v2_authn-mappings_list_authn_mappings.rs | 8 +- .../v2_authn-mappings_update_authn_mapping.rs | 6 +- examples/v2_case-management_archive_case.rs | 6 +- examples/v2_case-management_assign_case.rs | 6 +- examples/v2_case-management_create_case.rs | 6 +- examples/v2_case-management_create_project.rs | 6 +- examples/v2_case-management_delete_project.rs | 6 +- examples/v2_case-management_get_case.rs | 6 +- examples/v2_case-management_get_project.rs | 6 +- examples/v2_case-management_get_projects.rs | 6 +- examples/v2_case-management_search_cases.rs | 8 +- ...case-management_search_cases_3433960044.rs | 8 +- examples/v2_case-management_unarchive_case.rs | 6 +- examples/v2_case-management_unassign_case.rs | 6 +- .../v2_case-management_update_priority.rs | 6 +- examples/v2_case-management_update_status.rs | 6 +- ...elines_aggregate_ci_app_pipeline_events.rs | 6 +- ...-pipelines_create_ci_app_pipeline_event.rs | 6 +- ..._create_ci_app_pipeline_event_129899466.rs | 6 +- ...y-pipelines_list_ci_app_pipeline_events.rs | 8 +- ..._list_ci_app_pipeline_events_1270618359.rs | 8 +- ...pipelines_search_ci_app_pipeline_events.rs | 8 +- ...earch_ci_app_pipeline_events_3246135003.rs | 8 +- ...lity-tests_aggregate_ci_app_test_events.rs | 6 +- ...isibility-tests_list_ci_app_test_events.rs | 8 +- ...ests_list_ci_app_test_events_3852605281.rs | 8 +- ...ibility-tests_search_ci_app_test_events.rs | 8 +- ...ts_search_ci_app_test_events_1675695429.rs | 8 +- ...st-management_create_cost_awscur_config.rs | 6 +- ...management_create_cost_azure_uc_configs.rs | 6 +- ...st-management_delete_cost_awscur_config.rs | 6 +- ...-management_delete_cost_azure_uc_config.rs | 6 +- ...cost-management_get_cloud_cost_activity.rs | 6 +- ...st-management_list_aws_related_accounts.rs | 6 +- ...ost-management_list_cost_awscur_configs.rs | 6 +- ...t-management_list_cost_azure_uc_configs.rs | 6 +- ...st-management_update_cost_awscur_config.rs | 6 +- ...management_update_cost_azure_uc_configs.rs | 6 +- ...eate_cloud_workload_security_agent_rule.rs | 6 +- ...-security_create_csm_threats_agent_rule.rs | 6 +- ...lete_cloud_workload_security_agent_rule.rs | 6 +- ...-security_delete_csm_threats_agent_rule.rs | 6 +- ...ity_download_cloud_workload_policy_file.rs | 6 +- ...ad-security_download_csm_threats_policy.rs | 6 +- ..._get_cloud_workload_security_agent_rule.rs | 6 +- ...oad-security_get_csm_threats_agent_rule.rs | 6 +- ...ist_cloud_workload_security_agent_rules.rs | 6 +- ...d-security_list_csm_threats_agent_rules.rs | 6 +- ...date_cloud_workload_security_agent_rule.rs | 6 +- ...-security_update_csm_threats_agent_rule.rs | 6 +- ...e-integration_create_cloudflare_account.rs | 6 +- ...e-integration_delete_cloudflare_account.rs | 6 +- ...lare-integration_get_cloudflare_account.rs | 6 +- ...re-integration_list_cloudflare_accounts.rs | 6 +- ...e-integration_update_cloudflare_account.rs | 6 +- ...onfluent-cloud_create_confluent_account.rs | 6 +- ...nfluent-cloud_create_confluent_resource.rs | 6 +- ...onfluent-cloud_delete_confluent_account.rs | 6 +- ...nfluent-cloud_delete_confluent_resource.rs | 6 +- ...2_confluent-cloud_get_confluent_account.rs | 6 +- ..._confluent-cloud_get_confluent_resource.rs | 6 +- ..._confluent-cloud_list_confluent_account.rs | 6 +- ...confluent-cloud_list_confluent_resource.rs | 6 +- ...onfluent-cloud_update_confluent_account.rs | 6 +- ...nfluent-cloud_update_confluent_resource.rs | 6 +- ..._container-images_list_container_images.rs | 8 +- ...images_list_container_images_3088586393.rs | 8 +- ...images_list_container_images_3974828736.rs | 8 +- examples/v2_containers_list_containers.rs | 8 +- ...2_containers_list_containers_2175733917.rs | 8 +- ...v2_containers_list_containers_931009654.rs | 8 +- ...board-lists_create_dashboard_list_items.rs | 6 +- ..._create_dashboard_list_items_3995409989.rs | 6 +- ...s_create_dashboard_list_items_825696022.rs | 6 +- ...board-lists_delete_dashboard_list_items.rs | 6 +- ..._delete_dashboard_list_items_2656706656.rs | 6 +- ..._delete_dashboard_list_items_3851624753.rs | 6 +- ...ashboard-lists_get_dashboard_list_items.rs | 6 +- ...board-lists_update_dashboard_list_items.rs | 6 +- .../v2_dora-metrics_create_dora_deployment.rs | 6 +- .../v2_dora-metrics_create_dora_incident.rs | 6 +- examples/v2_downtimes_cancel_downtime.rs | 6 +- examples/v2_downtimes_create_downtime.rs | 6 +- examples/v2_downtimes_get_downtime.rs | 8 +- examples/v2_downtimes_list_downtimes.rs | 8 +- .../v2_downtimes_list_downtimes_805770330.rs | 8 +- .../v2_downtimes_list_monitor_downtimes.rs | 8 +- ...times_list_monitor_downtimes_3316718253.rs | 8 +- examples/v2_downtimes_update_downtime.rs | 6 +- examples/v2_events_list_events.rs | 8 +- examples/v2_events_list_events_1527584014.rs | 8 +- examples/v2_events_list_events_2663715109.rs | 8 +- examples/v2_events_search_events.rs | 8 +- .../v2_events_search_events_3856995058.rs | 8 +- ...astly-integration_create_fastly_account.rs | 6 +- ...astly-integration_create_fastly_service.rs | 6 +- ...astly-integration_delete_fastly_account.rs | 6 +- ...astly-integration_delete_fastly_service.rs | 6 +- ...2_fastly-integration_get_fastly_account.rs | 6 +- ...2_fastly-integration_get_fastly_service.rs | 6 +- ...fastly-integration_list_fastly_accounts.rs | 6 +- ...fastly-integration_list_fastly_services.rs | 6 +- ...astly-integration_update_fastly_account.rs | 6 +- ...astly-integration_update_fastly_service.rs | 6 +- ...2_gcp-integration_create_gcpsts_account.rs | 6 +- ...gration_create_gcpsts_account_109518525.rs | 6 +- ...gration_create_gcpsts_account_130557025.rs | 6 +- ...gration_create_gcpsts_account_194782945.rs | 6 +- ...ration_create_gcpsts_account_2597004741.rs | 6 +- ...ration_create_gcpsts_account_4235664992.rs | 6 +- ...2_gcp-integration_delete_gcpsts_account.rs | 6 +- .../v2_gcp-integration_get_gcpsts_delegate.rs | 6 +- ...v2_gcp-integration_list_gcpsts_accounts.rs | 6 +- ...v2_gcp-integration_make_gcpsts_delegate.rs | 8 +- ...egration_make_gcpsts_delegate_962598975.rs | 8 +- ...2_gcp-integration_update_gcpsts_account.rs | 6 +- ...ration_update_gcpsts_account_2241994060.rs | 6 +- ...ration_update_gcpsts_account_3205636354.rs | 6 +- ...cident-services_create_incident_service.rs | 6 +- ...cident-services_delete_incident_service.rs | 6 +- ..._incident-services_get_incident_service.rs | 8 +- ...ncident-services_list_incident_services.rs | 8 +- ...cident-services_update_incident_service.rs | 6 +- .../v2_incident-teams_create_incident_team.rs | 6 +- .../v2_incident-teams_delete_incident_team.rs | 6 +- .../v2_incident-teams_get_incident_team.rs | 8 +- .../v2_incident-teams_list_incident_teams.rs | 8 +- .../v2_incident-teams_update_incident_team.rs | 6 +- examples/v2_incidents_create_incident.rs | 6 +- ...2_incidents_create_incident_integration.rs | 6 +- examples/v2_incidents_create_incident_todo.rs | 6 +- examples/v2_incidents_delete_incident.rs | 6 +- ...2_incidents_delete_incident_integration.rs | 6 +- examples/v2_incidents_delete_incident_todo.rs | 6 +- examples/v2_incidents_get_incident.rs | 8 +- .../v2_incidents_get_incident_integration.rs | 6 +- examples/v2_incidents_get_incident_todo.rs | 6 +- .../v2_incidents_list_incident_attachments.rs | 8 +- ...ts_list_incident_attachments_2457735435.rs | 8 +- ...v2_incidents_list_incident_integrations.rs | 6 +- examples/v2_incidents_list_incident_todos.rs | 6 +- examples/v2_incidents_list_incidents.rs | 8 +- .../v2_incidents_list_incidents_2665616954.rs | 8 +- examples/v2_incidents_search_incidents.rs | 8 +- ...2_incidents_search_incidents_1931679109.rs | 8 +- examples/v2_incidents_update_incident.rs | 8 +- ...v2_incidents_update_incident_1009194038.rs | 8 +- ...v2_incidents_update_incident_3369341440.rs | 8 +- ...2_incidents_update_incident_attachments.rs | 8 +- ..._update_incident_attachments_3881702075.rs | 8 +- ...2_incidents_update_incident_integration.rs | 6 +- examples/v2_incidents_update_incident_todo.rs | 6 +- examples/v2_ip-allowlist_get_ip_allowlist.rs | 6 +- .../v2_ip-allowlist_update_ip_allowlist.rs | 6 +- examples/v2_key-management_create_api_key.rs | 6 +- ...ent_create_current_user_application_key.rs | 6 +- ...current_user_application_key_3383369233.rs | 6 +- examples/v2_key-management_delete_api_key.rs | 6 +- ...2_key-management_delete_application_key.rs | 6 +- ...ent_delete_current_user_application_key.rs | 6 +- examples/v2_key-management_get_api_key.rs | 8 +- .../v2_key-management_get_application_key.rs | 8 +- ...gement_get_current_user_application_key.rs | 6 +- examples/v2_key-management_list_api_keys.rs | 8 +- ...v2_key-management_list_application_keys.rs | 8 +- ...ment_list_current_user_application_keys.rs | 8 +- examples/v2_key-management_update_api_key.rs | 6 +- ...2_key-management_update_application_key.rs | 6 +- ...ent_update_current_user_application_key.rs | 6 +- ..._logs-archives_add_read_role_to_archive.rs | 6 +- .../v2_logs-archives_create_logs_archive.rs | 6 +- .../v2_logs-archives_delete_logs_archive.rs | 6 +- examples/v2_logs-archives_get_logs_archive.rs | 6 +- ...v2_logs-archives_get_logs_archive_order.rs | 6 +- ...2_logs-archives_list_archive_read_roles.rs | 6 +- .../v2_logs-archives_list_logs_archives.rs | 6 +- ..._logs-archives_remove_role_from_archive.rs | 6 +- .../v2_logs-archives_update_logs_archive.rs | 6 +- ...logs-archives_update_logs_archive_order.rs | 6 +- ...inations_create_logs_custom_destination.rs | 6 +- ...eate_logs_custom_destination_1091442807.rs | 6 +- ...eate_logs_custom_destination_1288180912.rs | 6 +- ...reate_logs_custom_destination_141236188.rs | 6 +- ...eate_logs_custom_destination_2184123765.rs | 6 +- ...inations_delete_logs_custom_destination.rs | 6 +- ...estinations_get_logs_custom_destination.rs | 6 +- ...tinations_list_logs_custom_destinations.rs | 6 +- ...inations_update_logs_custom_destination.rs | 6 +- .../v2_logs-metrics_create_logs_metric.rs | 6 +- .../v2_logs-metrics_delete_logs_metric.rs | 6 +- examples/v2_logs-metrics_get_logs_metric.rs | 6 +- examples/v2_logs-metrics_list_logs_metrics.rs | 6 +- .../v2_logs-metrics_update_logs_metric.rs | 6 +- ...s-metrics_update_logs_metric_1901534424.rs | 6 +- examples/v2_logs_aggregate_logs.rs | 6 +- examples/v2_logs_aggregate_logs_2527007002.rs | 6 +- examples/v2_logs_aggregate_logs_2955613758.rs | 6 +- examples/v2_logs_list_logs.rs | 8 +- examples/v2_logs_list_logs_3138392594.rs | 8 +- examples/v2_logs_list_logs_get.rs | 8 +- examples/v2_logs_list_logs_get_2034110533.rs | 8 +- examples/v2_logs_list_logs_get_738202670.rs | 8 +- examples/v2_logs_submit_log.rs | 8 +- examples/v2_logs_submit_log_3496222707.rs | 8 +- examples/v2_logs_submit_log_904601870.rs | 8 +- ..._create_bulk_tags_metrics_configuration.rs | 6 +- .../v2_metrics_create_tag_configuration.rs | 6 +- ..._delete_bulk_tags_metrics_configuration.rs | 6 +- .../v2_metrics_delete_tag_configuration.rs | 6 +- ..._metrics_estimate_metrics_output_series.rs | 8 +- ...trics_list_active_metric_configurations.rs | 8 +- examples/v2_metrics_list_metric_assets.rs | 6 +- ..._metrics_list_tag_configuration_by_name.rs | 6 +- .../v2_metrics_list_tag_configurations.rs | 8 +- ...trics_list_tag_configurations_265033704.rs | 8 +- ...rics_list_tag_configurations_2739018321.rs | 8 +- .../v2_metrics_list_tags_by_metric_name.rs | 6 +- .../v2_metrics_list_volumes_by_metric_name.rs | 6 +- examples/v2_metrics_query_scalar_data.rs | 6 +- ...v2_metrics_query_scalar_data_3112571352.rs | 6 +- examples/v2_metrics_query_timeseries_data.rs | 6 +- ...metrics_query_timeseries_data_301142940.rs | 6 +- examples/v2_metrics_submit_metrics.rs | 8 +- .../v2_metrics_submit_metrics_1762007427.rs | 8 +- .../v2_metrics_update_tag_configuration.rs | 6 +- ...2_monitors_create_monitor_config_policy.rs | 6 +- ...2_monitors_delete_monitor_config_policy.rs | 6 +- .../v2_monitors_get_monitor_config_policy.rs | 6 +- ...2_monitors_list_monitor_config_policies.rs | 6 +- ...2_monitors_update_monitor_config_policy.rs | 6 +- ...v2_okta-integration_create_okta_account.rs | 6 +- ...v2_okta-integration_delete_okta_account.rs | 6 +- .../v2_okta-integration_get_okta_account.rs | 6 +- .../v2_okta-integration_list_okta_accounts.rs | 6 +- ...v2_okta-integration_update_okta_account.rs | 6 +- ...nie-integration_create_opsgenie_service.rs | 6 +- ...nie-integration_delete_opsgenie_service.rs | 6 +- ...sgenie-integration_get_opsgenie_service.rs | 6 +- ...enie-integration_list_opsgenie_services.rs | 6 +- ...nie-integration_update_opsgenie_service.rs | 6 +- .../v2_organizations_upload_idp_metadata.rs | 8 +- examples/v2_powerpack_create_powerpack.rs | 6 +- examples/v2_powerpack_delete_powerpack.rs | 6 +- examples/v2_powerpack_get_powerpack.rs | 6 +- examples/v2_powerpack_list_powerpacks.rs | 8 +- ...v2_powerpack_list_powerpacks_1173755071.rs | 8 +- examples/v2_powerpack_update_powerpack.rs | 6 +- examples/v2_processes_list_processes.rs | 8 +- .../v2_processes_list_processes_797840471.rs | 8 +- ...tion-policies_delete_restriction_policy.rs | 6 +- ...riction-policies_get_restriction_policy.rs | 6 +- ...tion-policies_update_restriction_policy.rs | 6 +- examples/v2_roles_add_permission_to_role.rs | 6 +- examples/v2_roles_add_user_to_role.rs | 6 +- examples/v2_roles_clone_role.rs | 6 +- examples/v2_roles_create_role.rs | 6 +- examples/v2_roles_delete_role.rs | 6 +- examples/v2_roles_get_role.rs | 6 +- examples/v2_roles_list_permissions.rs | 6 +- examples/v2_roles_list_role_permissions.rs | 6 +- examples/v2_roles_list_role_users.rs | 8 +- examples/v2_roles_list_roles.rs | 8 +- .../v2_roles_remove_permission_from_role.rs | 6 +- examples/v2_roles_remove_user_from_role.rs | 6 +- examples/v2_roles_update_role.rs | 6 +- examples/v2_rum_aggregate_rum_events.rs | 6 +- examples/v2_rum_create_rum_application.rs | 6 +- examples/v2_rum_delete_rum_application.rs | 6 +- examples/v2_rum_get_rum_application.rs | 6 +- examples/v2_rum_get_rum_applications.rs | 6 +- examples/v2_rum_list_rum_events.rs | 8 +- examples/v2_rum_list_rum_events_2680821282.rs | 8 +- examples/v2_rum_search_rum_events.rs | 6 +- .../v2_rum_search_rum_events_574690310.rs | 6 +- examples/v2_rum_update_rum_application.rs | 6 +- ...urity-monitoring_create_security_filter.rs | 6 +- ...itoring_create_security_monitoring_rule.rs | 6 +- ...ate_security_monitoring_rule_1092490364.rs | 6 +- ...ate_security_monitoring_rule_3367706049.rs | 6 +- ...eate_security_monitoring_rule_461183901.rs | 6 +- ...eate_security_monitoring_rule_498211763.rs | 6 +- ...eate_security_monitoring_rule_914562040.rs | 6 +- ..._create_security_monitoring_suppression.rs | 6 +- ...urity-monitoring_delete_security_filter.rs | 6 +- ...toring_delete_security_filter_555029489.rs | 6 +- ...itoring_delete_security_monitoring_rule.rs | 6 +- ..._delete_security_monitoring_suppression.rs | 6 +- ...dit_security_monitoring_signal_assignee.rs | 6 +- ...it_security_monitoring_signal_incidents.rs | 6 +- ...g_edit_security_monitoring_signal_state.rs | 6 +- .../v2_security-monitoring_get_finding.rs | 8 +- ...security-monitoring_get_security_filter.rs | 6 +- ...monitoring_get_security_monitoring_rule.rs | 6 +- ...get_security_monitoring_rule_3370522281.rs | 6 +- ...nitoring_get_security_monitoring_signal.rs | 6 +- ...ing_get_security_monitoring_suppression.rs | 6 +- .../v2_security-monitoring_list_findings.rs | 8 +- ...ity-monitoring_list_findings_3865842421.rs | 8 +- ...curity-monitoring_list_security_filters.rs | 6 +- ...nitoring_list_security_monitoring_rules.rs | 8 +- ...toring_list_security_monitoring_signals.rs | 8 +- ..._security_monitoring_signals_3960412991.rs | 8 +- ...g_list_security_monitoring_suppressions.rs | 6 +- .../v2_security-monitoring_mute_findings.rs | 6 +- ...ring_search_security_monitoring_signals.rs | 8 +- ..._security_monitoring_signals_1309350146.rs | 8 +- ...urity-monitoring_update_security_filter.rs | 6 +- ...itoring_update_security_monitoring_rule.rs | 6 +- ...date_security_monitoring_rule_428087276.rs | 6 +- ..._update_security_monitoring_suppression.rs | 6 +- ...oring_validate_security_monitoring_rule.rs | 6 +- ...tive-data-scanner_create_scanning_group.rs | 6 +- ...itive-data-scanner_create_scanning_rule.rs | 6 +- ...tive-data-scanner_delete_scanning_group.rs | 6 +- ...itive-data-scanner_delete_scanning_rule.rs | 6 +- ...itive-data-scanner_list_scanning_groups.rs | 6 +- ...ive-data-scanner_list_standard_patterns.rs | 6 +- ...ve-data-scanner_reorder_scanning_groups.rs | 6 +- ...tive-data-scanner_update_scanning_group.rs | 6 +- ...itive-data-scanner_update_scanning_rule.rs | 6 +- ...service-accounts_create_service_account.rs | 6 +- ..._create_service_account_application_key.rs | 6 +- ...vice_account_application_key_3480494373.rs | 6 +- ..._delete_service_account_application_key.rs | 6 +- ...nts_get_service_account_application_key.rs | 6 +- ...s_list_service_account_application_keys.rs | 8 +- ..._update_service_account_application_key.rs | 6 +- ...on_create_or_update_service_definitions.rs | 6 +- ...r_update_service_definitions_1808735248.rs | 6 +- ...r_update_service_definitions_2619874414.rs | 6 +- ...r_update_service_definitions_2621709423.rs | 6 +- ...ce-definition_delete_service_definition.rs | 6 +- ...rvice-definition_get_service_definition.rs | 8 +- ...ice-definition_list_service_definitions.rs | 8 +- ...tion_list_service_definitions_336468013.rs | 8 +- ...recards_create_scorecard_outcomes_batch.rs | 6 +- ...ervice-scorecards_create_scorecard_rule.rs | 6 +- ...ervice-scorecards_delete_scorecard_rule.rs | 6 +- ...vice-scorecards_list_scorecard_outcomes.rs | 8 +- ...ards_list_scorecard_outcomes_2663454275.rs | 8 +- ...service-scorecards_list_scorecard_rules.rs | 8 +- ...recards_list_scorecard_rules_4057666343.rs | 8 +- .../v2_spans-metrics_create_spans_metric.rs | 6 +- .../v2_spans-metrics_delete_spans_metric.rs | 6 +- examples/v2_spans-metrics_get_spans_metric.rs | 6 +- .../v2_spans-metrics_list_spans_metrics.rs | 6 +- .../v2_spans-metrics_update_spans_metric.rs | 6 +- examples/v2_spans_aggregate_spans.rs | 6 +- examples/v2_spans_list_spans.rs | 6 +- examples/v2_spans_list_spans_3495563906.rs | 6 +- examples/v2_spans_list_spans_get.rs | 8 +- .../v2_spans_list_spans_get_1130763422.rs | 8 +- ...ynthetics_get_on_demand_concurrency_cap.rs | 6 +- ...ynthetics_set_on_demand_concurrency_cap.rs | 6 +- examples/v2_teams_create_team.rs | 6 +- examples/v2_teams_create_team_252121814.rs | 6 +- examples/v2_teams_create_team_link.rs | 6 +- examples/v2_teams_create_team_membership.rs | 6 +- examples/v2_teams_delete_team.rs | 6 +- examples/v2_teams_delete_team_link.rs | 6 +- examples/v2_teams_delete_team_membership.rs | 6 +- examples/v2_teams_get_team.rs | 6 +- examples/v2_teams_get_team_link.rs | 6 +- examples/v2_teams_get_team_links.rs | 6 +- examples/v2_teams_get_team_memberships.rs | 8 +- ...2_teams_get_team_memberships_3799131168.rs | 8 +- .../v2_teams_get_team_permission_settings.rs | 6 +- examples/v2_teams_get_user_memberships.rs | 6 +- examples/v2_teams_list_teams.rs | 8 +- examples/v2_teams_list_teams_3429963470.rs | 8 +- examples/v2_teams_list_teams_3592098458.rs | 8 +- examples/v2_teams_update_team.rs | 6 +- examples/v2_teams_update_team_link.rs | 6 +- examples/v2_teams_update_team_membership.rs | 6 +- ...v2_teams_update_team_permission_setting.rs | 6 +- ...-metering_get_active_billing_dimensions.rs | 6 +- examples/v2_usage-metering_get_cost_by_org.rs | 8 +- ...sage-metering_get_estimated_cost_by_org.rs | 8 +- ...ng_get_estimated_cost_by_org_3186693804.rs | 8 +- ...age-metering_get_historical_cost_by_org.rs | 8 +- .../v2_usage-metering_get_hourly_usage.rs | 8 +- ...e-metering_get_monthly_cost_attribution.rs | 8 +- .../v2_usage-metering_get_projected_cost.rs | 8 +- ...t_usage_application_security_monitoring.rs | 8 +- ...ing_get_usage_lambda_traced_invocations.rs | 8 +- ...ering_get_usage_observability_pipelines.rs | 8 +- examples/v2_users_create_user.rs | 6 +- examples/v2_users_disable_user.rs | 6 +- examples/v2_users_get_invitation.rs | 6 +- examples/v2_users_get_user.rs | 6 +- examples/v2_users_list_user_organizations.rs | 6 +- examples/v2_users_list_user_permissions.rs | 6 +- examples/v2_users_list_users.rs | 8 +- examples/v2_users_list_users_4075885358.rs | 8 +- examples/v2_users_send_invitations.rs | 6 +- examples/v2_users_update_user.rs | 6 +- src/datadog/mod.rs | 38 +- src/datadogV1/api/api_authentication.rs | 33 +- src/datadogV1/api/api_aws_integration.rs | 321 +++---- src/datadogV1/api/api_aws_logs_integration.rs | 193 ++-- src/datadogV1/api/api_azure_integration.rs | 134 +-- src/datadogV1/api/api_dashboard_lists.rs | 129 +-- src/datadogV1/api/api_dashboards.rs | 342 ++++---- src/datadogV1/api/api_downtimes.rs | 167 ++-- src/datadogV1/api/api_events.rs | 77 +- src/datadogV1/api/api_gcp_integration.rs | 108 +-- src/datadogV1/api/api_hosts.rs | 103 ++- src/datadogV1/api/api_ip_ranges.rs | 30 +- src/datadogV1/api/api_key_management.rs | 265 +++--- src/datadogV1/api/api_logs.rs | 66 +- src/datadogV1/api/api_logs_indexes.rs | 155 ++-- src/datadogV1/api/api_logs_pipelines.rs | 173 ++-- src/datadogV1/api/api_metrics.rs | 175 ++-- src/datadogV1/api/api_monitors.rs | 244 +++--- src/datadogV1/api/api_notebooks.rs | 121 +-- src/datadogV1/api/api_organizations.rs | 155 ++-- .../api/api_pager_duty_integration.rs | 95 +- src/datadogV1/api/api_security_monitoring.rs | 95 +- src/datadogV1/api/api_service_checks.rs | 41 +- ...api_service_level_objective_corrections.rs | 135 +-- .../api/api_service_level_objectives.rs | 254 +++--- src/datadogV1/api/api_slack_integration.rs | 128 +-- src/datadogV1/api/api_snapshots.rs | 31 +- src/datadogV1/api/api_synthetics.rs | 731 +++++++-------- src/datadogV1/api/api_tags.rs | 126 +-- src/datadogV1/api/api_usage_metering.rs | 749 ++++++++-------- src/datadogV1/api/api_users.rs | 131 +-- src/datadogV1/api/api_webhooks_integration.rs | 208 +++-- src/datadogV1/mod.rs | 31 + src/datadogV2/api/api_api_management.rs | 103 ++- .../api/api_apm_retention_filters.rs | 141 +-- src/datadogV2/api/api_audit.rs | 69 +- src/datadogV2/api/api_authn_mappings.rs | 127 +-- src/datadogV2/api/api_case_management.rs | 346 ++++---- .../api/api_ci_visibility_pipelines.rs | 111 ++- src/datadogV2/api/api_ci_visibility_tests.rs | 99 ++- .../api/api_cloud_cost_management.rs | 239 ++--- .../api/api_cloud_workload_security.rs | 262 +++--- .../api/api_cloudflare_integration.rs | 121 +-- src/datadogV2/api/api_confluent_cloud.rs | 253 +++--- src/datadogV2/api/api_container_images.rs | 38 +- src/datadogV2/api/api_containers.rs | 35 +- src/datadogV2/api/api_dashboard_lists.rs | 111 +-- src/datadogV2/api/api_dora_metrics.rs | 78 +- src/datadogV2/api/api_downtimes.rs | 147 ++-- src/datadogV2/api/api_events.rs | 68 +- src/datadogV2/api/api_fastly_integration.rs | 259 +++--- src/datadogV2/api/api_gcp_integration.rs | 145 +-- src/datadogV2/api/api_incident_services.rs | 153 ++-- src/datadogV2/api/api_incident_teams.rs | 147 ++-- src/datadogV2/api/api_incidents.rs | 511 +++++------ src/datadogV2/api/api_ip_allowlist.rs | 57 +- src/datadogV2/api/api_key_management.rs | 327 +++---- src/datadogV2/api/api_logs.rs | 118 +-- src/datadogV2/api/api_logs_archives.rs | 238 ++--- .../api/api_logs_custom_destinations.rs | 118 +-- src/datadogV2/api/api_logs_metrics.rs | 121 +-- src/datadogV2/api/api_metrics.rs | 375 ++++---- src/datadogV2/api/api_monitors.rs | 117 ++- src/datadogV2/api/api_okta_integration.rs | 121 +-- src/datadogV2/api/api_opsgenie_integration.rs | 133 +-- src/datadogV2/api/api_organizations.rs | 23 +- src/datadogV2/api/api_powerpack.rs | 127 +-- src/datadogV2/api/api_processes.rs | 35 +- src/datadogV2/api/api_restriction_policies.rs | 77 +- src/datadogV2/api/api_roles.rs | 342 ++++---- src/datadogV2/api/api_rum.rs | 215 ++--- src/datadogV2/api/api_security_monitoring.rs | 613 ++++++------- .../api/api_sensitive_data_scanner.rs | 241 ++--- src/datadogV2/api/api_service_accounts.rs | 155 ++-- src/datadogV2/api/api_service_definition.rs | 91 +- src/datadogV2/api/api_service_scorecards.rs | 140 +-- src/datadogV2/api/api_spans.rs | 91 +- src/datadogV2/api/api_spans_metrics.rs | 121 +-- src/datadogV2/api/api_synthetics.rs | 55 +- src/datadogV2/api/api_teams.rs | 425 ++++----- src/datadogV2/api/api_usage_metering.rs | 212 ++--- src/datadogV2/api/api_users.rs | 224 ++--- src/datadogV2/mod.rs | 49 ++ tests/scenarios/fixtures.rs | 2 +- tests/scenarios/function_mappings.rs | 829 +++++++++--------- 864 files changed, 10496 insertions(+), 9808 deletions(-) diff --git a/.generator/src/generator/formatter.py b/.generator/src/generator/formatter.py index 6e758e8af..f16f12ec8 100644 --- a/.generator/src/generator/formatter.py +++ b/.generator/src/generator/formatter.py @@ -307,7 +307,7 @@ def format_parameters(data, spec, replace_values=None, has_body=False, **kwargs) if has_body and body_is_required: parameters += "body, " if has_optional or body_is_required is False: - imports.add(f"datadog_api_client::datadog{kwargs.get('version', '')}::api::api_{kwargs.get('api')}::{spec['operationId']}OptionalParams") + imports.add(f"datadog_api_client::datadog{kwargs.get('version', '')}::api_{kwargs.get('api')}::{spec['operationId']}OptionalParams") parameters += f"{spec['operationId']}OptionalParams::default()" if has_body and not body_is_required: parameters += ".body(body)" diff --git a/.generator/src/generator/templates/api.j2 b/.generator/src/generator/templates/api.j2 index 9badd068f..16c153316 100644 --- a/.generator/src/generator/templates/api.j2 +++ b/.generator/src/generator/templates/api.j2 @@ -1,7 +1,6 @@ {% include "partial_header.j2" %} -use reqwest; use serde::{Serialize, Deserialize}; -use crate::datadog::*; +use crate::datadog; use reqwest::header::{HeaderMap, HeaderValue}; {%- for _, _, operation in operations if "x-pagination" in operation %} {%- if loop.first %} @@ -84,13 +83,13 @@ pub enum {{operation.operationId}}Error { #[derive(Debug, Clone)] pub struct {{ structName }} { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for {{ structName }} { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -98,7 +97,7 @@ impl {{ structName }} { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -140,7 +139,7 @@ impl {{ structName }} { Self { config, client } } - pub fn with_client_and_config(config: configuration::Configuration, client: reqwest_middleware::ClientWithMiddleware) -> Self { + pub fn with_client_and_config(config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware) -> Self { Self {config, client} } @@ -152,14 +151,14 @@ impl {{ structName }} { {% if operation.description is defined %} {{ operation.description | block_comment }} {%- endif %} - pub async fn {{operation.operationId | snake_case}}(&self{% for name, parameter in requiredParams %}, {{name|variable_name}}: {{ get_type_for_parameter(parameter, version) }}{% endfor %}{% if operation|has_optional_parameter %}, params: {{operation.operationId}}OptionalParams{% endif %}) -> Result<{% if returnType %}{{returnType}}{% else %}(){% endif %}, Error<{{operation.operationId}}Error>> { + pub async fn {{operation.operationId | snake_case}}(&self{% for name, parameter in requiredParams %}, {{name|variable_name}}: {{ get_type_for_parameter(parameter, version) }}{% endfor %}{% if operation|has_optional_parameter %}, params: {{operation.operationId}}OptionalParams{% endif %}) -> Result<{% if returnType %}{{returnType}}{% else %}(){% endif %}, datadog::Error<{{operation.operationId}}Error>> { match self.{{operation.operationId | snake_case}}_with_http_info({% for name, parameter in requiredParams %}{{name|variable_name}}{% if loop.last %}{% if operation|has_optional_parameter %}, {% endif %}{% else %}, {% endif %}{% endfor %}{% if operation|has_optional_parameter %} params{% endif %}).await { {%- if returnType %} Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom("response content was None"))) + Err(datadog::Error::Serde(serde::de::Error::custom("response content was None"))) } }, {%- else%} @@ -178,7 +177,7 @@ impl {{ structName }} { pub fn {{operation.operationId | snake_case}}_with_pagination( &self{% for name, parameter in requiredParams %}, {% if limitParamParts[0] == name|variable_name %}mut {% endif %} {{name|variable_name}}: {{ get_type_for_parameter(parameter, version) }}{% endfor %}{% if operation|has_optional_parameter %}, mut params: {{operation.operationId}}OptionalParams{% endif %} - ) -> impl Stream>> + '_ + ) -> impl Stream>> + '_ { try_stream! { {#- Limit param part fields #} @@ -280,17 +279,17 @@ impl {{ structName }} { {% if operation.description is defined %} {{ operation.description | block_comment }} {%- endif %} - pub async fn {{operation.operationId | snake_case}}_with_http_info(&self{% for name, parameter in requiredParams %}, {{name|variable_name}}: {{ get_type_for_parameter(parameter, version) }}{% endfor %}{% if operation|has_optional_parameter %}, params: {{operation.operationId}}OptionalParams{% endif %}) -> Result, Error<{{operation.operationId}}Error>> { + pub async fn {{operation.operationId | snake_case}}_with_http_info(&self{% for name, parameter in requiredParams %}, {{name|variable_name}}: {{ get_type_for_parameter(parameter, version) }}{% endfor %}{% if operation|has_optional_parameter %}, params: {{operation.operationId}}OptionalParams{% endif %}) -> Result, datadog::Error<{{operation.operationId}}Error>> { let local_configuration = &self.config; let operation_id = "{{ version }}.{{ operation.operationId | snake_case }}"; {%- if "x-unstable" in operation %} if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation '{{ version }}.{{ operation.operationId | snake_case }}' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } {%- endif %} @@ -308,7 +307,7 @@ impl {{ structName }} { local_configuration.get_operation_host(operation_id) {%- for name, parameter in operation|parameters if parameter.in == "path" %}, {{ name|variable_name }}= {%- if parameter.schema.type == "string" %} - urlencode({{ name|variable_name }}{% if not parameter.required %}.unwrap(){% elif parameter.schema.nullable %}.unwrap(){% endif %}{% if parameter.schema.type == "array" %}.join(",").as_ref(){% endif %}) + datadog::urlencode({{ name|variable_name }}{% if not parameter.required %}.unwrap(){% elif parameter.schema.nullable %}.unwrap(){% endif %}{% if parameter.schema.type == "array" %}.join(",").as_ref(){% endif %}) {%- else %} {{ name|variable_name }}{% if not parameter.required %}.unwrap(){% elif parameter.schema.nullable %}.unwrap(){% endif %}{% if parameter.schema.type == "array" %}.join(",").as_ref(){% endif %} {%- endif %} @@ -372,7 +371,7 @@ impl {{ structName }} { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -442,7 +441,7 @@ impl {{ structName }} { {%- if operation.requestBody is defined and not formParameter %} // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if {{operation.get("x-codegen-request-body-name", "body")|variable_name}}.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -456,7 +455,7 @@ impl {{ structName }} { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -469,7 +468,7 @@ impl {{ structName }} { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -479,7 +478,7 @@ impl {{ structName }} { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -501,22 +500,22 @@ impl {{ structName }} { if !local_status.is_client_error() && !local_status.is_server_error() { {%- if returnType == "Vec" %} - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content.clone(), entity: Some(local_content.into_bytes()), }) {%- elif returnType %} match serde_json::from_str::<{{ returnType }}>(&local_content) { - Ok(e) => return Ok(ResponseContent { + Ok(e) => return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }), - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; {%- else %} - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -524,8 +523,8 @@ impl {{ structName }} { {%- endif %} } else { let local_entity: Option<{{operation.operationId}}Error> = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { status: local_status, content: local_content, entity: local_entity }; - Err(Error::ResponseError(local_error)) + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity }; + Err(datadog::Error::ResponseError(local_error)) } } {%- endfor %} diff --git a/.generator/src/generator/templates/common_mod.j2 b/.generator/src/generator/templates/common_mod.j2 index f6252df87..93708214f 100644 --- a/.generator/src/generator/templates/common_mod.j2 +++ b/.generator/src/generator/templates/common_mod.j2 @@ -2,6 +2,9 @@ use std::error; use std::fmt; use serde::{Deserialize, Deserializer, Serialize, Serializer}; +mod configuration; +pub use configuration::{Configuration, APIKey, DEFAULT_USER_AGENT}; + #[derive(Debug, Clone)] pub struct ResponseContent { pub status: reqwest::StatusCode, @@ -75,38 +78,11 @@ impl From for Error { } } -pub fn urlencode>(s: T) -> String { +pub(crate) fn urlencode>(s: T) -> String { ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() } -pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - }, - serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - return params; - } - unimplemented!("Only objects are supported with style=deepObject") -} - -pub struct DDFormatter; +pub(crate) struct DDFormatter; impl serde_json::ser::Formatter for DDFormatter { fn write_f64(&mut self, writer: &mut W, value: f64) -> std::io::Result<()> @@ -117,8 +93,6 @@ impl serde_json::ser::Formatter for DDFormatter { } } -pub mod configuration; - #[derive(Clone, Debug, Eq, PartialEq)] pub struct UnparsedObject { pub value: serde_json::Value, diff --git a/.generator/src/generator/templates/example.j2 b/.generator/src/generator/templates/example.j2 index a6c77bba2..0eb417190 100644 --- a/.generator/src/generator/templates/example.j2 +++ b/.generator/src/generator/templates/example.j2 @@ -5,8 +5,8 @@ {%- if context.body %} {%- set body, imports = format_data_with_schema(context.body.value, context.api_request.schema.spec, replace_values=context._replace_values, required=True, variables=variables, version=version|upper, imports=imports)%} {%- endif %} -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadog{{ version|upper }}::api::api_{{context["api_instance"]["name"] | snake_case}}::{{context["api_instance"]["name"]}}API; +use datadog_api_client::datadog; +use datadog_api_client::datadog{{ version|upper }}::api_{{context["api_instance"]["name"] | snake_case}}::{{context["api_instance"]["name"]}}API; {%- for name in imports %} use {{name}}; {%- endfor %} @@ -37,7 +37,7 @@ async fn main() { let body = {{ body }}; {%- endif %} - let {% if context._enable_operations %}mut{% endif %} configuration = Configuration::new(); + let {% if context._enable_operations %}mut{% endif %} configuration = datadog::Configuration::new(); {%- for operation in context._enable_operations %} configuration.set_unstable_operation_enabled("{{ version }}.{{ operation }}", true); diff --git a/.generator/src/generator/templates/function_mappings.j2 b/.generator/src/generator/templates/function_mappings.j2 index 622fa651f..e0175c96d 100644 --- a/.generator/src/generator/templates/function_mappings.j2 +++ b/.generator/src/generator/templates/function_mappings.j2 @@ -16,7 +16,7 @@ pub struct ApiInstances { {%- for name, operations in apis.items() %} {%- set fieldName = "api_"+name %} {%- set structName = name.replace(" ", "")+"API" %} - pub {{version}}_{{fieldName | snake_case}}: Option, + pub {{version}}_{{fieldName | snake_case}}: Option, {%- endfor %} {%- endfor %} } @@ -28,7 +28,7 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { {%- set structName = name.replace(" ", "")+"API" %} "{{name.replace(" ", "")}}" => { {%- for version in versions %} - world.api_instances.{{version}}_{{fieldName}} = Some(datadog{{ version.upper() }}::api::{{fieldName}}::{{structName}}::with_client_and_config( + world.api_instances.{{version}}_{{fieldName}} = Some(datadog{{ version.upper() }}::{{fieldName}}::{{structName}}::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone() )); @@ -81,7 +81,7 @@ fn test_{{version}}_{{ operation['operationId'] | snake_case }}(world: &mut Data {%- for parameter in optionalParams %} {%- if loop.first %} - let mut params = datadog{{ version.upper() }}::api::{{ apiName }}::{{ operation['operationId'] }}OptionalParams::default(); + let mut params = datadog{{ version.upper() }}::{{ apiName }}::{{ operation['operationId'] }}OptionalParams::default(); {%- endif %} params.{{ parameter[0] | variable_name }} = {{ parameter[0] | variable_name }}; {%- if loop.last %} @@ -130,7 +130,7 @@ fn test_{{version}}_{{ operation['operationId'] | snake_case }}_with_pagination( {%- for parameter in optionalParams %} {%- if loop.first %} - let mut params = datadog{{ version.upper() }}::api::{{ apiName }}::{{ operation['operationId'] }}OptionalParams::default(); + let mut params = datadog{{ version.upper() }}::{{ apiName }}::{{ operation['operationId'] }}OptionalParams::default(); {%- endif %} params.{{ parameter[0] | variable_name }} = {{ parameter[0] | variable_name }}; {%- if loop.last %} diff --git a/.generator/src/generator/templates/mod.j2 b/.generator/src/generator/templates/mod.j2 index 954910577..9209306c2 100644 --- a/.generator/src/generator/templates/mod.j2 +++ b/.generator/src/generator/templates/mod.j2 @@ -1,4 +1,8 @@ {% include "partial_header.j2" %} pub mod api; +{%- for name, operations in apis.items() %} +{%- set classname = "api_"+name%} +pub use self::api::{{classname | snake_case}}; +{%- endfor %} pub mod model; diff --git a/README.md b/README.md index 7bdbf4454..1d46639e8 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,8 @@ datadog-api-client = "0" Please follow the [installation](#installation) instructions and try the following snippet to validate your Datadog API key: ```rust -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_authentication::AuthenticationAPI; +use datadog_api_client::datadog::Configuration; +use datadog_api_client::datadogV1::api_authentication::AuthenticationAPI; #[tokio::main] async fn main() { diff --git a/examples/v1_authentication_validate.rs b/examples/v1_authentication_validate.rs index 94457d41c..901f1143d 100644 --- a/examples/v1_authentication_validate.rs +++ b/examples/v1_authentication_validate.rs @@ -1,10 +1,10 @@ // Validate API key returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_authentication::AuthenticationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_authentication::AuthenticationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AuthenticationAPI::with_config(configuration); let resp = api.validate().await; if let Ok(value) = resp { diff --git a/examples/v1_aws-integration_create_aws_account.rs b/examples/v1_aws-integration_create_aws_account.rs index 07490f8eb..ccfd3a53c 100644 --- a/examples/v1_aws-integration_create_aws_account.rs +++ b/examples/v1_aws-integration_create_aws_account.rs @@ -1,6 +1,6 @@ // Create an AWS integration returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_aws_integration::AWSIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI; use datadog_api_client::datadogV1::model::AWSAccount; use std::collections::BTreeMap; @@ -16,7 +16,7 @@ async fn main() { .metrics_collection_enabled(false) .resource_collection_enabled(true) .role_name("DatadogAWSIntegrationRole".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AWSIntegrationAPI::with_config(configuration); let resp = api.create_aws_account(body).await; if let Ok(value) = resp { diff --git a/examples/v1_aws-integration_create_aws_event_bridge_source.rs b/examples/v1_aws-integration_create_aws_event_bridge_source.rs index d1319a254..891e2045a 100644 --- a/examples/v1_aws-integration_create_aws_event_bridge_source.rs +++ b/examples/v1_aws-integration_create_aws_event_bridge_source.rs @@ -1,6 +1,6 @@ // Create an Amazon EventBridge source returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_aws_integration::AWSIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI; use datadog_api_client::datadogV1::model::AWSEventBridgeCreateRequest; #[tokio::main] @@ -10,7 +10,7 @@ async fn main() { .create_event_bus(true) .event_generator_name("app-alerts".to_string()) .region("us-east-1".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AWSIntegrationAPI::with_config(configuration); let resp = api.create_aws_event_bridge_source(body).await; if let Ok(value) = resp { diff --git a/examples/v1_aws-integration_create_aws_tag_filter.rs b/examples/v1_aws-integration_create_aws_tag_filter.rs index c2b5b06d5..f425f8a4c 100644 --- a/examples/v1_aws-integration_create_aws_tag_filter.rs +++ b/examples/v1_aws-integration_create_aws_tag_filter.rs @@ -1,6 +1,6 @@ // Set an AWS tag filter returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_aws_integration::AWSIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI; use datadog_api_client::datadogV1::model::AWSNamespace; use datadog_api_client::datadogV1::model::AWSTagFilterCreateRequest; @@ -10,7 +10,7 @@ async fn main() { .account_id("123456789012".to_string()) .namespace(AWSNamespace::ELB) .tag_filter_str("prod*".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AWSIntegrationAPI::with_config(configuration); let resp = api.create_aws_tag_filter(body).await; if let Ok(value) = resp { diff --git a/examples/v1_aws-integration_create_new_aws_external_id.rs b/examples/v1_aws-integration_create_new_aws_external_id.rs index faf031fe9..76c51141d 100644 --- a/examples/v1_aws-integration_create_new_aws_external_id.rs +++ b/examples/v1_aws-integration_create_new_aws_external_id.rs @@ -1,6 +1,6 @@ // Generate a new external ID returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_aws_integration::AWSIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI; use datadog_api_client::datadogV1::model::AWSAccount; use std::collections::BTreeMap; @@ -19,7 +19,7 @@ async fn main() { .metrics_collection_enabled(false) .resource_collection_enabled(true) .role_name("DatadogAWSIntegrationRole".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AWSIntegrationAPI::with_config(configuration); let resp = api.create_new_aws_external_id(body).await; if let Ok(value) = resp { diff --git a/examples/v1_aws-integration_delete_aws_account.rs b/examples/v1_aws-integration_delete_aws_account.rs index d9f8224aa..45251ec83 100644 --- a/examples/v1_aws-integration_delete_aws_account.rs +++ b/examples/v1_aws-integration_delete_aws_account.rs @@ -1,6 +1,6 @@ // Delete an AWS integration returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_aws_integration::AWSIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI; use datadog_api_client::datadogV1::model::AWSAccountDeleteRequest; #[tokio::main] @@ -8,7 +8,7 @@ async fn main() { let body = AWSAccountDeleteRequest::new() .account_id("163662907100".to_string()) .role_name("DatadogAWSIntegrationRole".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AWSIntegrationAPI::with_config(configuration); let resp = api.delete_aws_account(body).await; if let Ok(value) = resp { diff --git a/examples/v1_aws-integration_delete_aws_event_bridge_source.rs b/examples/v1_aws-integration_delete_aws_event_bridge_source.rs index 0023527f2..47f950c44 100644 --- a/examples/v1_aws-integration_delete_aws_event_bridge_source.rs +++ b/examples/v1_aws-integration_delete_aws_event_bridge_source.rs @@ -1,6 +1,6 @@ // Delete an Amazon EventBridge source returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_aws_integration::AWSIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI; use datadog_api_client::datadogV1::model::AWSEventBridgeDeleteRequest; #[tokio::main] @@ -9,7 +9,7 @@ async fn main() { .account_id("123456789012".to_string()) .event_generator_name("app-alerts-zyxw3210".to_string()) .region("us-east-1".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AWSIntegrationAPI::with_config(configuration); let resp = api.delete_aws_event_bridge_source(body).await; if let Ok(value) = resp { diff --git a/examples/v1_aws-integration_delete_aws_tag_filter.rs b/examples/v1_aws-integration_delete_aws_tag_filter.rs index 391caebb8..050e21194 100644 --- a/examples/v1_aws-integration_delete_aws_tag_filter.rs +++ b/examples/v1_aws-integration_delete_aws_tag_filter.rs @@ -1,6 +1,6 @@ // Delete a tag filtering entry returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_aws_integration::AWSIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI; use datadog_api_client::datadogV1::model::AWSNamespace; use datadog_api_client::datadogV1::model::AWSTagFilterDeleteRequest; @@ -9,7 +9,7 @@ async fn main() { let body = AWSTagFilterDeleteRequest::new() .account_id("FAKEAC0FAKEAC2FAKEAC".to_string()) .namespace(AWSNamespace::ELB); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AWSIntegrationAPI::with_config(configuration); let resp = api.delete_aws_tag_filter(body).await; if let Ok(value) = resp { diff --git a/examples/v1_aws-integration_list_available_aws_namespaces.rs b/examples/v1_aws-integration_list_available_aws_namespaces.rs index 6d3a3e9c6..9c2b13ebc 100644 --- a/examples/v1_aws-integration_list_available_aws_namespaces.rs +++ b/examples/v1_aws-integration_list_available_aws_namespaces.rs @@ -1,10 +1,10 @@ // List namespace rules returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_aws_integration::AWSIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AWSIntegrationAPI::with_config(configuration); let resp = api.list_available_aws_namespaces().await; if let Ok(value) = resp { diff --git a/examples/v1_aws-integration_list_aws_accounts.rs b/examples/v1_aws-integration_list_aws_accounts.rs index c34d057b4..5bc47aafc 100644 --- a/examples/v1_aws-integration_list_aws_accounts.rs +++ b/examples/v1_aws-integration_list_aws_accounts.rs @@ -1,11 +1,11 @@ // List all AWS integrations returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_aws_integration::AWSIntegrationAPI; -use datadog_api_client::datadogV1::api::api_aws_integration::ListAWSAccountsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI; +use datadog_api_client::datadogV1::api_aws_integration::ListAWSAccountsOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AWSIntegrationAPI::with_config(configuration); let resp = api .list_aws_accounts(ListAWSAccountsOptionalParams::default()) diff --git a/examples/v1_aws-integration_list_aws_event_bridge_sources.rs b/examples/v1_aws-integration_list_aws_event_bridge_sources.rs index a5ba2ec6c..5b74d4f0e 100644 --- a/examples/v1_aws-integration_list_aws_event_bridge_sources.rs +++ b/examples/v1_aws-integration_list_aws_event_bridge_sources.rs @@ -1,10 +1,10 @@ // Get all Amazon EventBridge sources returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_aws_integration::AWSIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AWSIntegrationAPI::with_config(configuration); let resp = api.list_aws_event_bridge_sources().await; if let Ok(value) = resp { diff --git a/examples/v1_aws-integration_list_aws_tag_filters.rs b/examples/v1_aws-integration_list_aws_tag_filters.rs index 6a5166ee0..906ff4e3a 100644 --- a/examples/v1_aws-integration_list_aws_tag_filters.rs +++ b/examples/v1_aws-integration_list_aws_tag_filters.rs @@ -1,10 +1,10 @@ // Get all AWS tag filters returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_aws_integration::AWSIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AWSIntegrationAPI::with_config(configuration); let resp = api.list_aws_tag_filters("account_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_aws-integration_update_aws_account.rs b/examples/v1_aws-integration_update_aws_account.rs index eba275ecc..4f00da6f6 100644 --- a/examples/v1_aws-integration_update_aws_account.rs +++ b/examples/v1_aws-integration_update_aws_account.rs @@ -1,7 +1,7 @@ // Update an AWS integration returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_aws_integration::AWSIntegrationAPI; -use datadog_api_client::datadogV1::api::api_aws_integration::UpdateAWSAccountOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI; +use datadog_api_client::datadogV1::api_aws_integration::UpdateAWSAccountOptionalParams; use datadog_api_client::datadogV1::model::AWSAccount; use std::collections::BTreeMap; @@ -17,7 +17,7 @@ async fn main() { .metrics_collection_enabled(true) .resource_collection_enabled(true) .role_name("DatadogAWSIntegrationRole".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AWSIntegrationAPI::with_config(configuration); let resp = api .update_aws_account( diff --git a/examples/v1_aws-logs-integration_check_aws_logs_lambda_async.rs b/examples/v1_aws-logs-integration_check_aws_logs_lambda_async.rs index fe04af9b2..3c4c68b4c 100644 --- a/examples/v1_aws-logs-integration_check_aws_logs_lambda_async.rs +++ b/examples/v1_aws-logs-integration_check_aws_logs_lambda_async.rs @@ -1,6 +1,6 @@ // Check that an AWS Lambda Function exists returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_aws_logs_integration::AWSLogsIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_aws_logs_integration::AWSLogsIntegrationAPI; use datadog_api_client::datadogV1::model::AWSAccountAndLambdaRequest; #[tokio::main] @@ -9,7 +9,7 @@ async fn main() { "1234567".to_string(), "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest".to_string(), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AWSLogsIntegrationAPI::with_config(configuration); let resp = api.check_aws_logs_lambda_async(body).await; if let Ok(value) = resp { diff --git a/examples/v1_aws-logs-integration_check_aws_logs_services_async.rs b/examples/v1_aws-logs-integration_check_aws_logs_services_async.rs index 0ca8ca52d..2e4d918df 100644 --- a/examples/v1_aws-logs-integration_check_aws_logs_services_async.rs +++ b/examples/v1_aws-logs-integration_check_aws_logs_services_async.rs @@ -1,6 +1,6 @@ // Check permissions for log services returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_aws_logs_integration::AWSLogsIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_aws_logs_integration::AWSLogsIntegrationAPI; use datadog_api_client::datadogV1::model::AWSLogsServicesRequest; #[tokio::main] @@ -16,7 +16,7 @@ async fn main() { "lambda".to_string(), ], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AWSLogsIntegrationAPI::with_config(configuration); let resp = api.check_aws_logs_services_async(body).await; if let Ok(value) = resp { diff --git a/examples/v1_aws-logs-integration_create_aws_lambda_arn.rs b/examples/v1_aws-logs-integration_create_aws_lambda_arn.rs index 2957ec913..95c16698f 100644 --- a/examples/v1_aws-logs-integration_create_aws_lambda_arn.rs +++ b/examples/v1_aws-logs-integration_create_aws_lambda_arn.rs @@ -1,6 +1,6 @@ // Add AWS Log Lambda ARN returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_aws_logs_integration::AWSLogsIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_aws_logs_integration::AWSLogsIntegrationAPI; use datadog_api_client::datadogV1::model::AWSAccountAndLambdaRequest; #[tokio::main] @@ -9,7 +9,7 @@ async fn main() { "1234567".to_string(), "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest".to_string(), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AWSLogsIntegrationAPI::with_config(configuration); let resp = api.create_aws_lambda_arn(body).await; if let Ok(value) = resp { diff --git a/examples/v1_aws-logs-integration_delete_aws_lambda_arn.rs b/examples/v1_aws-logs-integration_delete_aws_lambda_arn.rs index e02f73553..6be1b0f6e 100644 --- a/examples/v1_aws-logs-integration_delete_aws_lambda_arn.rs +++ b/examples/v1_aws-logs-integration_delete_aws_lambda_arn.rs @@ -1,6 +1,6 @@ // Delete an AWS Logs integration returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_aws_logs_integration::AWSLogsIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_aws_logs_integration::AWSLogsIntegrationAPI; use datadog_api_client::datadogV1::model::AWSAccountAndLambdaRequest; #[tokio::main] @@ -9,7 +9,7 @@ async fn main() { "1234567".to_string(), "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest".to_string(), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AWSLogsIntegrationAPI::with_config(configuration); let resp = api.delete_aws_lambda_arn(body).await; if let Ok(value) = resp { diff --git a/examples/v1_aws-logs-integration_enable_aws_log_services.rs b/examples/v1_aws-logs-integration_enable_aws_log_services.rs index f63f7a24e..e52fbb99d 100644 --- a/examples/v1_aws-logs-integration_enable_aws_log_services.rs +++ b/examples/v1_aws-logs-integration_enable_aws_log_services.rs @@ -1,6 +1,6 @@ // Enable an AWS Logs integration returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_aws_logs_integration::AWSLogsIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_aws_logs_integration::AWSLogsIntegrationAPI; use datadog_api_client::datadogV1::model::AWSLogsServicesRequest; #[tokio::main] @@ -16,7 +16,7 @@ async fn main() { "lambda".to_string(), ], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AWSLogsIntegrationAPI::with_config(configuration); let resp = api.enable_aws_log_services(body).await; if let Ok(value) = resp { diff --git a/examples/v1_aws-logs-integration_list_aws_logs_integrations.rs b/examples/v1_aws-logs-integration_list_aws_logs_integrations.rs index 61b0084be..2d477b55b 100644 --- a/examples/v1_aws-logs-integration_list_aws_logs_integrations.rs +++ b/examples/v1_aws-logs-integration_list_aws_logs_integrations.rs @@ -1,10 +1,10 @@ // List all AWS Logs integrations returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_aws_logs_integration::AWSLogsIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_aws_logs_integration::AWSLogsIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AWSLogsIntegrationAPI::with_config(configuration); let resp = api.list_aws_logs_integrations().await; if let Ok(value) = resp { diff --git a/examples/v1_aws-logs-integration_list_aws_logs_services.rs b/examples/v1_aws-logs-integration_list_aws_logs_services.rs index 43fbc86af..c82b7cb6b 100644 --- a/examples/v1_aws-logs-integration_list_aws_logs_services.rs +++ b/examples/v1_aws-logs-integration_list_aws_logs_services.rs @@ -1,10 +1,10 @@ // Get list of AWS log ready services returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_aws_logs_integration::AWSLogsIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_aws_logs_integration::AWSLogsIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AWSLogsIntegrationAPI::with_config(configuration); let resp = api.list_aws_logs_services().await; if let Ok(value) = resp { diff --git a/examples/v1_azure-integration_create_azure_integration.rs b/examples/v1_azure-integration_create_azure_integration.rs index 77f1e8d37..c1d0ba771 100644 --- a/examples/v1_azure-integration_create_azure_integration.rs +++ b/examples/v1_azure-integration_create_azure_integration.rs @@ -1,6 +1,6 @@ // Create an Azure integration returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_azure_integration::AzureIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_azure_integration::AzureIntegrationAPI; use datadog_api_client::datadogV1::model::AzureAccount; #[tokio::main] @@ -19,7 +19,7 @@ async fn main() { .new_tenant_name("".to_string()) .resource_collection_enabled(true) .tenant_name("".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AzureIntegrationAPI::with_config(configuration); let resp = api.create_azure_integration(body).await; if let Ok(value) = resp { diff --git a/examples/v1_azure-integration_delete_azure_integration.rs b/examples/v1_azure-integration_delete_azure_integration.rs index ac3207d03..592bb0fcd 100644 --- a/examples/v1_azure-integration_delete_azure_integration.rs +++ b/examples/v1_azure-integration_delete_azure_integration.rs @@ -1,6 +1,6 @@ // Delete an Azure integration returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_azure_integration::AzureIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_azure_integration::AzureIntegrationAPI; use datadog_api_client::datadogV1::model::AzureAccount; #[tokio::main] @@ -8,7 +8,7 @@ async fn main() { let body = AzureAccount::new() .client_id("".to_string()) .tenant_name("".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AzureIntegrationAPI::with_config(configuration); let resp = api.delete_azure_integration(body).await; if let Ok(value) = resp { diff --git a/examples/v1_azure-integration_list_azure_integration.rs b/examples/v1_azure-integration_list_azure_integration.rs index 0afa2463e..308c381c6 100644 --- a/examples/v1_azure-integration_list_azure_integration.rs +++ b/examples/v1_azure-integration_list_azure_integration.rs @@ -1,10 +1,10 @@ // List all Azure integrations returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_azure_integration::AzureIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_azure_integration::AzureIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AzureIntegrationAPI::with_config(configuration); let resp = api.list_azure_integration().await; if let Ok(value) = resp { diff --git a/examples/v1_azure-integration_update_azure_host_filters.rs b/examples/v1_azure-integration_update_azure_host_filters.rs index c2b59f06e..90a2bf3c7 100644 --- a/examples/v1_azure-integration_update_azure_host_filters.rs +++ b/examples/v1_azure-integration_update_azure_host_filters.rs @@ -1,6 +1,6 @@ // Update Azure integration host filters returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_azure_integration::AzureIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_azure_integration::AzureIntegrationAPI; use datadog_api_client::datadogV1::model::AzureAccount; #[tokio::main] @@ -19,7 +19,7 @@ async fn main() { .new_tenant_name("new1c44-1234-5678-9101-cc00736ftest".to_string()) .resource_collection_enabled(true) .tenant_name("testc44-1234-5678-9101-cc00736ftest".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AzureIntegrationAPI::with_config(configuration); let resp = api.update_azure_host_filters(body).await; if let Ok(value) = resp { diff --git a/examples/v1_azure-integration_update_azure_integration.rs b/examples/v1_azure-integration_update_azure_integration.rs index fc3bad699..8c6e60802 100644 --- a/examples/v1_azure-integration_update_azure_integration.rs +++ b/examples/v1_azure-integration_update_azure_integration.rs @@ -1,6 +1,6 @@ // Update an Azure integration returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_azure_integration::AzureIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_azure_integration::AzureIntegrationAPI; use datadog_api_client::datadogV1::model::AzureAccount; #[tokio::main] @@ -19,7 +19,7 @@ async fn main() { .new_tenant_name("".to_string()) .resource_collection_enabled(true) .tenant_name("".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AzureIntegrationAPI::with_config(configuration); let resp = api.update_azure_integration(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboard-lists_create_dashboard_list.rs b/examples/v1_dashboard-lists_create_dashboard_list.rs index a57bea309..bd3b5b544 100644 --- a/examples/v1_dashboard-lists_create_dashboard_list.rs +++ b/examples/v1_dashboard-lists_create_dashboard_list.rs @@ -1,12 +1,12 @@ // Create a dashboard list returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboard_lists::DashboardListsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboard_lists::DashboardListsAPI; use datadog_api_client::datadogV1::model::DashboardList; #[tokio::main] async fn main() { let body = DashboardList::new("Example-Dashboard-List".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardListsAPI::with_config(configuration); let resp = api.create_dashboard_list(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboard-lists_delete_dashboard_list.rs b/examples/v1_dashboard-lists_delete_dashboard_list.rs index 11022ad8c..6b1f28ed6 100644 --- a/examples/v1_dashboard-lists_delete_dashboard_list.rs +++ b/examples/v1_dashboard-lists_delete_dashboard_list.rs @@ -1,12 +1,12 @@ // Delete a dashboard list returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboard_lists::DashboardListsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboard_lists::DashboardListsAPI; #[tokio::main] async fn main() { // there is a valid "dashboard_list" in the system let dashboard_list_id: i64 = std::env::var("DASHBOARD_LIST_ID").unwrap().parse().unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardListsAPI::with_config(configuration); let resp = api.delete_dashboard_list(dashboard_list_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboard-lists_get_dashboard_list.rs b/examples/v1_dashboard-lists_get_dashboard_list.rs index 8ecb7ac3c..96725e821 100644 --- a/examples/v1_dashboard-lists_get_dashboard_list.rs +++ b/examples/v1_dashboard-lists_get_dashboard_list.rs @@ -1,12 +1,12 @@ // Get a dashboard list returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboard_lists::DashboardListsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboard_lists::DashboardListsAPI; #[tokio::main] async fn main() { // there is a valid "dashboard_list" in the system let dashboard_list_id: i64 = std::env::var("DASHBOARD_LIST_ID").unwrap().parse().unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardListsAPI::with_config(configuration); let resp = api.get_dashboard_list(dashboard_list_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboard-lists_list_dashboard_lists.rs b/examples/v1_dashboard-lists_list_dashboard_lists.rs index b97d8ea88..04ae7a7f1 100644 --- a/examples/v1_dashboard-lists_list_dashboard_lists.rs +++ b/examples/v1_dashboard-lists_list_dashboard_lists.rs @@ -1,10 +1,10 @@ // Get all dashboard lists returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboard_lists::DashboardListsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboard_lists::DashboardListsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardListsAPI::with_config(configuration); let resp = api.list_dashboard_lists().await; if let Ok(value) = resp { diff --git a/examples/v1_dashboard-lists_update_dashboard_list.rs b/examples/v1_dashboard-lists_update_dashboard_list.rs index 4fd99b191..77e098eff 100644 --- a/examples/v1_dashboard-lists_update_dashboard_list.rs +++ b/examples/v1_dashboard-lists_update_dashboard_list.rs @@ -1,6 +1,6 @@ // Update a dashboard list returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboard_lists::DashboardListsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboard_lists::DashboardListsAPI; use datadog_api_client::datadogV1::model::DashboardList; #[tokio::main] @@ -8,7 +8,7 @@ async fn main() { // there is a valid "dashboard_list" in the system let dashboard_list_id: i64 = std::env::var("DASHBOARD_LIST_ID").unwrap().parse().unwrap(); let body = DashboardList::new("updated Example-Dashboard-List".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardListsAPI::with_config(configuration); let resp = api .update_dashboard_list(dashboard_list_id.clone(), body) diff --git a/examples/v1_dashboards_create_dashboard.rs b/examples/v1_dashboards_create_dashboard.rs index 94d9d76bf..ecabd8cb3 100644 --- a/examples/v1_dashboards_create_dashboard.rs +++ b/examples/v1_dashboards_create_dashboard.rs @@ -1,6 +1,6 @@ // Create a new dashboard returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::LogQueryDefinition; @@ -43,7 +43,7 @@ async fn main() { )), ))], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_1024858348.rs b/examples/v1_dashboards_create_dashboard_1024858348.rs index b222e1cac..9c824ad85 100644 --- a/examples/v1_dashboards_create_dashboard_1024858348.rs +++ b/examples/v1_dashboards_create_dashboard_1024858348.rs @@ -1,6 +1,6 @@ // Create a new dashboard with a formulas and functions treemap widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::FormulaAndFunctionEventAggregation; @@ -69,7 +69,7 @@ async fn main() { ).layout(WidgetLayout::new(4, 4, 0, 0)) ], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_1039800684.rs b/examples/v1_dashboards_create_dashboard_1039800684.rs index a46b7d601..423b0c814 100644 --- a/examples/v1_dashboards_create_dashboard_1039800684.rs +++ b/examples/v1_dashboards_create_dashboard_1039800684.rs @@ -1,6 +1,6 @@ // Create a new dashboard with logs_pattern_stream list_stream widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::ListStreamColumn; @@ -35,7 +35,7 @@ async fn main() { )), ))], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_109450134.rs b/examples/v1_dashboards_create_dashboard_109450134.rs index 1b79b7433..f7d42fcd7 100644 --- a/examples/v1_dashboards_create_dashboard_109450134.rs +++ b/examples/v1_dashboards_create_dashboard_109450134.rs @@ -1,6 +1,6 @@ // Create a new dashboard with slo list widget with sort -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::SLOListWidgetDefinition; @@ -44,7 +44,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_1094917386.rs b/examples/v1_dashboards_create_dashboard_1094917386.rs index 7bd0f642c..9e66b37ab 100644 --- a/examples/v1_dashboards_create_dashboard_1094917386.rs +++ b/examples/v1_dashboards_create_dashboard_1094917386.rs @@ -1,6 +1,6 @@ // Create a new dashboard with manage_status widget and show_priority parameter -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::MonitorSummaryWidgetDefinition; @@ -41,7 +41,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_1177423752.rs b/examples/v1_dashboards_create_dashboard_1177423752.rs index 60b374b92..fe517a02b 100644 --- a/examples/v1_dashboards_create_dashboard_1177423752.rs +++ b/examples/v1_dashboards_create_dashboard_1177423752.rs @@ -1,6 +1,6 @@ // Create a new dashboard with heatmap widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::HeatMapWidgetDefinition; @@ -38,7 +38,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_1200099236.rs b/examples/v1_dashboards_create_dashboard_1200099236.rs index 412593cde..5363435bf 100644 --- a/examples/v1_dashboards_create_dashboard_1200099236.rs +++ b/examples/v1_dashboards_create_dashboard_1200099236.rs @@ -1,6 +1,6 @@ // Create a new dashboard with hostmap widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::HostMapRequest; @@ -46,7 +46,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_1213075383.rs b/examples/v1_dashboards_create_dashboard_1213075383.rs index e2b28bf82..035381fb2 100644 --- a/examples/v1_dashboards_create_dashboard_1213075383.rs +++ b/examples/v1_dashboards_create_dashboard_1213075383.rs @@ -1,6 +1,6 @@ // Create a new dashboard with toplist widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::FormulaAndFunctionMetricAggregation; @@ -93,7 +93,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_1284514532.rs b/examples/v1_dashboards_create_dashboard_1284514532.rs index b9110ef72..24674e113 100644 --- a/examples/v1_dashboards_create_dashboard_1284514532.rs +++ b/examples/v1_dashboards_create_dashboard_1284514532.rs @@ -1,7 +1,7 @@ // Create a new dashboard with a timeseries widget using formulas and functions // cloud cost query -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::FormulaAndFunctionCloudCostDataSource; @@ -70,7 +70,7 @@ async fn main() { ) ], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_1307120899.rs b/examples/v1_dashboards_create_dashboard_1307120899.rs index e35c839d9..7e2055b30 100644 --- a/examples/v1_dashboards_create_dashboard_1307120899.rs +++ b/examples/v1_dashboards_create_dashboard_1307120899.rs @@ -1,6 +1,6 @@ // Create a new timeseries widget with ci_tests data source -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::DashboardReflowType; @@ -91,7 +91,7 @@ async fn main() { ) ], ).reflow_type(DashboardReflowType::AUTO); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_1423904722.rs b/examples/v1_dashboards_create_dashboard_1423904722.rs index e42784616..6c92a387f 100644 --- a/examples/v1_dashboards_create_dashboard_1423904722.rs +++ b/examples/v1_dashboards_create_dashboard_1423904722.rs @@ -1,6 +1,6 @@ // Create a new dashboard with slo list widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::SLOListWidgetDefinition; @@ -38,7 +38,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_1442588603.rs b/examples/v1_dashboards_create_dashboard_1442588603.rs index 917527a64..c1a719b07 100644 --- a/examples/v1_dashboards_create_dashboard_1442588603.rs +++ b/examples/v1_dashboards_create_dashboard_1442588603.rs @@ -1,7 +1,7 @@ // Create a distribution widget using a histogram request containing a formulas // and functions APM Stats query -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::DistributionWidgetDefinition; @@ -80,7 +80,7 @@ async fn main() { ).layout(WidgetLayout::new(2, 4, 8, 0)) ], ).description(Some("".to_string())); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_145494973.rs b/examples/v1_dashboards_create_dashboard_145494973.rs index 83b9f6aba..45b0ef4ce 100644 --- a/examples/v1_dashboards_create_dashboard_145494973.rs +++ b/examples/v1_dashboards_create_dashboard_145494973.rs @@ -1,6 +1,6 @@ // Create a new dashboard with apm resource stats widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::FormulaAndFunctionApmResourceStatName; @@ -62,7 +62,7 @@ async fn main() { ).layout(WidgetLayout::new(4, 4, 0, 0)) ], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_173805046.rs b/examples/v1_dashboards_create_dashboard_173805046.rs index ec12441a6..ee451caed 100644 --- a/examples/v1_dashboards_create_dashboard_173805046.rs +++ b/examples/v1_dashboards_create_dashboard_173805046.rs @@ -1,6 +1,6 @@ // Create a new dashboard with slo widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::SLOWidgetDefinition; @@ -36,7 +36,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_1738608750.rs b/examples/v1_dashboards_create_dashboard_1738608750.rs index 231eb9aec..8e442a1f5 100644 --- a/examples/v1_dashboards_create_dashboard_1738608750.rs +++ b/examples/v1_dashboards_create_dashboard_1738608750.rs @@ -1,6 +1,6 @@ // Create a new dashboard with free_text widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::FreeTextWidgetDefinition; @@ -32,7 +32,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_1754992756.rs b/examples/v1_dashboards_create_dashboard_1754992756.rs index 7f8d7c219..1169d9a52 100644 --- a/examples/v1_dashboards_create_dashboard_1754992756.rs +++ b/examples/v1_dashboards_create_dashboard_1754992756.rs @@ -1,6 +1,6 @@ // Create a new dashboard with powerpack widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::PowerpackTemplateVariableContents; @@ -39,7 +39,7 @@ async fn main() { ) .description(Some("description".to_string())) .is_read_only(false); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_1877023900.rs b/examples/v1_dashboards_create_dashboard_1877023900.rs index 35d1734ac..b67c2c896 100644 --- a/examples/v1_dashboards_create_dashboard_1877023900.rs +++ b/examples/v1_dashboards_create_dashboard_1877023900.rs @@ -1,6 +1,6 @@ // Create a new dashboard with list_stream widget with a valid sort parameter ASC -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::ListStreamColumn; @@ -41,7 +41,7 @@ async fn main() { )), ))], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2029850837.rs b/examples/v1_dashboards_create_dashboard_2029850837.rs index c2a275c7f..565cb579f 100644 --- a/examples/v1_dashboards_create_dashboard_2029850837.rs +++ b/examples/v1_dashboards_create_dashboard_2029850837.rs @@ -1,6 +1,6 @@ // Create a new dashboard with log_stream widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::LogStreamWidgetDefinition; @@ -42,7 +42,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2034634967.rs b/examples/v1_dashboards_create_dashboard_2034634967.rs index 3db3e671e..ace707435 100644 --- a/examples/v1_dashboards_create_dashboard_2034634967.rs +++ b/examples/v1_dashboards_create_dashboard_2034634967.rs @@ -1,6 +1,6 @@ // Create a new dashboard with servicemap widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::ServiceMapWidgetDefinition; @@ -33,7 +33,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2064651578.rs b/examples/v1_dashboards_create_dashboard_2064651578.rs index 63b45d3b4..670efbc33 100644 --- a/examples/v1_dashboards_create_dashboard_2064651578.rs +++ b/examples/v1_dashboards_create_dashboard_2064651578.rs @@ -1,6 +1,6 @@ // Create a new dashboard with team tags returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::ChangeWidgetDefinition; use datadog_api_client::datadogV1::model::ChangeWidgetDefinitionType; use datadog_api_client::datadogV1::model::ChangeWidgetRequest; @@ -84,7 +84,7 @@ async fn main() { ).layout(WidgetLayout::new(4, 4, 0, 0)) ], ).tags(Some(vec!["team:foobar".to_string()])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2104498738.rs b/examples/v1_dashboards_create_dashboard_2104498738.rs index 81d892ef8..6245f0515 100644 --- a/examples/v1_dashboards_create_dashboard_2104498738.rs +++ b/examples/v1_dashboards_create_dashboard_2104498738.rs @@ -1,6 +1,6 @@ // Create a new dashboard with formulas and functions scatterplot widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::FormulaAndFunctionMetricAggregation; @@ -83,7 +83,7 @@ async fn main() { .layout(WidgetLayout::new(2, 4, 0, 0)) ], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2261785072.rs b/examples/v1_dashboards_create_dashboard_2261785072.rs index 16d6b708d..f4a2de895 100644 --- a/examples/v1_dashboards_create_dashboard_2261785072.rs +++ b/examples/v1_dashboards_create_dashboard_2261785072.rs @@ -1,6 +1,6 @@ // Create a new dashboard with a timeseries widget and an overlay request -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::FormulaAndFunctionMetricDataSource; @@ -78,7 +78,7 @@ async fn main() { ) ], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2278756614.rs b/examples/v1_dashboards_create_dashboard_2278756614.rs index 70fbaf26a..07a78368f 100644 --- a/examples/v1_dashboards_create_dashboard_2278756614.rs +++ b/examples/v1_dashboards_create_dashboard_2278756614.rs @@ -1,6 +1,6 @@ // Create a new dashboard with split graph widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::FormulaAndFunctionMetricDataSource; @@ -109,7 +109,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2308247857.rs b/examples/v1_dashboards_create_dashboard_2308247857.rs index e5ac671f7..18fe75577 100644 --- a/examples/v1_dashboards_create_dashboard_2308247857.rs +++ b/examples/v1_dashboards_create_dashboard_2308247857.rs @@ -1,6 +1,6 @@ // Create a new dashboard with alert_graph widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::AlertGraphWidgetDefinition; use datadog_api_client::datadogV1::model::AlertGraphWidgetDefinitionType; use datadog_api_client::datadogV1::model::Dashboard; @@ -37,7 +37,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2316374332.rs b/examples/v1_dashboards_create_dashboard_2316374332.rs index d2c523468..ede10f1aa 100644 --- a/examples/v1_dashboards_create_dashboard_2316374332.rs +++ b/examples/v1_dashboards_create_dashboard_2316374332.rs @@ -1,6 +1,6 @@ // Create a new dashboard with alert_value widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::AlertValueWidgetDefinition; use datadog_api_client::datadogV1::model::AlertValueWidgetDefinitionType; use datadog_api_client::datadogV1::model::Dashboard; @@ -36,7 +36,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2336428357.rs b/examples/v1_dashboards_create_dashboard_2336428357.rs index ee41a1cea..47a60f472 100644 --- a/examples/v1_dashboards_create_dashboard_2336428357.rs +++ b/examples/v1_dashboards_create_dashboard_2336428357.rs @@ -1,6 +1,6 @@ // Create a new dashboard with query_table widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::FormulaAndFunctionMetricAggregation; @@ -79,7 +79,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2338918735.rs b/examples/v1_dashboards_create_dashboard_2338918735.rs index 9d8cc8b46..9f710fd00 100644 --- a/examples/v1_dashboards_create_dashboard_2338918735.rs +++ b/examples/v1_dashboards_create_dashboard_2338918735.rs @@ -1,6 +1,6 @@ // Create a new dashboard with list_stream widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::ListStreamColumn; @@ -33,7 +33,7 @@ async fn main() { )), ))], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2342457693.rs b/examples/v1_dashboards_create_dashboard_2342457693.rs index dca6e1dee..10e623da0 100644 --- a/examples/v1_dashboards_create_dashboard_2342457693.rs +++ b/examples/v1_dashboards_create_dashboard_2342457693.rs @@ -1,6 +1,6 @@ // Create a new dashboard with scatterplot widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::FormulaAndFunctionMetricAggregation; @@ -103,7 +103,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2349863258.rs b/examples/v1_dashboards_create_dashboard_2349863258.rs index b23048e31..a0339243e 100644 --- a/examples/v1_dashboards_create_dashboard_2349863258.rs +++ b/examples/v1_dashboards_create_dashboard_2349863258.rs @@ -1,6 +1,6 @@ // Create a new dashboard with query_value widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::FormulaAndFunctionMetricAggregation; @@ -63,7 +63,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2361531620.rs b/examples/v1_dashboards_create_dashboard_2361531620.rs index 45e9190e3..79237a676 100644 --- a/examples/v1_dashboards_create_dashboard_2361531620.rs +++ b/examples/v1_dashboards_create_dashboard_2361531620.rs @@ -1,6 +1,6 @@ // Create a new dashboard with list_stream widget with a valid sort parameter DESC -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::ListStreamColumn; @@ -41,7 +41,7 @@ async fn main() { )), ))], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2432046716.rs b/examples/v1_dashboards_create_dashboard_2432046716.rs index 290de4cdf..ed7664a2c 100644 --- a/examples/v1_dashboards_create_dashboard_2432046716.rs +++ b/examples/v1_dashboards_create_dashboard_2432046716.rs @@ -1,6 +1,6 @@ // Create a new dashboard with event_stream list_stream widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::ListStreamColumn; @@ -35,7 +35,7 @@ async fn main() { )), ))], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2490110261.rs b/examples/v1_dashboards_create_dashboard_2490110261.rs index 834c6aa98..024983863 100644 --- a/examples/v1_dashboards_create_dashboard_2490110261.rs +++ b/examples/v1_dashboards_create_dashboard_2490110261.rs @@ -1,6 +1,6 @@ // Create a new dashboard with an audit logs query -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::FormulaAndFunctionEventAggregation; @@ -62,7 +62,7 @@ async fn main() { ).layout(WidgetLayout::new(2, 4, 2, 0)) ], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_252716965.rs b/examples/v1_dashboards_create_dashboard_252716965.rs index 947df83a5..c88320b02 100644 --- a/examples/v1_dashboards_create_dashboard_252716965.rs +++ b/examples/v1_dashboards_create_dashboard_252716965.rs @@ -1,7 +1,7 @@ // Create a distribution widget using a histogram request containing a formulas // and functions metrics query -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::DistributionWidgetDefinition; @@ -80,7 +80,7 @@ async fn main() { ).layout(WidgetLayout::new(2, 4, 0, 0)) ], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2607944105.rs b/examples/v1_dashboards_create_dashboard_2607944105.rs index 5759b9445..240256194 100644 --- a/examples/v1_dashboards_create_dashboard_2607944105.rs +++ b/examples/v1_dashboards_create_dashboard_2607944105.rs @@ -1,6 +1,6 @@ // Create a new dashboard with check_status widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::CheckStatusWidgetDefinition; use datadog_api_client::datadogV1::model::CheckStatusWidgetDefinitionType; use datadog_api_client::datadogV1::model::Dashboard; @@ -34,7 +34,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2610827685.rs b/examples/v1_dashboards_create_dashboard_2610827685.rs index c09f1dd65..8ab44c455 100644 --- a/examples/v1_dashboards_create_dashboard_2610827685.rs +++ b/examples/v1_dashboards_create_dashboard_2610827685.rs @@ -1,6 +1,6 @@ // Create a new dashboard with run-workflow widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::RunWorkflowWidgetDefinition; @@ -39,7 +39,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2618036642.rs b/examples/v1_dashboards_create_dashboard_2618036642.rs index cd22df566..8b2046b63 100644 --- a/examples/v1_dashboards_create_dashboard_2618036642.rs +++ b/examples/v1_dashboards_create_dashboard_2618036642.rs @@ -1,6 +1,6 @@ // Create a new dashboard with trace_stream widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::ListStreamColumn; @@ -33,7 +33,7 @@ async fn main() { )), ))], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2634813877.rs b/examples/v1_dashboards_create_dashboard_2634813877.rs index 55144bbc9..5699501cb 100644 --- a/examples/v1_dashboards_create_dashboard_2634813877.rs +++ b/examples/v1_dashboards_create_dashboard_2634813877.rs @@ -1,6 +1,6 @@ // Create a new dashboard with event_stream widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::EventStreamWidgetDefinition; @@ -35,7 +35,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2644712913.rs b/examples/v1_dashboards_create_dashboard_2644712913.rs index 9f22ed364..4d6f65b4f 100644 --- a/examples/v1_dashboards_create_dashboard_2644712913.rs +++ b/examples/v1_dashboards_create_dashboard_2644712913.rs @@ -1,6 +1,6 @@ // Create a new dashboard with a query value widget using the percentile aggregator -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::FormulaAndFunctionMetricAggregation; @@ -61,7 +61,7 @@ async fn main() { ).layout(WidgetLayout::new(2, 2, 0, 0)) ], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2652180930.rs b/examples/v1_dashboards_create_dashboard_2652180930.rs index de3a4a5d5..e4dd0b1b4 100644 --- a/examples/v1_dashboards_create_dashboard_2652180930.rs +++ b/examples/v1_dashboards_create_dashboard_2652180930.rs @@ -1,6 +1,6 @@ // Create a new dashboard with topology_map widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::TopologyMapWidgetDefinition; @@ -43,7 +43,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2705593938.rs b/examples/v1_dashboards_create_dashboard_2705593938.rs index 6b4befb31..7dd47a639 100644 --- a/examples/v1_dashboards_create_dashboard_2705593938.rs +++ b/examples/v1_dashboards_create_dashboard_2705593938.rs @@ -1,6 +1,6 @@ // Create a new dashboard with sunburst widget and metrics data -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::FormulaAndFunctionMetricAggregation; @@ -59,7 +59,7 @@ async fn main() { ).layout(WidgetLayout::new(4, 4, 0, 0)) ], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2800096921.rs b/examples/v1_dashboards_create_dashboard_2800096921.rs index 803dd0d46..f307a682b 100644 --- a/examples/v1_dashboards_create_dashboard_2800096921.rs +++ b/examples/v1_dashboards_create_dashboard_2800096921.rs @@ -1,6 +1,6 @@ // Create a new timeseries widget with ci_pipelines data source -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::DashboardReflowType; @@ -91,7 +91,7 @@ async fn main() { ) ], ).reflow_type(DashboardReflowType::AUTO); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2843286292.rs b/examples/v1_dashboards_create_dashboard_2843286292.rs index 274ff139d..d586a2842 100644 --- a/examples/v1_dashboards_create_dashboard_2843286292.rs +++ b/examples/v1_dashboards_create_dashboard_2843286292.rs @@ -1,6 +1,6 @@ // Create a new dashboard with logs_transaction_stream list_stream widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::ListStreamColumn; @@ -41,7 +41,7 @@ async fn main() { )), ))], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2850365602.rs b/examples/v1_dashboards_create_dashboard_2850365602.rs index 56d127f71..d699ee914 100644 --- a/examples/v1_dashboards_create_dashboard_2850365602.rs +++ b/examples/v1_dashboards_create_dashboard_2850365602.rs @@ -1,7 +1,7 @@ // Create a new dashboard with template variable presets using values returns "OK" // response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::DashboardReflowType; @@ -48,7 +48,7 @@ async fn main() { ])) .defaults(vec!["my-host".to_string()]) .prefix(Some("host".to_string()))])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2917274132.rs b/examples/v1_dashboards_create_dashboard_2917274132.rs index 330e4398a..f39820f25 100644 --- a/examples/v1_dashboards_create_dashboard_2917274132.rs +++ b/examples/v1_dashboards_create_dashboard_2917274132.rs @@ -1,6 +1,6 @@ // Create a new dashboard with manage_status widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::MonitorSummaryWidgetDefinition; @@ -40,7 +40,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_2921337351.rs b/examples/v1_dashboards_create_dashboard_2921337351.rs index 62798082e..ceb7c5e8f 100644 --- a/examples/v1_dashboards_create_dashboard_2921337351.rs +++ b/examples/v1_dashboards_create_dashboard_2921337351.rs @@ -1,6 +1,6 @@ // Create a new dashboard with trace_service widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::ServiceSummaryWidgetDefinition; @@ -43,7 +43,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_3117424216.rs b/examples/v1_dashboards_create_dashboard_3117424216.rs index 578e0b540..47516524a 100644 --- a/examples/v1_dashboards_create_dashboard_3117424216.rs +++ b/examples/v1_dashboards_create_dashboard_3117424216.rs @@ -1,6 +1,6 @@ // Create a new dashboard with logs_stream list_stream widget and storage parameter -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::ListStreamColumn; @@ -34,7 +34,7 @@ async fn main() { )), ))], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_3195475781.rs b/examples/v1_dashboards_create_dashboard_3195475781.rs index 371a70dd9..dad1042fc 100644 --- a/examples/v1_dashboards_create_dashboard_3195475781.rs +++ b/examples/v1_dashboards_create_dashboard_3195475781.rs @@ -1,6 +1,6 @@ // Create a new dashboard with ci_test_stream list_stream widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::ListStreamColumn; @@ -36,7 +36,7 @@ async fn main() { )), ))], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_3250131584.rs b/examples/v1_dashboards_create_dashboard_3250131584.rs index e103b512a..3f0ac5117 100644 --- a/examples/v1_dashboards_create_dashboard_3250131584.rs +++ b/examples/v1_dashboards_create_dashboard_3250131584.rs @@ -1,6 +1,6 @@ // Create a new dashboard with event_timeline widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::EventTimelineWidgetDefinition; @@ -33,7 +33,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_3513586382.rs b/examples/v1_dashboards_create_dashboard_3513586382.rs index 290672eba..9fd99917e 100644 --- a/examples/v1_dashboards_create_dashboard_3513586382.rs +++ b/examples/v1_dashboards_create_dashboard_3513586382.rs @@ -1,6 +1,6 @@ // Create a geomap widget using an event_list request -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::DashboardReflowType; @@ -72,7 +72,7 @@ async fn main() { .reflow_type(DashboardReflowType::FIXED) .tags(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_3562282606.rs b/examples/v1_dashboards_create_dashboard_3562282606.rs index 83aa75447..9d42cc4e1 100644 --- a/examples/v1_dashboards_create_dashboard_3562282606.rs +++ b/examples/v1_dashboards_create_dashboard_3562282606.rs @@ -1,7 +1,7 @@ // Create a new dashboard with a change widget using formulas and functions slo // query -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::ChangeWidgetDefinition; use datadog_api_client::datadogV1::model::ChangeWidgetDefinitionType; use datadog_api_client::datadogV1::model::ChangeWidgetRequest; @@ -69,7 +69,7 @@ async fn main() { .layout(WidgetLayout::new(2, 4, 0, 0)), ], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_3669695268.rs b/examples/v1_dashboards_create_dashboard_3669695268.rs index 08bd24ebd..614660a38 100644 --- a/examples/v1_dashboards_create_dashboard_3669695268.rs +++ b/examples/v1_dashboards_create_dashboard_3669695268.rs @@ -1,6 +1,6 @@ // Create a new dashboard with logs query table widget and storage parameter -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::FormulaAndFunctionEventAggregation; @@ -60,7 +60,7 @@ async fn main() { )), ))], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_3777304439.rs b/examples/v1_dashboards_create_dashboard_3777304439.rs index 6929db5a2..d5172b48c 100644 --- a/examples/v1_dashboards_create_dashboard_3777304439.rs +++ b/examples/v1_dashboards_create_dashboard_3777304439.rs @@ -1,6 +1,6 @@ // Create a new dashboard with formula and function heatmap widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::FormulaAndFunctionMetricDataSource; @@ -63,7 +63,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_3882428227.rs b/examples/v1_dashboards_create_dashboard_3882428227.rs index 84ee5de41..4ebc0fb55 100644 --- a/examples/v1_dashboards_create_dashboard_3882428227.rs +++ b/examples/v1_dashboards_create_dashboard_3882428227.rs @@ -1,7 +1,7 @@ // Create a distribution widget using a histogram request containing a formulas // and functions events query -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::DistributionWidgetDefinition; @@ -82,7 +82,7 @@ async fn main() { ).layout(WidgetLayout::new(2, 4, 0, 0)) ], ).description(Some("Example-Dashboard".to_string())); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_3982498788.rs b/examples/v1_dashboards_create_dashboard_3982498788.rs index 09c313dc2..caa426d2c 100644 --- a/examples/v1_dashboards_create_dashboard_3982498788.rs +++ b/examples/v1_dashboards_create_dashboard_3982498788.rs @@ -1,6 +1,6 @@ // Create a new dashboard with timeseries widget containing style attributes -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::TimeseriesWidgetDefinition; @@ -45,7 +45,7 @@ async fn main() { ) ], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_4026341408.rs b/examples/v1_dashboards_create_dashboard_4026341408.rs index 4c401f033..770a2e618 100644 --- a/examples/v1_dashboards_create_dashboard_4026341408.rs +++ b/examples/v1_dashboards_create_dashboard_4026341408.rs @@ -1,6 +1,6 @@ // Create a new dashboard with apm_issue_stream list_stream widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::ListStreamColumn; @@ -33,7 +33,7 @@ async fn main() { )), ))], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_4076476470.rs b/examples/v1_dashboards_create_dashboard_4076476470.rs index f751afe12..3602d03d5 100644 --- a/examples/v1_dashboards_create_dashboard_4076476470.rs +++ b/examples/v1_dashboards_create_dashboard_4076476470.rs @@ -1,6 +1,6 @@ // Create a new dashboard with rum_issue_stream list_stream widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::ListStreamColumn; @@ -33,7 +33,7 @@ async fn main() { )), ))], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_41622531.rs b/examples/v1_dashboards_create_dashboard_41622531.rs index 19bc6d4e7..f4637a9c6 100644 --- a/examples/v1_dashboards_create_dashboard_41622531.rs +++ b/examples/v1_dashboards_create_dashboard_41622531.rs @@ -1,6 +1,6 @@ // Create a new dashboard with timeseries widget and formula style attributes -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::DashboardReflowType; @@ -90,7 +90,7 @@ async fn main() { ) ], ).reflow_type(DashboardReflowType::AUTO); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_417992286.rs b/examples/v1_dashboards_create_dashboard_417992286.rs index 7828d0ded..48a3bd66f 100644 --- a/examples/v1_dashboards_create_dashboard_417992286.rs +++ b/examples/v1_dashboards_create_dashboard_417992286.rs @@ -1,6 +1,6 @@ // Create a new dashboard with note widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::NoteWidgetDefinition; @@ -23,7 +23,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_578885732.rs b/examples/v1_dashboards_create_dashboard_578885732.rs index a2f5becd9..0862a6f8e 100644 --- a/examples/v1_dashboards_create_dashboard_578885732.rs +++ b/examples/v1_dashboards_create_dashboard_578885732.rs @@ -1,6 +1,6 @@ // Create a new dashboard with a formulas and functions change widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::ChangeWidgetDefinition; use datadog_api_client::datadogV1::model::ChangeWidgetDefinitionType; use datadog_api_client::datadogV1::model::ChangeWidgetRequest; @@ -84,7 +84,7 @@ async fn main() { ).layout(WidgetLayout::new(4, 4, 0, 0)) ], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_651038379.rs b/examples/v1_dashboards_create_dashboard_651038379.rs index 17592c010..013cae297 100644 --- a/examples/v1_dashboards_create_dashboard_651038379.rs +++ b/examples/v1_dashboards_create_dashboard_651038379.rs @@ -1,6 +1,6 @@ // Create a new dashboard with image widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::ImageWidgetDefinition; @@ -30,7 +30,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_765140092.rs b/examples/v1_dashboards_create_dashboard_765140092.rs index b5cefa6e7..0ceea4628 100644 --- a/examples/v1_dashboards_create_dashboard_765140092.rs +++ b/examples/v1_dashboards_create_dashboard_765140092.rs @@ -1,6 +1,6 @@ // Create a new dashboard with a query value widget using timeseries background -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::FormulaAndFunctionMetricAggregation; @@ -69,7 +69,7 @@ async fn main() { ).layout(WidgetLayout::new(2, 2, 0, 0)) ], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_798168180.rs b/examples/v1_dashboards_create_dashboard_798168180.rs index cc04a45ab..539dbd776 100644 --- a/examples/v1_dashboards_create_dashboard_798168180.rs +++ b/examples/v1_dashboards_create_dashboard_798168180.rs @@ -1,6 +1,6 @@ // Create a new dashboard with apm dependency stats widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::FormulaAndFunctionApmDependencyStatName; @@ -62,7 +62,7 @@ async fn main() { ).layout(WidgetLayout::new(4, 4, 0, 0)) ], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_803346562.rs b/examples/v1_dashboards_create_dashboard_803346562.rs index c6558bfd6..b5e4d73f9 100644 --- a/examples/v1_dashboards_create_dashboard_803346562.rs +++ b/examples/v1_dashboards_create_dashboard_803346562.rs @@ -1,6 +1,6 @@ // Create a new dashboard with distribution widget and apm stats data -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::ApmStatsQueryDefinition; use datadog_api_client::datadogV1::model::ApmStatsQueryRowType; use datadog_api_client::datadogV1::model::Dashboard; @@ -39,7 +39,7 @@ async fn main() { .layout(WidgetLayout::new(4, 4, 0, 0)), ], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_858397694.rs b/examples/v1_dashboards_create_dashboard_858397694.rs index 1a63ea464..a4fd12b94 100644 --- a/examples/v1_dashboards_create_dashboard_858397694.rs +++ b/examples/v1_dashboards_create_dashboard_858397694.rs @@ -1,6 +1,6 @@ // Create a new dashboard with template variable defaults returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::DashboardReflowType; @@ -40,7 +40,7 @@ async fn main() { ])) .defaults(vec!["my-host".to_string()]) .prefix(Some("host".to_string()))])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_913313564.rs b/examples/v1_dashboards_create_dashboard_913313564.rs index e8d23130a..a208cfe85 100644 --- a/examples/v1_dashboards_create_dashboard_913313564.rs +++ b/examples/v1_dashboards_create_dashboard_913313564.rs @@ -1,6 +1,6 @@ // Create a new dashboard with iframe widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::IFrameWidgetDefinition; @@ -28,7 +28,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_915214113.rs b/examples/v1_dashboards_create_dashboard_915214113.rs index c5444e780..bc30b97a8 100644 --- a/examples/v1_dashboards_create_dashboard_915214113.rs +++ b/examples/v1_dashboards_create_dashboard_915214113.rs @@ -1,6 +1,6 @@ // Create a new dashboard with geomap widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::FormulaAndFunctionEventAggregation; @@ -104,7 +104,7 @@ async fn main() { .is_read_only(false) .notify_list(Some(vec![])) .template_variables(Some(vec![])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_dashboard_927141680.rs b/examples/v1_dashboards_create_dashboard_927141680.rs index 97022d65c..d337ac54b 100644 --- a/examples/v1_dashboards_create_dashboard_927141680.rs +++ b/examples/v1_dashboards_create_dashboard_927141680.rs @@ -1,6 +1,6 @@ // Create a new dashboard with funnel widget -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::FunnelQuery; @@ -27,7 +27,7 @@ async fn main() { )), ))], ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_create_public_dashboard.rs b/examples/v1_dashboards_create_public_dashboard.rs index 85492c091..e106025e4 100644 --- a/examples/v1_dashboards_create_public_dashboard.rs +++ b/examples/v1_dashboards_create_public_dashboard.rs @@ -1,6 +1,6 @@ // Create a shared dashboard returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::DashboardGlobalTime; use datadog_api_client::datadogV1::model::DashboardGlobalTimeLiveSpan; use datadog_api_client::datadogV1::model::DashboardShareType; @@ -16,7 +16,7 @@ async fn main() { DashboardGlobalTime::new().live_span(DashboardGlobalTimeLiveSpan::PAST_ONE_HOUR), ) .share_type(Some(DashboardShareType::OPEN)); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.create_public_dashboard(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_delete_dashboard.rs b/examples/v1_dashboards_delete_dashboard.rs index 1839fbe4a..a170de1c2 100644 --- a/examples/v1_dashboards_delete_dashboard.rs +++ b/examples/v1_dashboards_delete_dashboard.rs @@ -1,12 +1,12 @@ // Delete a dashboard returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; #[tokio::main] async fn main() { // there is a valid "dashboard" in the system let dashboard_id = std::env::var("DASHBOARD_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.delete_dashboard(dashboard_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_delete_dashboards.rs b/examples/v1_dashboards_delete_dashboards.rs index 0fbf36619..f43b32738 100644 --- a/examples/v1_dashboards_delete_dashboards.rs +++ b/examples/v1_dashboards_delete_dashboards.rs @@ -1,6 +1,6 @@ // Delete dashboards returns "No Content" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::DashboardBulkActionData; use datadog_api_client::datadogV1::model::DashboardBulkDeleteRequest; use datadog_api_client::datadogV1::model::DashboardResourceType; @@ -13,7 +13,7 @@ async fn main() { dashboard_id.clone(), DashboardResourceType::DASHBOARD, )]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.delete_dashboards(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_delete_public_dashboard.rs b/examples/v1_dashboards_delete_public_dashboard.rs index 30eca89bc..35a668f4e 100644 --- a/examples/v1_dashboards_delete_public_dashboard.rs +++ b/examples/v1_dashboards_delete_public_dashboard.rs @@ -1,10 +1,10 @@ // Revoke a shared dashboard URL returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.delete_public_dashboard("token".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_delete_public_dashboard_invitation.rs b/examples/v1_dashboards_delete_public_dashboard_invitation.rs index a8e770d75..483291e37 100644 --- a/examples/v1_dashboards_delete_public_dashboard_invitation.rs +++ b/examples/v1_dashboards_delete_public_dashboard_invitation.rs @@ -1,6 +1,6 @@ // Revoke shared dashboard invitations returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::DashboardInviteType; use datadog_api_client::datadogV1::model::SharedDashboardInvites; use datadog_api_client::datadogV1::model::SharedDashboardInvitesData; @@ -17,7 +17,7 @@ async fn main() { DashboardInviteType::PUBLIC_DASHBOARD_INVITATION, )], )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api .delete_public_dashboard_invitation("token".to_string(), body) diff --git a/examples/v1_dashboards_get_dashboard.rs b/examples/v1_dashboards_get_dashboard.rs index 931d40727..33970127c 100644 --- a/examples/v1_dashboards_get_dashboard.rs +++ b/examples/v1_dashboards_get_dashboard.rs @@ -1,12 +1,12 @@ // Get a dashboard returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; #[tokio::main] async fn main() { // there is a valid "dashboard" in the system let dashboard_id = std::env::var("DASHBOARD_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.get_dashboard(dashboard_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_get_dashboard_4262333854.rs b/examples/v1_dashboards_get_dashboard_4262333854.rs index ff2cdea4b..aecb69ed7 100644 --- a/examples/v1_dashboards_get_dashboard_4262333854.rs +++ b/examples/v1_dashboards_get_dashboard_4262333854.rs @@ -1,12 +1,12 @@ // Get a dashboard returns 'author_name' -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; #[tokio::main] async fn main() { // there is a valid "dashboard" in the system let dashboard_id = std::env::var("DASHBOARD_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.get_dashboard(dashboard_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_get_public_dashboard.rs b/examples/v1_dashboards_get_public_dashboard.rs index a512ff829..a3de8fc6e 100644 --- a/examples/v1_dashboards_get_public_dashboard.rs +++ b/examples/v1_dashboards_get_public_dashboard.rs @@ -1,12 +1,12 @@ // Get a shared dashboard returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; #[tokio::main] async fn main() { // there is a valid "shared_dashboard" in the system let shared_dashboard_token = std::env::var("SHARED_DASHBOARD_TOKEN").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api .get_public_dashboard(shared_dashboard_token.clone()) diff --git a/examples/v1_dashboards_get_public_dashboard_invitations.rs b/examples/v1_dashboards_get_public_dashboard_invitations.rs index e56be5831..c6b67a8ca 100644 --- a/examples/v1_dashboards_get_public_dashboard_invitations.rs +++ b/examples/v1_dashboards_get_public_dashboard_invitations.rs @@ -1,13 +1,13 @@ // Get all invitations for a shared dashboard returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; -use datadog_api_client::datadogV1::api::api_dashboards::GetPublicDashboardInvitationsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; +use datadog_api_client::datadogV1::api_dashboards::GetPublicDashboardInvitationsOptionalParams; #[tokio::main] async fn main() { // there is a valid "shared_dashboard" in the system let shared_dashboard_token = std::env::var("SHARED_DASHBOARD_TOKEN").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api .get_public_dashboard_invitations( diff --git a/examples/v1_dashboards_list_dashboards.rs b/examples/v1_dashboards_list_dashboards.rs index 5fa82f917..92cd2888a 100644 --- a/examples/v1_dashboards_list_dashboards.rs +++ b/examples/v1_dashboards_list_dashboards.rs @@ -1,11 +1,11 @@ // Get all dashboards returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; -use datadog_api_client::datadogV1::api::api_dashboards::ListDashboardsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; +use datadog_api_client::datadogV1::api_dashboards::ListDashboardsOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api .list_dashboards(ListDashboardsOptionalParams::default().filter_shared(false)) diff --git a/examples/v1_dashboards_list_dashboards_1062671515.rs b/examples/v1_dashboards_list_dashboards_1062671515.rs index 1c32ede5b..1f6ce40e7 100644 --- a/examples/v1_dashboards_list_dashboards_1062671515.rs +++ b/examples/v1_dashboards_list_dashboards_1062671515.rs @@ -1,13 +1,13 @@ // Get all dashboards returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; -use datadog_api_client::datadogV1::api::api_dashboards::ListDashboardsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; +use datadog_api_client::datadogV1::api_dashboards::ListDashboardsOptionalParams; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let response = api.list_dashboards_with_pagination(ListDashboardsOptionalParams::default().count(2)); diff --git a/examples/v1_dashboards_list_dashboards_1773932563.rs b/examples/v1_dashboards_list_dashboards_1773932563.rs index 2bb19c4d5..cc7d8510c 100644 --- a/examples/v1_dashboards_list_dashboards_1773932563.rs +++ b/examples/v1_dashboards_list_dashboards_1773932563.rs @@ -1,11 +1,11 @@ // Get deleted dashboards returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; -use datadog_api_client::datadogV1::api::api_dashboards::ListDashboardsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; +use datadog_api_client::datadogV1::api_dashboards::ListDashboardsOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api .list_dashboards(ListDashboardsOptionalParams::default().filter_deleted(true)) diff --git a/examples/v1_dashboards_restore_dashboards.rs b/examples/v1_dashboards_restore_dashboards.rs index 2a624921b..b76a43abd 100644 --- a/examples/v1_dashboards_restore_dashboards.rs +++ b/examples/v1_dashboards_restore_dashboards.rs @@ -1,6 +1,6 @@ // Restore deleted dashboards returns "No Content" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::DashboardBulkActionData; use datadog_api_client::datadogV1::model::DashboardResourceType; use datadog_api_client::datadogV1::model::DashboardRestoreRequest; @@ -13,7 +13,7 @@ async fn main() { dashboard_id.clone(), DashboardResourceType::DASHBOARD, )]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.restore_dashboards(body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_send_public_dashboard_invitation.rs b/examples/v1_dashboards_send_public_dashboard_invitation.rs index 0bced61af..4094bc724 100644 --- a/examples/v1_dashboards_send_public_dashboard_invitation.rs +++ b/examples/v1_dashboards_send_public_dashboard_invitation.rs @@ -1,6 +1,6 @@ // Send shared dashboard invitation email returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::DashboardInviteType; use datadog_api_client::datadogV1::model::SharedDashboardInvites; use datadog_api_client::datadogV1::model::SharedDashboardInvitesData; @@ -20,7 +20,7 @@ async fn main() { ), )), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api .send_public_dashboard_invitation(shared_dashboard_token.clone(), body) diff --git a/examples/v1_dashboards_update_dashboard.rs b/examples/v1_dashboards_update_dashboard.rs index 4396a283b..e3432a3f6 100644 --- a/examples/v1_dashboards_update_dashboard.rs +++ b/examples/v1_dashboards_update_dashboard.rs @@ -1,6 +1,6 @@ // Update a dashboard returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::ListStreamColumn; @@ -36,7 +36,7 @@ async fn main() { ))], ) .description(Some("Updated description".to_string())); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.update_dashboard(dashboard_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_update_dashboard_3454865944.rs b/examples/v1_dashboards_update_dashboard_3454865944.rs index edd7e5e45..297f39aeb 100644 --- a/examples/v1_dashboards_update_dashboard_3454865944.rs +++ b/examples/v1_dashboards_update_dashboard_3454865944.rs @@ -1,6 +1,6 @@ // Update a dashboard with tags returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::Dashboard; use datadog_api_client::datadogV1::model::DashboardLayoutType; use datadog_api_client::datadogV1::model::ListStreamColumn; @@ -37,7 +37,7 @@ async fn main() { ) .description(Some("Updated description".to_string())) .tags(Some(vec!["team:foo".to_string(), "team:bar".to_string()])); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api.update_dashboard(dashboard_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v1_dashboards_update_public_dashboard.rs b/examples/v1_dashboards_update_public_dashboard.rs index ff081bf9e..315b07bb1 100644 --- a/examples/v1_dashboards_update_public_dashboard.rs +++ b/examples/v1_dashboards_update_public_dashboard.rs @@ -1,6 +1,6 @@ // Update a shared dashboard returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_dashboards::DashboardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI; use datadog_api_client::datadogV1::model::DashboardGlobalTimeLiveSpan; use datadog_api_client::datadogV1::model::DashboardShareType; use datadog_api_client::datadogV1::model::SharedDashboardUpdateRequest; @@ -16,7 +16,7 @@ async fn main() { )) .share_list(Some(vec![])) .share_type(Some(DashboardShareType::OPEN)); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardsAPI::with_config(configuration); let resp = api .update_public_dashboard(shared_dashboard_token.clone(), body) diff --git a/examples/v1_downtimes_cancel_downtime.rs b/examples/v1_downtimes_cancel_downtime.rs index 42f3647d3..521833cda 100644 --- a/examples/v1_downtimes_cancel_downtime.rs +++ b/examples/v1_downtimes_cancel_downtime.rs @@ -1,12 +1,12 @@ // Cancel a downtime returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_downtimes::DowntimesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_downtimes::DowntimesAPI; #[tokio::main] async fn main() { // there is a valid "downtime" in the system let downtime_id: i64 = std::env::var("DOWNTIME_ID").unwrap().parse().unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DowntimesAPI::with_config(configuration); let resp = api.cancel_downtime(downtime_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v1_downtimes_cancel_downtimes_by_scope.rs b/examples/v1_downtimes_cancel_downtimes_by_scope.rs index bcf6882f8..e6ba9afa7 100644 --- a/examples/v1_downtimes_cancel_downtimes_by_scope.rs +++ b/examples/v1_downtimes_cancel_downtimes_by_scope.rs @@ -1,6 +1,6 @@ // Cancel downtimes by scope returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_downtimes::DowntimesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_downtimes::DowntimesAPI; use datadog_api_client::datadogV1::model::CancelDowntimesByScopeRequest; #[tokio::main] @@ -8,7 +8,7 @@ async fn main() { // there is a valid "downtime" in the system let downtime_scope_0 = std::env::var("DOWNTIME_SCOPE_0").unwrap(); let body = CancelDowntimesByScopeRequest::new(downtime_scope_0.clone()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DowntimesAPI::with_config(configuration); let resp = api.cancel_downtimes_by_scope(body).await; if let Ok(value) = resp { diff --git a/examples/v1_downtimes_create_downtime.rs b/examples/v1_downtimes_create_downtime.rs index be0a585b8..a53e11176 100644 --- a/examples/v1_downtimes_create_downtime.rs +++ b/examples/v1_downtimes_create_downtime.rs @@ -1,6 +1,6 @@ // Schedule a downtime returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_downtimes::DowntimesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_downtimes::DowntimesAPI; use datadog_api_client::datadogV1::model::Downtime; use datadog_api_client::datadogV1::model::DowntimeRecurrence; use datadog_api_client::datadogV1::model::NotifyEndState; @@ -33,7 +33,7 @@ async fn main() { .scope(vec!["test:exampledowntime".to_string()]) .start(1636629071) .timezone("Etc/UTC".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DowntimesAPI::with_config(configuration); let resp = api.create_downtime(body).await; if let Ok(value) = resp { diff --git a/examples/v1_downtimes_create_downtime_1393233946.rs b/examples/v1_downtimes_create_downtime_1393233946.rs index 9d91b7604..ada054a0b 100644 --- a/examples/v1_downtimes_create_downtime_1393233946.rs +++ b/examples/v1_downtimes_create_downtime_1393233946.rs @@ -1,6 +1,6 @@ // Schedule a downtime with until occurrences -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_downtimes::DowntimesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_downtimes::DowntimesAPI; use datadog_api_client::datadogV1::model::Downtime; use datadog_api_client::datadogV1::model::DowntimeRecurrence; @@ -26,7 +26,7 @@ async fn main() { .scope(vec!["*".to_string()]) .start(1636629071) .timezone("Etc/UTC".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DowntimesAPI::with_config(configuration); let resp = api.create_downtime(body).await; if let Ok(value) = resp { diff --git a/examples/v1_downtimes_create_downtime_2908359488.rs b/examples/v1_downtimes_create_downtime_2908359488.rs index 4e7af28fa..978d9de97 100644 --- a/examples/v1_downtimes_create_downtime_2908359488.rs +++ b/examples/v1_downtimes_create_downtime_2908359488.rs @@ -1,6 +1,6 @@ // Schedule a downtime until date -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_downtimes::DowntimesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_downtimes::DowntimesAPI; use datadog_api_client::datadogV1::model::Downtime; use datadog_api_client::datadogV1::model::DowntimeRecurrence; use datadog_api_client::datadogV1::model::NotifyEndState; @@ -31,7 +31,7 @@ async fn main() { .scope(vec!["*".to_string()]) .start(1636629071) .timezone("Etc/UTC".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DowntimesAPI::with_config(configuration); let resp = api.create_downtime(body).await; if let Ok(value) = resp { diff --git a/examples/v1_downtimes_create_downtime_3059354445.rs b/examples/v1_downtimes_create_downtime_3059354445.rs index b4f58c619..d64702845 100644 --- a/examples/v1_downtimes_create_downtime_3059354445.rs +++ b/examples/v1_downtimes_create_downtime_3059354445.rs @@ -1,6 +1,6 @@ // Schedule a downtime once a year -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_downtimes::DowntimesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_downtimes::DowntimesAPI; use datadog_api_client::datadogV1::model::Downtime; use datadog_api_client::datadogV1::model::DowntimeRecurrence; use datadog_api_client::datadogV1::model::NotifyEndState; @@ -23,7 +23,7 @@ async fn main() { .scope(vec!["*".to_string()]) .start(1636629071) .timezone("Etc/UTC".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DowntimesAPI::with_config(configuration); let resp = api.create_downtime(body).await; if let Ok(value) = resp { diff --git a/examples/v1_downtimes_create_downtime_3355644446.rs b/examples/v1_downtimes_create_downtime_3355644446.rs index 2eebf0d87..d4f6d91e8 100644 --- a/examples/v1_downtimes_create_downtime_3355644446.rs +++ b/examples/v1_downtimes_create_downtime_3355644446.rs @@ -1,6 +1,6 @@ // Schedule a monitor downtime returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_downtimes::DowntimesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_downtimes::DowntimesAPI; use datadog_api_client::datadogV1::model::Downtime; #[tokio::main] @@ -13,7 +13,7 @@ async fn main() { .scope(vec!["test:exampledowntime".to_string()]) .start(1636629071) .timezone("Etc/UTC".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DowntimesAPI::with_config(configuration); let resp = api.create_downtime(body).await; if let Ok(value) = resp { diff --git a/examples/v1_downtimes_get_downtime.rs b/examples/v1_downtimes_get_downtime.rs index 6b100c326..018520b79 100644 --- a/examples/v1_downtimes_get_downtime.rs +++ b/examples/v1_downtimes_get_downtime.rs @@ -1,12 +1,12 @@ // Get a downtime returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_downtimes::DowntimesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_downtimes::DowntimesAPI; #[tokio::main] async fn main() { // there is a valid "downtime" in the system let downtime_id: i64 = std::env::var("DOWNTIME_ID").unwrap().parse().unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DowntimesAPI::with_config(configuration); let resp = api.get_downtime(downtime_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v1_downtimes_list_downtimes.rs b/examples/v1_downtimes_list_downtimes.rs index 8f4b9f543..d8da8d5c0 100644 --- a/examples/v1_downtimes_list_downtimes.rs +++ b/examples/v1_downtimes_list_downtimes.rs @@ -1,11 +1,11 @@ // Get all downtimes returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_downtimes::DowntimesAPI; -use datadog_api_client::datadogV1::api::api_downtimes::ListDowntimesOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_downtimes::DowntimesAPI; +use datadog_api_client::datadogV1::api_downtimes::ListDowntimesOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DowntimesAPI::with_config(configuration); let resp = api .list_downtimes(ListDowntimesOptionalParams::default().with_creator(true)) diff --git a/examples/v1_downtimes_list_monitor_downtimes.rs b/examples/v1_downtimes_list_monitor_downtimes.rs index 3f417ea95..0fa9c1081 100644 --- a/examples/v1_downtimes_list_monitor_downtimes.rs +++ b/examples/v1_downtimes_list_monitor_downtimes.rs @@ -1,10 +1,10 @@ // Get active downtimes for a monitor returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_downtimes::DowntimesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_downtimes::DowntimesAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DowntimesAPI::with_config(configuration); let resp = api.list_monitor_downtimes(9223372036854775807).await; if let Ok(value) = resp { diff --git a/examples/v1_downtimes_update_downtime.rs b/examples/v1_downtimes_update_downtime.rs index 44b475c72..5f4f72fd9 100644 --- a/examples/v1_downtimes_update_downtime.rs +++ b/examples/v1_downtimes_update_downtime.rs @@ -1,6 +1,6 @@ // Update a downtime returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_downtimes::DowntimesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_downtimes::DowntimesAPI; use datadog_api_client::datadogV1::model::Downtime; use datadog_api_client::datadogV1::model::NotifyEndState; use datadog_api_client::datadogV1::model::NotifyEndType; @@ -18,7 +18,7 @@ async fn main() { NotifyEndState::WARN, ]) .notify_end_types(vec![NotifyEndType::CANCELED, NotifyEndType::EXPIRED]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DowntimesAPI::with_config(configuration); let resp = api.update_downtime(downtime_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v1_events_create_event.rs b/examples/v1_events_create_event.rs index d6cb32e28..8990925c4 100644 --- a/examples/v1_events_create_event.rs +++ b/examples/v1_events_create_event.rs @@ -1,13 +1,13 @@ // Post an event returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_events::EventsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_events::EventsAPI; use datadog_api_client::datadogV1::model::EventCreateRequest; #[tokio::main] async fn main() { let body = EventCreateRequest::new("A text message.".to_string(), "Example-Event".to_string()) .tags(vec!["test:ExampleEvent".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = EventsAPI::with_config(configuration); let resp = api.create_event(body).await; if let Ok(value) = resp { diff --git a/examples/v1_events_create_event_19927815.rs b/examples/v1_events_create_event_19927815.rs index 178123939..90cb07203 100644 --- a/examples/v1_events_create_event_19927815.rs +++ b/examples/v1_events_create_event_19927815.rs @@ -1,6 +1,6 @@ // Post an event with a long title returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_events::EventsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_events::EventsAPI; use datadog_api_client::datadogV1::model::EventCreateRequest; #[tokio::main] @@ -10,7 +10,7 @@ async fn main() { "A text message.".to_string(), "Example-Event very very very looooooooong looooooooooooong loooooooooooooooooooooong looooooooooooooooooooooooooong title with 100+ characters".to_string(), ).tags(vec!["test:ExampleEvent".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = EventsAPI::with_config(configuration); let resp = api.create_event(body).await; if let Ok(value) = resp { diff --git a/examples/v1_events_get_event.rs b/examples/v1_events_get_event.rs index 4fc57a748..fc44d5a77 100644 --- a/examples/v1_events_get_event.rs +++ b/examples/v1_events_get_event.rs @@ -1,10 +1,10 @@ // Get an event returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_events::EventsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_events::EventsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = EventsAPI::with_config(configuration); let resp = api.get_event(9223372036854775807).await; if let Ok(value) = resp { diff --git a/examples/v1_events_list_events.rs b/examples/v1_events_list_events.rs index 2ace824e6..37906e400 100644 --- a/examples/v1_events_list_events.rs +++ b/examples/v1_events_list_events.rs @@ -1,11 +1,11 @@ // Get a list of events returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_events::EventsAPI; -use datadog_api_client::datadogV1::api::api_events::ListEventsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_events::EventsAPI; +use datadog_api_client::datadogV1::api_events::ListEventsOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = EventsAPI::with_config(configuration); let resp = api .list_events( diff --git a/examples/v1_gcp-integration_create_gcp_integration.rs b/examples/v1_gcp-integration_create_gcp_integration.rs index 654780ad7..699684060 100644 --- a/examples/v1_gcp-integration_create_gcp_integration.rs +++ b/examples/v1_gcp-integration_create_gcp_integration.rs @@ -1,6 +1,6 @@ // Create a GCP integration returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_gcp_integration::GCPIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_gcp_integration::GCPIntegrationAPI; use datadog_api_client::datadogV1::model::GCPAccount; #[tokio::main] @@ -23,7 +23,7 @@ async fn main() { .resource_collection_enabled(true) .token_uri("https://accounts.google.com/o/oauth2/token".to_string()) .type_("service_account".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = GCPIntegrationAPI::with_config(configuration); let resp = api.create_gcp_integration(body).await; if let Ok(value) = resp { diff --git a/examples/v1_gcp-integration_delete_gcp_integration.rs b/examples/v1_gcp-integration_delete_gcp_integration.rs index 5084954fa..88ad156a6 100644 --- a/examples/v1_gcp-integration_delete_gcp_integration.rs +++ b/examples/v1_gcp-integration_delete_gcp_integration.rs @@ -1,6 +1,6 @@ // Delete a GCP integration returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_gcp_integration::GCPIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_gcp_integration::GCPIntegrationAPI; use datadog_api_client::datadogV1::model::GCPAccount; #[tokio::main] @@ -9,7 +9,7 @@ async fn main() { .client_email("252bf553ef04b351@example.com".to_string()) .client_id("163662907116366290710".to_string()) .project_id("datadog-apitest".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = GCPIntegrationAPI::with_config(configuration); let resp = api.delete_gcp_integration(body).await; if let Ok(value) = resp { diff --git a/examples/v1_gcp-integration_list_gcp_integration.rs b/examples/v1_gcp-integration_list_gcp_integration.rs index 9c5c37b69..10cfffe27 100644 --- a/examples/v1_gcp-integration_list_gcp_integration.rs +++ b/examples/v1_gcp-integration_list_gcp_integration.rs @@ -1,10 +1,10 @@ // List all GCP integrations returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_gcp_integration::GCPIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_gcp_integration::GCPIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = GCPIntegrationAPI::with_config(configuration); let resp = api.list_gcp_integration().await; if let Ok(value) = resp { diff --git a/examples/v1_gcp-integration_update_gcp_integration.rs b/examples/v1_gcp-integration_update_gcp_integration.rs index 21430bf45..6b13eaed4 100644 --- a/examples/v1_gcp-integration_update_gcp_integration.rs +++ b/examples/v1_gcp-integration_update_gcp_integration.rs @@ -1,6 +1,6 @@ // Update a GCP integration returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_gcp_integration::GCPIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_gcp_integration::GCPIntegrationAPI; use datadog_api_client::datadogV1::model::GCPAccount; #[tokio::main] @@ -22,7 +22,7 @@ async fn main() { .resource_collection_enabled(true) .token_uri("https://accounts.google.com/o/oauth2/token".to_string()) .type_("service_account".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = GCPIntegrationAPI::with_config(configuration); let resp = api.update_gcp_integration(body).await; if let Ok(value) = resp { diff --git a/examples/v1_gcp-integration_update_gcp_integration_3544259255.rs b/examples/v1_gcp-integration_update_gcp_integration_3544259255.rs index 1b275c7b0..a3cda4133 100644 --- a/examples/v1_gcp-integration_update_gcp_integration_3544259255.rs +++ b/examples/v1_gcp-integration_update_gcp_integration_3544259255.rs @@ -1,6 +1,6 @@ // Update a GCP integration cloud run revision filters returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_gcp_integration::GCPIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_gcp_integration::GCPIntegrationAPI; use datadog_api_client::datadogV1::model::GCPAccount; #[tokio::main] @@ -23,7 +23,7 @@ async fn main() { .resource_collection_enabled(true) .token_uri("https://accounts.google.com/o/oauth2/token".to_string()) .type_("service_account".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = GCPIntegrationAPI::with_config(configuration); let resp = api.update_gcp_integration(body).await; if let Ok(value) = resp { diff --git a/examples/v1_hosts_get_host_totals.rs b/examples/v1_hosts_get_host_totals.rs index 91ac26c15..da424b46b 100644 --- a/examples/v1_hosts_get_host_totals.rs +++ b/examples/v1_hosts_get_host_totals.rs @@ -1,11 +1,11 @@ // Get the total number of active hosts returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_hosts::GetHostTotalsOptionalParams; -use datadog_api_client::datadogV1::api::api_hosts::HostsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_hosts::GetHostTotalsOptionalParams; +use datadog_api_client::datadogV1::api_hosts::HostsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = HostsAPI::with_config(configuration); let resp = api .get_host_totals(GetHostTotalsOptionalParams::default()) diff --git a/examples/v1_hosts_list_hosts.rs b/examples/v1_hosts_list_hosts.rs index bbb90bd5c..7fb7fbe7d 100644 --- a/examples/v1_hosts_list_hosts.rs +++ b/examples/v1_hosts_list_hosts.rs @@ -1,11 +1,11 @@ // Get all hosts for your organization returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_hosts::HostsAPI; -use datadog_api_client::datadogV1::api::api_hosts::ListHostsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_hosts::HostsAPI; +use datadog_api_client::datadogV1::api_hosts::ListHostsOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = HostsAPI::with_config(configuration); let resp = api .list_hosts(ListHostsOptionalParams::default().filter("env:ci".to_string())) diff --git a/examples/v1_hosts_list_hosts_2975406675.rs b/examples/v1_hosts_list_hosts_2975406675.rs index 11d7350d9..64157d99e 100644 --- a/examples/v1_hosts_list_hosts_2975406675.rs +++ b/examples/v1_hosts_list_hosts_2975406675.rs @@ -1,11 +1,11 @@ // Get all hosts with metadata for your organization returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_hosts::HostsAPI; -use datadog_api_client::datadogV1::api::api_hosts::ListHostsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_hosts::HostsAPI; +use datadog_api_client::datadogV1::api_hosts::ListHostsOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = HostsAPI::with_config(configuration); let resp = api .list_hosts(ListHostsOptionalParams::default().include_hosts_metadata(true)) diff --git a/examples/v1_hosts_list_hosts_347346033.rs b/examples/v1_hosts_list_hosts_347346033.rs index 9d96aa238..e13337228 100644 --- a/examples/v1_hosts_list_hosts_347346033.rs +++ b/examples/v1_hosts_list_hosts_347346033.rs @@ -1,11 +1,11 @@ // Get all hosts with metadata deserializes successfully -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_hosts::HostsAPI; -use datadog_api_client::datadogV1::api::api_hosts::ListHostsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_hosts::HostsAPI; +use datadog_api_client::datadogV1::api_hosts::ListHostsOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = HostsAPI::with_config(configuration); let resp = api .list_hosts(ListHostsOptionalParams::default().include_hosts_metadata(true)) diff --git a/examples/v1_hosts_mute_host.rs b/examples/v1_hosts_mute_host.rs index 2bd5ba494..0fc703066 100644 --- a/examples/v1_hosts_mute_host.rs +++ b/examples/v1_hosts_mute_host.rs @@ -1,6 +1,6 @@ // Mute a host returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_hosts::HostsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_hosts::HostsAPI; use datadog_api_client::datadogV1::model::HostMuteSettings; #[tokio::main] @@ -9,7 +9,7 @@ async fn main() { .end(1579098130) .message("Muting this host for a test!".to_string()) .override_(false); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = HostsAPI::with_config(configuration); let resp = api.mute_host("host_name".to_string(), body).await; if let Ok(value) = resp { diff --git a/examples/v1_hosts_unmute_host.rs b/examples/v1_hosts_unmute_host.rs index 0053cbaaa..cc4b2eef9 100644 --- a/examples/v1_hosts_unmute_host.rs +++ b/examples/v1_hosts_unmute_host.rs @@ -1,10 +1,10 @@ // Unmute a host returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_hosts::HostsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_hosts::HostsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = HostsAPI::with_config(configuration); let resp = api.unmute_host("host_name".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_ip-ranges_get_ip_ranges.rs b/examples/v1_ip-ranges_get_ip_ranges.rs index ea9b2da90..ccfede3b2 100644 --- a/examples/v1_ip-ranges_get_ip_ranges.rs +++ b/examples/v1_ip-ranges_get_ip_ranges.rs @@ -1,10 +1,10 @@ // List IP Ranges returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_ip_ranges::IPRangesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_ip_ranges::IPRangesAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = IPRangesAPI::with_config(configuration); let resp = api.get_ip_ranges().await; if let Ok(value) = resp { diff --git a/examples/v1_key-management_create_api_key.rs b/examples/v1_key-management_create_api_key.rs index c9ca3b076..92dae9cdd 100644 --- a/examples/v1_key-management_create_api_key.rs +++ b/examples/v1_key-management_create_api_key.rs @@ -1,12 +1,12 @@ // Create an API key returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_key_management::KeyManagementAPI; use datadog_api_client::datadogV1::model::ApiKey; #[tokio::main] async fn main() { let body = ApiKey::new().name("example user".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api.create_api_key(body).await; if let Ok(value) = resp { diff --git a/examples/v1_key-management_create_application_key.rs b/examples/v1_key-management_create_application_key.rs index 6405b55d9..35fb821f0 100644 --- a/examples/v1_key-management_create_application_key.rs +++ b/examples/v1_key-management_create_application_key.rs @@ -1,12 +1,12 @@ // Create an application key returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_key_management::KeyManagementAPI; use datadog_api_client::datadogV1::model::ApplicationKey; #[tokio::main] async fn main() { let body = ApplicationKey::new().name("example user".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api.create_application_key(body).await; if let Ok(value) = resp { diff --git a/examples/v1_key-management_delete_api_key.rs b/examples/v1_key-management_delete_api_key.rs index 872dc383b..9b6d0fcb8 100644 --- a/examples/v1_key-management_delete_api_key.rs +++ b/examples/v1_key-management_delete_api_key.rs @@ -1,10 +1,10 @@ // Delete an API key returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_key_management::KeyManagementAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api.delete_api_key("key".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_key-management_delete_application_key.rs b/examples/v1_key-management_delete_application_key.rs index 5e8caf196..4993408f5 100644 --- a/examples/v1_key-management_delete_application_key.rs +++ b/examples/v1_key-management_delete_application_key.rs @@ -1,10 +1,10 @@ // Delete an application key returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_key_management::KeyManagementAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api.delete_application_key("key".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_key-management_get_api_key.rs b/examples/v1_key-management_get_api_key.rs index 1baa4efd1..67b6b6820 100644 --- a/examples/v1_key-management_get_api_key.rs +++ b/examples/v1_key-management_get_api_key.rs @@ -1,10 +1,10 @@ // Get API key returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_key_management::KeyManagementAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api.get_api_key("key".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_key-management_get_application_key.rs b/examples/v1_key-management_get_application_key.rs index 3ae7e0f3e..66b710337 100644 --- a/examples/v1_key-management_get_application_key.rs +++ b/examples/v1_key-management_get_application_key.rs @@ -1,10 +1,10 @@ // Get an application key returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_key_management::KeyManagementAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api.get_application_key("key".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_key-management_list_api_keys.rs b/examples/v1_key-management_list_api_keys.rs index b3d0baaea..d0ac1a36d 100644 --- a/examples/v1_key-management_list_api_keys.rs +++ b/examples/v1_key-management_list_api_keys.rs @@ -1,10 +1,10 @@ // Get all API keys returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_key_management::KeyManagementAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api.list_api_keys().await; if let Ok(value) = resp { diff --git a/examples/v1_key-management_list_application_keys.rs b/examples/v1_key-management_list_application_keys.rs index 2eeace2c5..b5251f863 100644 --- a/examples/v1_key-management_list_application_keys.rs +++ b/examples/v1_key-management_list_application_keys.rs @@ -1,10 +1,10 @@ // Get all application keys returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_key_management::KeyManagementAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api.list_application_keys().await; if let Ok(value) = resp { diff --git a/examples/v1_key-management_update_api_key.rs b/examples/v1_key-management_update_api_key.rs index 6a1c69467..6e9c2d393 100644 --- a/examples/v1_key-management_update_api_key.rs +++ b/examples/v1_key-management_update_api_key.rs @@ -1,12 +1,12 @@ // Edit an API key returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_key_management::KeyManagementAPI; use datadog_api_client::datadogV1::model::ApiKey; #[tokio::main] async fn main() { let body = ApiKey::new().name("example user".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api.update_api_key("key".to_string(), body).await; if let Ok(value) = resp { diff --git a/examples/v1_key-management_update_application_key.rs b/examples/v1_key-management_update_application_key.rs index 872e6291b..aaeb5d259 100644 --- a/examples/v1_key-management_update_application_key.rs +++ b/examples/v1_key-management_update_application_key.rs @@ -1,12 +1,12 @@ // Edit an application key returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_key_management::KeyManagementAPI; use datadog_api_client::datadogV1::model::ApplicationKey; #[tokio::main] async fn main() { let body = ApplicationKey::new().name("example user".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api.update_application_key("key".to_string(), body).await; if let Ok(value) = resp { diff --git a/examples/v1_logs-indexes_create_logs_index.rs b/examples/v1_logs-indexes_create_logs_index.rs index d67fba805..3e8e69e69 100644 --- a/examples/v1_logs-indexes_create_logs_index.rs +++ b/examples/v1_logs-indexes_create_logs_index.rs @@ -1,6 +1,6 @@ // Create an index returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_logs_indexes::LogsIndexesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_logs_indexes::LogsIndexesAPI; use datadog_api_client::datadogV1::model::LogsDailyLimitReset; use datadog_api_client::datadogV1::model::LogsExclusion; use datadog_api_client::datadogV1::model::LogsExclusionFilter; @@ -23,7 +23,7 @@ async fn main() { .exclusion_filters(vec![LogsExclusion::new("payment".to_string()) .filter(LogsExclusionFilter::new(1.0).query("*".to_string()))]) .num_retention_days(15); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsIndexesAPI::with_config(configuration); let resp = api.create_logs_index(body).await; if let Ok(value) = resp { diff --git a/examples/v1_logs-indexes_get_logs_index.rs b/examples/v1_logs-indexes_get_logs_index.rs index 9be9b4db1..9ff5bda99 100644 --- a/examples/v1_logs-indexes_get_logs_index.rs +++ b/examples/v1_logs-indexes_get_logs_index.rs @@ -1,10 +1,10 @@ // Get an index returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_logs_indexes::LogsIndexesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_logs_indexes::LogsIndexesAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsIndexesAPI::with_config(configuration); let resp = api.get_logs_index("name".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_logs-indexes_get_logs_index_order.rs b/examples/v1_logs-indexes_get_logs_index_order.rs index f6bbd26fa..f66f0c5df 100644 --- a/examples/v1_logs-indexes_get_logs_index_order.rs +++ b/examples/v1_logs-indexes_get_logs_index_order.rs @@ -1,10 +1,10 @@ // Get indexes order returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_logs_indexes::LogsIndexesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_logs_indexes::LogsIndexesAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsIndexesAPI::with_config(configuration); let resp = api.get_logs_index_order().await; if let Ok(value) = resp { diff --git a/examples/v1_logs-indexes_list_log_indexes.rs b/examples/v1_logs-indexes_list_log_indexes.rs index f64e649af..399a6ebba 100644 --- a/examples/v1_logs-indexes_list_log_indexes.rs +++ b/examples/v1_logs-indexes_list_log_indexes.rs @@ -1,10 +1,10 @@ // Get all indexes returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_logs_indexes::LogsIndexesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_logs_indexes::LogsIndexesAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsIndexesAPI::with_config(configuration); let resp = api.list_log_indexes().await; if let Ok(value) = resp { diff --git a/examples/v1_logs-indexes_update_logs_index.rs b/examples/v1_logs-indexes_update_logs_index.rs index 28262d510..25056a90c 100644 --- a/examples/v1_logs-indexes_update_logs_index.rs +++ b/examples/v1_logs-indexes_update_logs_index.rs @@ -1,6 +1,6 @@ // Update an index returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_logs_indexes::LogsIndexesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_logs_indexes::LogsIndexesAPI; use datadog_api_client::datadogV1::model::LogsDailyLimitReset; use datadog_api_client::datadogV1::model::LogsExclusion; use datadog_api_client::datadogV1::model::LogsExclusionFilter; @@ -21,7 +21,7 @@ async fn main() { .exclusion_filters(vec![LogsExclusion::new("payment".to_string()) .filter(LogsExclusionFilter::new(1.0).query("*".to_string()))]) .num_retention_days(15); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsIndexesAPI::with_config(configuration); let resp = api.update_logs_index("name".to_string(), body).await; if let Ok(value) = resp { diff --git a/examples/v1_logs-indexes_update_logs_index_order.rs b/examples/v1_logs-indexes_update_logs_index_order.rs index b69fbaa11..5ae52a1e7 100644 --- a/examples/v1_logs-indexes_update_logs_index_order.rs +++ b/examples/v1_logs-indexes_update_logs_index_order.rs @@ -1,6 +1,6 @@ // Update indexes order returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_logs_indexes::LogsIndexesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_logs_indexes::LogsIndexesAPI; use datadog_api_client::datadogV1::model::LogsIndexesOrder; #[tokio::main] @@ -10,7 +10,7 @@ async fn main() { "payments".to_string(), "web".to_string(), ]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsIndexesAPI::with_config(configuration); let resp = api.update_logs_index_order(body).await; if let Ok(value) = resp { diff --git a/examples/v1_logs-pipelines_create_logs_pipeline.rs b/examples/v1_logs-pipelines_create_logs_pipeline.rs index 92c605d46..98fbbb202 100644 --- a/examples/v1_logs-pipelines_create_logs_pipeline.rs +++ b/examples/v1_logs-pipelines_create_logs_pipeline.rs @@ -1,6 +1,6 @@ // Create a pipeline returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_logs_pipelines::LogsPipelinesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_logs_pipelines::LogsPipelinesAPI; use datadog_api_client::datadogV1::model::LogsFilter; use datadog_api_client::datadogV1::model::LogsGrokParser; use datadog_api_client::datadogV1::model::LogsGrokParserRules; @@ -32,7 +32,7 @@ rule_name_2 bar .is_enabled(false) .samples(vec![]), ))]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsPipelinesAPI::with_config(configuration); let resp = api.create_logs_pipeline(body).await; if let Ok(value) = resp { diff --git a/examples/v1_logs-pipelines_delete_logs_pipeline.rs b/examples/v1_logs-pipelines_delete_logs_pipeline.rs index 0a9cfe48f..fec2ea28c 100644 --- a/examples/v1_logs-pipelines_delete_logs_pipeline.rs +++ b/examples/v1_logs-pipelines_delete_logs_pipeline.rs @@ -1,10 +1,10 @@ // Delete a pipeline returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_logs_pipelines::LogsPipelinesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_logs_pipelines::LogsPipelinesAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsPipelinesAPI::with_config(configuration); let resp = api.delete_logs_pipeline("pipeline_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_logs-pipelines_get_logs_pipeline.rs b/examples/v1_logs-pipelines_get_logs_pipeline.rs index 123c3ccab..f30810574 100644 --- a/examples/v1_logs-pipelines_get_logs_pipeline.rs +++ b/examples/v1_logs-pipelines_get_logs_pipeline.rs @@ -1,10 +1,10 @@ // Get a pipeline returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_logs_pipelines::LogsPipelinesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_logs_pipelines::LogsPipelinesAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsPipelinesAPI::with_config(configuration); let resp = api.get_logs_pipeline("pipeline_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_logs-pipelines_get_logs_pipeline_order.rs b/examples/v1_logs-pipelines_get_logs_pipeline_order.rs index 4b3f1af7d..da3017678 100644 --- a/examples/v1_logs-pipelines_get_logs_pipeline_order.rs +++ b/examples/v1_logs-pipelines_get_logs_pipeline_order.rs @@ -1,10 +1,10 @@ // Get pipeline order returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_logs_pipelines::LogsPipelinesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_logs_pipelines::LogsPipelinesAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsPipelinesAPI::with_config(configuration); let resp = api.get_logs_pipeline_order().await; if let Ok(value) = resp { diff --git a/examples/v1_logs-pipelines_list_logs_pipelines.rs b/examples/v1_logs-pipelines_list_logs_pipelines.rs index e3f8a87ba..a17be2394 100644 --- a/examples/v1_logs-pipelines_list_logs_pipelines.rs +++ b/examples/v1_logs-pipelines_list_logs_pipelines.rs @@ -1,10 +1,10 @@ // Get all pipelines returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_logs_pipelines::LogsPipelinesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_logs_pipelines::LogsPipelinesAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsPipelinesAPI::with_config(configuration); let resp = api.list_logs_pipelines().await; if let Ok(value) = resp { diff --git a/examples/v1_logs-pipelines_update_logs_pipeline.rs b/examples/v1_logs-pipelines_update_logs_pipeline.rs index 02a6b0c78..2fd0a816a 100644 --- a/examples/v1_logs-pipelines_update_logs_pipeline.rs +++ b/examples/v1_logs-pipelines_update_logs_pipeline.rs @@ -1,6 +1,6 @@ // Update a pipeline returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_logs_pipelines::LogsPipelinesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_logs_pipelines::LogsPipelinesAPI; use datadog_api_client::datadogV1::model::LogsFilter; use datadog_api_client::datadogV1::model::LogsGrokParser; use datadog_api_client::datadogV1::model::LogsGrokParserRules; @@ -32,7 +32,7 @@ rule_name_2 bar .is_enabled(false) .samples(vec![]), ))]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsPipelinesAPI::with_config(configuration); let resp = api .update_logs_pipeline("pipeline_id".to_string(), body) diff --git a/examples/v1_logs-pipelines_update_logs_pipeline_order.rs b/examples/v1_logs-pipelines_update_logs_pipeline_order.rs index a64c2f9e6..cf9c601d9 100644 --- a/examples/v1_logs-pipelines_update_logs_pipeline_order.rs +++ b/examples/v1_logs-pipelines_update_logs_pipeline_order.rs @@ -1,6 +1,6 @@ // Update pipeline order returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_logs_pipelines::LogsPipelinesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_logs_pipelines::LogsPipelinesAPI; use datadog_api_client::datadogV1::model::LogsPipelinesOrder; #[tokio::main] @@ -10,7 +10,7 @@ async fn main() { "org_ids".to_string(), "products".to_string(), ]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsPipelinesAPI::with_config(configuration); let resp = api.update_logs_pipeline_order(body).await; if let Ok(value) = resp { diff --git a/examples/v1_logs_list_logs.rs b/examples/v1_logs_list_logs.rs index 47a2e98d7..f34a5fbed 100644 --- a/examples/v1_logs_list_logs.rs +++ b/examples/v1_logs_list_logs.rs @@ -1,6 +1,6 @@ // Search logs returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_logs::LogsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_logs::LogsAPI; use datadog_api_client::datadogV1::model::LogsListRequest; use datadog_api_client::datadogV1::model::LogsListRequestTime; use datadog_api_client::datadogV1::model::LogsSort; @@ -14,7 +14,7 @@ async fn main() { .index("retention-3,retention-15".to_string()) .query("service:web* AND @http.status_code:[200 TO 299]".to_string()) .sort(LogsSort::TIME_ASCENDING); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsAPI::with_config(configuration); let resp = api.list_logs(body).await; if let Ok(value) = resp { diff --git a/examples/v1_logs_list_logs_235998668.rs b/examples/v1_logs_list_logs_235998668.rs index 180f2ca47..24a2a1ca8 100644 --- a/examples/v1_logs_list_logs_235998668.rs +++ b/examples/v1_logs_list_logs_235998668.rs @@ -1,6 +1,6 @@ // Search test logs returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_logs::LogsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_logs::LogsAPI; use datadog_api_client::datadogV1::model::LogsListRequest; use datadog_api_client::datadogV1::model::LogsListRequestTime; use datadog_api_client::datadogV1::model::LogsSort; @@ -17,7 +17,7 @@ async fn main() { .index("main".to_string()) .query("host:Test*".to_string()) .sort(LogsSort::TIME_ASCENDING); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsAPI::with_config(configuration); let resp = api.list_logs(body).await; if let Ok(value) = resp { diff --git a/examples/v1_logs_submit_log.rs b/examples/v1_logs_submit_log.rs index f5eccea6a..8b9c8a63c 100644 --- a/examples/v1_logs_submit_log.rs +++ b/examples/v1_logs_submit_log.rs @@ -1,7 +1,7 @@ // Send logs returns "Response from server (always 200 empty JSON)." response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_logs::LogsAPI; -use datadog_api_client::datadogV1::api::api_logs::SubmitLogOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_logs::LogsAPI; +use datadog_api_client::datadogV1::api_logs::SubmitLogOptionalParams; use datadog_api_client::datadogV1::model::HTTPLogItem; use std::collections::BTreeMap; @@ -10,7 +10,7 @@ async fn main() { let body = vec![HTTPLogItem::new("Example-Log".to_string()) .ddtags("host:ExampleLog".to_string()) .additional_properties(BTreeMap::from([]))]; - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsAPI::with_config(configuration); let resp = api .submit_log(body, SubmitLogOptionalParams::default()) diff --git a/examples/v1_logs_submit_log_1920474053.rs b/examples/v1_logs_submit_log_1920474053.rs index 14bfd71d8..1bf7be72e 100644 --- a/examples/v1_logs_submit_log_1920474053.rs +++ b/examples/v1_logs_submit_log_1920474053.rs @@ -1,7 +1,7 @@ // Send gzip logs returns "Response from server (always 200 empty JSON)." response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_logs::LogsAPI; -use datadog_api_client::datadogV1::api::api_logs::SubmitLogOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_logs::LogsAPI; +use datadog_api_client::datadogV1::api_logs::SubmitLogOptionalParams; use datadog_api_client::datadogV1::model::ContentEncoding; use datadog_api_client::datadogV1::model::HTTPLogItem; use std::collections::BTreeMap; @@ -11,7 +11,7 @@ async fn main() { let body = vec![HTTPLogItem::new("Example-Log".to_string()) .ddtags("host:ExampleLog".to_string()) .additional_properties(BTreeMap::from([]))]; - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsAPI::with_config(configuration); let resp = api .submit_log( diff --git a/examples/v1_logs_submit_log_3418823904.rs b/examples/v1_logs_submit_log_3418823904.rs index 5641aa1de..ed30101e1 100644 --- a/examples/v1_logs_submit_log_3418823904.rs +++ b/examples/v1_logs_submit_log_3418823904.rs @@ -1,8 +1,8 @@ // Send deflate logs returns "Response from server (always 200 empty JSON)." // response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_logs::LogsAPI; -use datadog_api_client::datadogV1::api::api_logs::SubmitLogOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_logs::LogsAPI; +use datadog_api_client::datadogV1::api_logs::SubmitLogOptionalParams; use datadog_api_client::datadogV1::model::ContentEncoding; use datadog_api_client::datadogV1::model::HTTPLogItem; use std::collections::BTreeMap; @@ -12,7 +12,7 @@ async fn main() { let body = vec![HTTPLogItem::new("Example-Log".to_string()) .ddtags("host:ExampleLog".to_string()) .additional_properties(BTreeMap::from([]))]; - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsAPI::with_config(configuration); let resp = api .submit_log( diff --git a/examples/v1_metrics_get_metric_metadata.rs b/examples/v1_metrics_get_metric_metadata.rs index 8170dce03..8a9a7eae6 100644 --- a/examples/v1_metrics_get_metric_metadata.rs +++ b/examples/v1_metrics_get_metric_metadata.rs @@ -1,10 +1,10 @@ // Get metric metadata returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_metrics::MetricsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api.get_metric_metadata("metric_name".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_metrics_list_active_metrics.rs b/examples/v1_metrics_list_active_metrics.rs index da1ef8db3..70f63d047 100644 --- a/examples/v1_metrics_list_active_metrics.rs +++ b/examples/v1_metrics_list_active_metrics.rs @@ -1,11 +1,11 @@ // Get active metrics list returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_metrics::ListActiveMetricsOptionalParams; -use datadog_api_client::datadogV1::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_metrics::ListActiveMetricsOptionalParams; +use datadog_api_client::datadogV1::api_metrics::MetricsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api .list_active_metrics( diff --git a/examples/v1_metrics_list_metrics.rs b/examples/v1_metrics_list_metrics.rs index 79280468a..6d825448a 100644 --- a/examples/v1_metrics_list_metrics.rs +++ b/examples/v1_metrics_list_metrics.rs @@ -1,10 +1,10 @@ // Search metrics returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_metrics::MetricsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api.list_metrics("q".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_metrics_query_metrics.rs b/examples/v1_metrics_query_metrics.rs index 12c38b2f8..6bbb0f547 100644 --- a/examples/v1_metrics_query_metrics.rs +++ b/examples/v1_metrics_query_metrics.rs @@ -1,10 +1,10 @@ // Query timeseries points returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_metrics::MetricsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api .query_metrics(1636542671, 1636629071, "system.cpu.idle{*}".to_string()) diff --git a/examples/v1_metrics_submit_distribution_points.rs b/examples/v1_metrics_submit_distribution_points.rs index fdabbbd0b..99f6e0764 100644 --- a/examples/v1_metrics_submit_distribution_points.rs +++ b/examples/v1_metrics_submit_distribution_points.rs @@ -1,7 +1,7 @@ // Submit distribution points returns "Payload accepted" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_metrics::MetricsAPI; -use datadog_api_client::datadogV1::api::api_metrics::SubmitDistributionPointsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_metrics::MetricsAPI; +use datadog_api_client::datadogV1::api_metrics::SubmitDistributionPointsOptionalParams; use datadog_api_client::datadogV1::model::DistributionPointItem; use datadog_api_client::datadogV1::model::DistributionPointsPayload; use datadog_api_client::datadogV1::model::DistributionPointsSeries; @@ -15,7 +15,7 @@ async fn main() { DistributionPointItem::DistributionPointData(vec![1.0, 2.0]), ]], )]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api .submit_distribution_points(body, SubmitDistributionPointsOptionalParams::default()) diff --git a/examples/v1_metrics_submit_distribution_points_3109558960.rs b/examples/v1_metrics_submit_distribution_points_3109558960.rs index d6311feac..6660c67da 100644 --- a/examples/v1_metrics_submit_distribution_points_3109558960.rs +++ b/examples/v1_metrics_submit_distribution_points_3109558960.rs @@ -1,7 +1,7 @@ // Submit deflate distribution points returns "Payload accepted" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_metrics::MetricsAPI; -use datadog_api_client::datadogV1::api::api_metrics::SubmitDistributionPointsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_metrics::MetricsAPI; +use datadog_api_client::datadogV1::api_metrics::SubmitDistributionPointsOptionalParams; use datadog_api_client::datadogV1::model::DistributionPointItem; use datadog_api_client::datadogV1::model::DistributionPointsContentEncoding; use datadog_api_client::datadogV1::model::DistributionPointsPayload; @@ -16,7 +16,7 @@ async fn main() { DistributionPointItem::DistributionPointData(vec![1.0, 2.0]), ]], )]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api .submit_distribution_points( diff --git a/examples/v1_metrics_submit_metrics.rs b/examples/v1_metrics_submit_metrics.rs index d29e2f8f7..aefc63bd7 100644 --- a/examples/v1_metrics_submit_metrics.rs +++ b/examples/v1_metrics_submit_metrics.rs @@ -1,7 +1,7 @@ // Submit metrics returns "Payload accepted" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_metrics::MetricsAPI; -use datadog_api_client::datadogV1::api::api_metrics::SubmitMetricsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_metrics::MetricsAPI; +use datadog_api_client::datadogV1::api_metrics::SubmitMetricsOptionalParams; use datadog_api_client::datadogV1::model::MetricsPayload; use datadog_api_client::datadogV1::model::Series; @@ -13,7 +13,7 @@ async fn main() { ) .tags(vec!["test:ExampleMetric".to_string()]) .type_("gauge".to_string())]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api .submit_metrics(body, SubmitMetricsOptionalParams::default()) diff --git a/examples/v1_metrics_submit_metrics_2203981258.rs b/examples/v1_metrics_submit_metrics_2203981258.rs index fc376339b..cfad700d4 100644 --- a/examples/v1_metrics_submit_metrics_2203981258.rs +++ b/examples/v1_metrics_submit_metrics_2203981258.rs @@ -1,7 +1,7 @@ // Submit deflate metrics returns "Payload accepted" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_metrics::MetricsAPI; -use datadog_api_client::datadogV1::api::api_metrics::SubmitMetricsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_metrics::MetricsAPI; +use datadog_api_client::datadogV1::api_metrics::SubmitMetricsOptionalParams; use datadog_api_client::datadogV1::model::MetricContentEncoding; use datadog_api_client::datadogV1::model::MetricsPayload; use datadog_api_client::datadogV1::model::Series; @@ -14,7 +14,7 @@ async fn main() { ) .tags(vec!["test:ExampleMetric".to_string()]) .type_("gauge".to_string())]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api .submit_metrics( diff --git a/examples/v1_metrics_update_metric_metadata.rs b/examples/v1_metrics_update_metric_metadata.rs index 806a5771b..6fd7bf2fe 100644 --- a/examples/v1_metrics_update_metric_metadata.rs +++ b/examples/v1_metrics_update_metric_metadata.rs @@ -1,6 +1,6 @@ // Edit metric metadata returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_metrics::MetricsAPI; use datadog_api_client::datadogV1::model::MetricMetadata; #[tokio::main] @@ -9,7 +9,7 @@ async fn main() { .per_unit("second".to_string()) .type_("count".to_string()) .unit("byte".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api .update_metric_metadata("metric_name".to_string(), body) diff --git a/examples/v1_monitors_check_can_delete_monitor.rs b/examples/v1_monitors_check_can_delete_monitor.rs index e5068b37b..649bbce39 100644 --- a/examples/v1_monitors_check_can_delete_monitor.rs +++ b/examples/v1_monitors_check_can_delete_monitor.rs @@ -1,12 +1,12 @@ // Check if a monitor can be deleted returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; #[tokio::main] async fn main() { // there is a valid "monitor" in the system let monitor_id: i64 = std::env::var("MONITOR_ID").unwrap().parse().unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api.check_can_delete_monitor(vec![monitor_id.clone()]).await; if let Ok(value) = resp { diff --git a/examples/v1_monitors_create_monitor.rs b/examples/v1_monitors_create_monitor.rs index 469fabcf9..f830cbb50 100644 --- a/examples/v1_monitors_create_monitor.rs +++ b/examples/v1_monitors_create_monitor.rs @@ -1,6 +1,6 @@ // Create a monitor returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; use datadog_api_client::datadogV1::model::Monitor; use datadog_api_client::datadogV1::model::MonitorType; @@ -18,7 +18,7 @@ async fn main() { .priority(Some(3)) .restricted_roles(Some(vec![role_data_id.clone()])) .tags(vec!["test:examplemonitor".to_string(), "env:ci".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api.create_monitor(body).await; if let Ok(value) = resp { diff --git a/examples/v1_monitors_create_monitor_1539578087.rs b/examples/v1_monitors_create_monitor_1539578087.rs index 161923be4..2e3e4b5a6 100644 --- a/examples/v1_monitors_create_monitor_1539578087.rs +++ b/examples/v1_monitors_create_monitor_1539578087.rs @@ -1,6 +1,6 @@ // Create a metric monitor with a custom schedule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; use datadog_api_client::datadogV1::model::Monitor; use datadog_api_client::datadogV1::model::MonitorOptions; use datadog_api_client::datadogV1::model::MonitorOptionsCustomSchedule; @@ -39,7 +39,7 @@ async fn main() { .thresholds(MonitorThresholds::new().critical(0.5 as f64)), ) .tags(vec![]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api.create_monitor(body).await; if let Ok(value) = resp { diff --git a/examples/v1_monitors_create_monitor_1969035628.rs b/examples/v1_monitors_create_monitor_1969035628.rs index 033f751f7..607486a73 100644 --- a/examples/v1_monitors_create_monitor_1969035628.rs +++ b/examples/v1_monitors_create_monitor_1969035628.rs @@ -1,6 +1,6 @@ // Create a ci-tests formula and functions monitor returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; use datadog_api_client::datadogV1::model::Monitor; use datadog_api_client::datadogV1::model::MonitorFormulaAndFunctionEventAggregation; use datadog_api_client::datadogV1::model::MonitorFormulaAndFunctionEventQueryDefinition; @@ -65,7 +65,7 @@ async fn main() { ) .priority(Some(3)) .tags(vec!["test:examplemonitor".to_string(), "env:ci".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api.create_monitor(body).await; if let Ok(value) = resp { diff --git a/examples/v1_monitors_create_monitor_2012680290.rs b/examples/v1_monitors_create_monitor_2012680290.rs index f42179199..0be0b65fa 100644 --- a/examples/v1_monitors_create_monitor_2012680290.rs +++ b/examples/v1_monitors_create_monitor_2012680290.rs @@ -1,6 +1,6 @@ // Create a metric monitor returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; use datadog_api_client::datadogV1::model::Monitor; use datadog_api_client::datadogV1::model::MonitorOptions; use datadog_api_client::datadogV1::model::MonitorOptionsSchedulingOptions; @@ -27,7 +27,7 @@ async fn main() { ) .thresholds(MonitorThresholds::new().critical(0.5 as f64)), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api.create_monitor(body).await; if let Ok(value) = resp { diff --git a/examples/v1_monitors_create_monitor_2520912138.rs b/examples/v1_monitors_create_monitor_2520912138.rs index f7bd4ffec..4350d6a3e 100644 --- a/examples/v1_monitors_create_monitor_2520912138.rs +++ b/examples/v1_monitors_create_monitor_2520912138.rs @@ -1,6 +1,6 @@ // Create a ci-tests monitor returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; use datadog_api_client::datadogV1::model::Monitor; use datadog_api_client::datadogV1::model::MonitorOptions; use datadog_api_client::datadogV1::model::MonitorThresholds; @@ -18,7 +18,7 @@ async fn main() { .options(MonitorOptions::new().thresholds(MonitorThresholds::new().critical(1.0 as f64))) .priority(Some(3)) .tags(vec!["test:examplemonitor".to_string(), "env:ci".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api.create_monitor(body).await; if let Ok(value) = resp { diff --git a/examples/v1_monitors_create_monitor_3790803616.rs b/examples/v1_monitors_create_monitor_3790803616.rs index 897e45b5f..56fc46b30 100644 --- a/examples/v1_monitors_create_monitor_3790803616.rs +++ b/examples/v1_monitors_create_monitor_3790803616.rs @@ -1,6 +1,6 @@ // Create a ci-pipelines monitor returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; use datadog_api_client::datadogV1::model::Monitor; use datadog_api_client::datadogV1::model::MonitorOptions; use datadog_api_client::datadogV1::model::MonitorThresholds; @@ -18,7 +18,7 @@ async fn main() { .options(MonitorOptions::new().thresholds(MonitorThresholds::new().critical(1.0 as f64))) .priority(Some(3)) .tags(vec!["test:examplemonitor".to_string(), "env:ci".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api.create_monitor(body).await; if let Ok(value) = resp { diff --git a/examples/v1_monitors_create_monitor_3824294658.rs b/examples/v1_monitors_create_monitor_3824294658.rs index c837cea48..4707e2053 100644 --- a/examples/v1_monitors_create_monitor_3824294658.rs +++ b/examples/v1_monitors_create_monitor_3824294658.rs @@ -1,6 +1,6 @@ // Create a ci-pipelines formula and functions monitor returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; use datadog_api_client::datadogV1::model::Monitor; use datadog_api_client::datadogV1::model::MonitorFormulaAndFunctionEventAggregation; use datadog_api_client::datadogV1::model::MonitorFormulaAndFunctionEventQueryDefinition; @@ -65,7 +65,7 @@ async fn main() { ) .priority(Some(3)) .tags(vec!["test:examplemonitor".to_string(), "env:ci".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api.create_monitor(body).await; if let Ok(value) = resp { diff --git a/examples/v1_monitors_create_monitor_3883669300.rs b/examples/v1_monitors_create_monitor_3883669300.rs index c5d07e4af..ed68eb97d 100644 --- a/examples/v1_monitors_create_monitor_3883669300.rs +++ b/examples/v1_monitors_create_monitor_3883669300.rs @@ -1,6 +1,6 @@ // Create a RUM formula and functions monitor returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; use datadog_api_client::datadogV1::model::Monitor; use datadog_api_client::datadogV1::model::MonitorFormulaAndFunctionEventAggregation; use datadog_api_client::datadogV1::model::MonitorFormulaAndFunctionEventQueryDefinition; @@ -62,7 +62,7 @@ async fn main() { ) .priority(Some(3)) .tags(vec!["test:examplemonitor".to_string(), "env:ci".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api.create_monitor(body).await; if let Ok(value) = resp { diff --git a/examples/v1_monitors_create_monitor_440013737.rs b/examples/v1_monitors_create_monitor_440013737.rs index 68920bd84..ac932e61e 100644 --- a/examples/v1_monitors_create_monitor_440013737.rs +++ b/examples/v1_monitors_create_monitor_440013737.rs @@ -1,6 +1,6 @@ // Create an Error Tracking monitor returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; use datadog_api_client::datadogV1::model::Monitor; use datadog_api_client::datadogV1::model::MonitorOptions; use datadog_api_client::datadogV1::model::MonitorThresholds; @@ -18,7 +18,7 @@ async fn main() { .options(MonitorOptions::new().thresholds(MonitorThresholds::new().critical(1.0 as f64))) .priority(Some(3)) .tags(vec!["test:examplemonitor".to_string(), "env:ci".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api.create_monitor(body).await; if let Ok(value) = resp { diff --git a/examples/v1_monitors_delete_monitor.rs b/examples/v1_monitors_delete_monitor.rs index 1df40b6df..d0090bb48 100644 --- a/examples/v1_monitors_delete_monitor.rs +++ b/examples/v1_monitors_delete_monitor.rs @@ -1,13 +1,13 @@ // Delete a monitor returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::DeleteMonitorOptionalParams; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::DeleteMonitorOptionalParams; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; #[tokio::main] async fn main() { // there is a valid "monitor" in the system let monitor_id: i64 = std::env::var("MONITOR_ID").unwrap().parse().unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api .delete_monitor(monitor_id.clone(), DeleteMonitorOptionalParams::default()) diff --git a/examples/v1_monitors_get_monitor.rs b/examples/v1_monitors_get_monitor.rs index 893fe2bfa..8838ba929 100644 --- a/examples/v1_monitors_get_monitor.rs +++ b/examples/v1_monitors_get_monitor.rs @@ -1,13 +1,13 @@ // Get a monitor's details returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::GetMonitorOptionalParams; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::GetMonitorOptionalParams; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; #[tokio::main] async fn main() { // there is a valid "monitor" in the system let monitor_id: i64 = std::env::var("MONITOR_ID").unwrap().parse().unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api .get_monitor( diff --git a/examples/v1_monitors_get_monitor_2200114573.rs b/examples/v1_monitors_get_monitor_2200114573.rs index 8f68b10df..476b8446f 100644 --- a/examples/v1_monitors_get_monitor_2200114573.rs +++ b/examples/v1_monitors_get_monitor_2200114573.rs @@ -1,13 +1,13 @@ // Get a monitor's details with downtime returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::GetMonitorOptionalParams; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::GetMonitorOptionalParams; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; #[tokio::main] async fn main() { // there is a valid "monitor" in the system let monitor_id: i64 = std::env::var("MONITOR_ID").unwrap().parse().unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api .get_monitor( diff --git a/examples/v1_monitors_get_monitor_3691711704.rs b/examples/v1_monitors_get_monitor_3691711704.rs index 04d431229..ee5209194 100644 --- a/examples/v1_monitors_get_monitor_3691711704.rs +++ b/examples/v1_monitors_get_monitor_3691711704.rs @@ -1,7 +1,7 @@ // Get a synthetics monitor's details -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::GetMonitorOptionalParams; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::GetMonitorOptionalParams; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; #[tokio::main] async fn main() { @@ -10,7 +10,7 @@ async fn main() { .unwrap() .parse() .unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api .get_monitor( diff --git a/examples/v1_monitors_list_monitors.rs b/examples/v1_monitors_list_monitors.rs index 79e54151c..d4b39e0d5 100644 --- a/examples/v1_monitors_list_monitors.rs +++ b/examples/v1_monitors_list_monitors.rs @@ -1,11 +1,11 @@ // Get all monitor details returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::ListMonitorsOptionalParams; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::ListMonitorsOptionalParams; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api .list_monitors(ListMonitorsOptionalParams::default()) diff --git a/examples/v1_monitors_list_monitors_2966492814.rs b/examples/v1_monitors_list_monitors_2966492814.rs index 2727165e1..a7e20d405 100644 --- a/examples/v1_monitors_list_monitors_2966492814.rs +++ b/examples/v1_monitors_list_monitors_2966492814.rs @@ -1,13 +1,13 @@ // Get all monitor details returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::ListMonitorsOptionalParams; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::ListMonitorsOptionalParams; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let response = api.list_monitors_with_pagination(ListMonitorsOptionalParams::default().page_size(2)); diff --git a/examples/v1_monitors_list_monitors_3448441939.rs b/examples/v1_monitors_list_monitors_3448441939.rs index 7420655a2..9156f1211 100644 --- a/examples/v1_monitors_list_monitors_3448441939.rs +++ b/examples/v1_monitors_list_monitors_3448441939.rs @@ -1,11 +1,11 @@ // Get all monitor details with tags -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::ListMonitorsOptionalParams; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::ListMonitorsOptionalParams; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api .list_monitors( diff --git a/examples/v1_monitors_search_monitor_groups.rs b/examples/v1_monitors_search_monitor_groups.rs index 306b2b6ba..541db8e3f 100644 --- a/examples/v1_monitors_search_monitor_groups.rs +++ b/examples/v1_monitors_search_monitor_groups.rs @@ -1,11 +1,11 @@ // Monitors group search returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; -use datadog_api_client::datadogV1::api::api_monitors::SearchMonitorGroupsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; +use datadog_api_client::datadogV1::api_monitors::SearchMonitorGroupsOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api .search_monitor_groups(SearchMonitorGroupsOptionalParams::default()) diff --git a/examples/v1_monitors_search_monitors.rs b/examples/v1_monitors_search_monitors.rs index 80a5042ab..22c7f0261 100644 --- a/examples/v1_monitors_search_monitors.rs +++ b/examples/v1_monitors_search_monitors.rs @@ -1,11 +1,11 @@ // Monitors search returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; -use datadog_api_client::datadogV1::api::api_monitors::SearchMonitorsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; +use datadog_api_client::datadogV1::api_monitors::SearchMonitorsOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api .search_monitors(SearchMonitorsOptionalParams::default()) diff --git a/examples/v1_monitors_update_monitor.rs b/examples/v1_monitors_update_monitor.rs index bf955f8ea..d20580a48 100644 --- a/examples/v1_monitors_update_monitor.rs +++ b/examples/v1_monitors_update_monitor.rs @@ -1,6 +1,6 @@ // Edit a monitor returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; use datadog_api_client::datadogV1::model::MonitorOptions; use datadog_api_client::datadogV1::model::MonitorThresholds; use datadog_api_client::datadogV1::model::MonitorUpdateRequest; @@ -20,7 +20,7 @@ async fn main() { .thresholds(MonitorThresholds::new().critical(2.0 as f64).warning(None)) .timeout_h(None), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api.update_monitor(monitor_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v1_monitors_validate_existing_monitor.rs b/examples/v1_monitors_validate_existing_monitor.rs index 31ba3f9f3..33b6907b0 100644 --- a/examples/v1_monitors_validate_existing_monitor.rs +++ b/examples/v1_monitors_validate_existing_monitor.rs @@ -1,6 +1,6 @@ // Validate an existing monitor returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; use datadog_api_client::datadogV1::model::Monitor; use datadog_api_client::datadogV1::model::MonitorOptions; use datadog_api_client::datadogV1::model::MonitorOptionsNotificationPresets; @@ -40,7 +40,7 @@ async fn main() { ) .priority(Some(3)) .tags(vec!["test:examplemonitor".to_string(), "env:ci".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api .validate_existing_monitor(monitor_id.clone(), body) diff --git a/examples/v1_monitors_validate_monitor.rs b/examples/v1_monitors_validate_monitor.rs index c7023df88..b6c1f9d8e 100644 --- a/examples/v1_monitors_validate_monitor.rs +++ b/examples/v1_monitors_validate_monitor.rs @@ -1,6 +1,6 @@ // Validate a monitor returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; use datadog_api_client::datadogV1::model::Monitor; use datadog_api_client::datadogV1::model::MonitorOptions; use datadog_api_client::datadogV1::model::MonitorOptionsNotificationPresets; @@ -38,7 +38,7 @@ async fn main() { ) .priority(Some(3)) .tags(vec!["test:examplemonitor".to_string(), "env:ci".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api.validate_monitor(body).await; if let Ok(value) = resp { diff --git a/examples/v1_monitors_validate_monitor_4247196452.rs b/examples/v1_monitors_validate_monitor_4247196452.rs index 910e7a4ea..0baa91917 100644 --- a/examples/v1_monitors_validate_monitor_4247196452.rs +++ b/examples/v1_monitors_validate_monitor_4247196452.rs @@ -1,6 +1,6 @@ // Validate a multi-alert monitor returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_monitors::MonitorsAPI; use datadog_api_client::datadogV1::model::Monitor; use datadog_api_client::datadogV1::model::MonitorOptions; use datadog_api_client::datadogV1::model::MonitorThresholds; @@ -38,7 +38,7 @@ async fn main() { ) .priority(Some(3)) .tags(vec!["test:examplemonitor".to_string(), "env:ci".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api.validate_monitor(body).await; if let Ok(value) = resp { diff --git a/examples/v1_notebooks_create_notebook.rs b/examples/v1_notebooks_create_notebook.rs index dc6d3994d..15d202488 100644 --- a/examples/v1_notebooks_create_notebook.rs +++ b/examples/v1_notebooks_create_notebook.rs @@ -1,6 +1,6 @@ // Create a notebook returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_notebooks::NotebooksAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_notebooks::NotebooksAPI; use datadog_api_client::datadogV1::model::NotebookCellCreateRequest; use datadog_api_client::datadogV1::model::NotebookCellCreateRequestAttributes; use datadog_api_client::datadogV1::model::NotebookCellResourceType; @@ -83,7 +83,7 @@ y = 6; .status(NotebookStatus::PUBLISHED), NotebookResourceType::NOTEBOOKS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = NotebooksAPI::with_config(configuration); let resp = api.create_notebook(body).await; if let Ok(value) = resp { diff --git a/examples/v1_notebooks_delete_notebook.rs b/examples/v1_notebooks_delete_notebook.rs index 7462e58af..ad1383746 100644 --- a/examples/v1_notebooks_delete_notebook.rs +++ b/examples/v1_notebooks_delete_notebook.rs @@ -1,12 +1,12 @@ // Delete a notebook returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_notebooks::NotebooksAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_notebooks::NotebooksAPI; #[tokio::main] async fn main() { // there is a valid "notebook" in the system let notebook_data_id: i64 = std::env::var("NOTEBOOK_DATA_ID").unwrap().parse().unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = NotebooksAPI::with_config(configuration); let resp = api.delete_notebook(notebook_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v1_notebooks_get_notebook.rs b/examples/v1_notebooks_get_notebook.rs index 0a3f6e8fb..3d12b5423 100644 --- a/examples/v1_notebooks_get_notebook.rs +++ b/examples/v1_notebooks_get_notebook.rs @@ -1,12 +1,12 @@ // Get a notebook returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_notebooks::NotebooksAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_notebooks::NotebooksAPI; #[tokio::main] async fn main() { // there is a valid "notebook" in the system let notebook_data_id: i64 = std::env::var("NOTEBOOK_DATA_ID").unwrap().parse().unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = NotebooksAPI::with_config(configuration); let resp = api.get_notebook(notebook_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v1_notebooks_list_notebooks.rs b/examples/v1_notebooks_list_notebooks.rs index 9dedcb06f..3e3bace75 100644 --- a/examples/v1_notebooks_list_notebooks.rs +++ b/examples/v1_notebooks_list_notebooks.rs @@ -1,11 +1,11 @@ // Get all notebooks returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_notebooks::ListNotebooksOptionalParams; -use datadog_api_client::datadogV1::api::api_notebooks::NotebooksAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_notebooks::ListNotebooksOptionalParams; +use datadog_api_client::datadogV1::api_notebooks::NotebooksAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = NotebooksAPI::with_config(configuration); let resp = api .list_notebooks(ListNotebooksOptionalParams::default()) diff --git a/examples/v1_notebooks_list_notebooks_788665428.rs b/examples/v1_notebooks_list_notebooks_788665428.rs index 1249e0367..810ab9121 100644 --- a/examples/v1_notebooks_list_notebooks_788665428.rs +++ b/examples/v1_notebooks_list_notebooks_788665428.rs @@ -1,13 +1,13 @@ // Get all notebooks returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_notebooks::ListNotebooksOptionalParams; -use datadog_api_client::datadogV1::api::api_notebooks::NotebooksAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_notebooks::ListNotebooksOptionalParams; +use datadog_api_client::datadogV1::api_notebooks::NotebooksAPI; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = NotebooksAPI::with_config(configuration); let response = api.list_notebooks_with_pagination(ListNotebooksOptionalParams::default().count(2)); diff --git a/examples/v1_notebooks_update_notebook.rs b/examples/v1_notebooks_update_notebook.rs index 973aef994..545ebc9c7 100644 --- a/examples/v1_notebooks_update_notebook.rs +++ b/examples/v1_notebooks_update_notebook.rs @@ -1,6 +1,6 @@ // Update a notebook returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_notebooks::NotebooksAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_notebooks::NotebooksAPI; use datadog_api_client::datadogV1::model::NotebookCellCreateRequest; use datadog_api_client::datadogV1::model::NotebookCellCreateRequestAttributes; use datadog_api_client::datadogV1::model::NotebookCellResourceType; @@ -92,7 +92,7 @@ y = 6; .status(NotebookStatus::PUBLISHED), NotebookResourceType::NOTEBOOKS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = NotebooksAPI::with_config(configuration); let resp = api.update_notebook(notebook_data_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v1_organizations_create_child_org.rs b/examples/v1_organizations_create_child_org.rs index 762a17ca8..b4efaaaf2 100644 --- a/examples/v1_organizations_create_child_org.rs +++ b/examples/v1_organizations_create_child_org.rs @@ -1,6 +1,6 @@ // Create a child organization returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_organizations::OrganizationsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_organizations::OrganizationsAPI; use datadog_api_client::datadogV1::model::OrganizationBilling; use datadog_api_client::datadogV1::model::OrganizationCreateBody; use datadog_api_client::datadogV1::model::OrganizationSubscription; @@ -10,7 +10,7 @@ async fn main() { let body = OrganizationCreateBody::new("New child org".to_string()) .billing(OrganizationBilling::new().type_("parent_billing".to_string())) .subscription(OrganizationSubscription::new().type_("pro".to_string())); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = OrganizationsAPI::with_config(configuration); let resp = api.create_child_org(body).await; if let Ok(value) = resp { diff --git a/examples/v1_organizations_downgrade_org.rs b/examples/v1_organizations_downgrade_org.rs index b9a7a1856..1f2bdda92 100644 --- a/examples/v1_organizations_downgrade_org.rs +++ b/examples/v1_organizations_downgrade_org.rs @@ -1,10 +1,10 @@ // Spin-off Child Organization returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_organizations::OrganizationsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_organizations::OrganizationsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = OrganizationsAPI::with_config(configuration); let resp = api.downgrade_org("abc123".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_organizations_get_org.rs b/examples/v1_organizations_get_org.rs index b7d0858ea..c06ade561 100644 --- a/examples/v1_organizations_get_org.rs +++ b/examples/v1_organizations_get_org.rs @@ -1,10 +1,10 @@ // Get organization information returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_organizations::OrganizationsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_organizations::OrganizationsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = OrganizationsAPI::with_config(configuration); let resp = api.get_org("abc123".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_organizations_list_orgs.rs b/examples/v1_organizations_list_orgs.rs index f3d09efd0..9b55928b8 100644 --- a/examples/v1_organizations_list_orgs.rs +++ b/examples/v1_organizations_list_orgs.rs @@ -1,10 +1,10 @@ // List your managed organizations returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_organizations::OrganizationsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_organizations::OrganizationsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = OrganizationsAPI::with_config(configuration); let resp = api.list_orgs().await; if let Ok(value) = resp { diff --git a/examples/v1_organizations_update_org.rs b/examples/v1_organizations_update_org.rs index f18c5de31..9ce881a6f 100644 --- a/examples/v1_organizations_update_org.rs +++ b/examples/v1_organizations_update_org.rs @@ -1,6 +1,6 @@ // Update your organization returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_organizations::OrganizationsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_organizations::OrganizationsAPI; use datadog_api_client::datadogV1::model::AccessRole; use datadog_api_client::datadogV1::model::Organization; use datadog_api_client::datadogV1::model::OrganizationBilling; @@ -39,7 +39,7 @@ async fn main() { ) .subscription(OrganizationSubscription::new().type_("pro".to_string())) .trial(false); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = OrganizationsAPI::with_config(configuration); let resp = api.update_org("abc123".to_string(), body).await; if let Ok(value) = resp { diff --git a/examples/v1_organizations_upload_idp_for_org.rs b/examples/v1_organizations_upload_idp_for_org.rs index 9428478eb..4ea8bc6d4 100644 --- a/examples/v1_organizations_upload_idp_for_org.rs +++ b/examples/v1_organizations_upload_idp_for_org.rs @@ -1,11 +1,11 @@ // Upload IdP metadata returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_organizations::OrganizationsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_organizations::OrganizationsAPI; use std::fs; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = OrganizationsAPI::with_config(configuration); let resp = api .upload_idp_for_org( diff --git a/examples/v1_pagerduty-integration_create_pager_duty_integration_service.rs b/examples/v1_pagerduty-integration_create_pager_duty_integration_service.rs index 7f033427a..a5e2df65f 100644 --- a/examples/v1_pagerduty-integration_create_pager_duty_integration_service.rs +++ b/examples/v1_pagerduty-integration_create_pager_duty_integration_service.rs @@ -1,12 +1,12 @@ // Create a new service object returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_pager_duty_integration::PagerDutyIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_pager_duty_integration::PagerDutyIntegrationAPI; use datadog_api_client::datadogV1::model::PagerDutyService; #[tokio::main] async fn main() { let body = PagerDutyService::new("".to_string(), "".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = PagerDutyIntegrationAPI::with_config(configuration); let resp = api.create_pager_duty_integration_service(body).await; if let Ok(value) = resp { diff --git a/examples/v1_pagerduty-integration_delete_pager_duty_integration_service.rs b/examples/v1_pagerduty-integration_delete_pager_duty_integration_service.rs index b27b462a0..fc5b65542 100644 --- a/examples/v1_pagerduty-integration_delete_pager_duty_integration_service.rs +++ b/examples/v1_pagerduty-integration_delete_pager_duty_integration_service.rs @@ -1,10 +1,10 @@ // Delete a single service object returns "No Content" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_pager_duty_integration::PagerDutyIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_pager_duty_integration::PagerDutyIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = PagerDutyIntegrationAPI::with_config(configuration); let resp = api .delete_pager_duty_integration_service("service_name".to_string()) diff --git a/examples/v1_pagerduty-integration_get_pager_duty_integration_service.rs b/examples/v1_pagerduty-integration_get_pager_duty_integration_service.rs index 1d905510e..3a03285ff 100644 --- a/examples/v1_pagerduty-integration_get_pager_duty_integration_service.rs +++ b/examples/v1_pagerduty-integration_get_pager_duty_integration_service.rs @@ -1,10 +1,10 @@ // Get a single service object returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_pager_duty_integration::PagerDutyIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_pager_duty_integration::PagerDutyIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = PagerDutyIntegrationAPI::with_config(configuration); let resp = api .get_pager_duty_integration_service("service_name".to_string()) diff --git a/examples/v1_pagerduty-integration_update_pager_duty_integration_service.rs b/examples/v1_pagerduty-integration_update_pager_duty_integration_service.rs index 705c36cd5..d59283013 100644 --- a/examples/v1_pagerduty-integration_update_pager_duty_integration_service.rs +++ b/examples/v1_pagerduty-integration_update_pager_duty_integration_service.rs @@ -1,12 +1,12 @@ // Update a single service object returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_pager_duty_integration::PagerDutyIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_pager_duty_integration::PagerDutyIntegrationAPI; use datadog_api_client::datadogV1::model::PagerDutyServiceKey; #[tokio::main] async fn main() { let body = PagerDutyServiceKey::new("".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = PagerDutyIntegrationAPI::with_config(configuration); let resp = api .update_pager_duty_integration_service("service_name".to_string(), body) diff --git a/examples/v1_security-monitoring_add_security_monitoring_signal_to_incident.rs b/examples/v1_security-monitoring_add_security_monitoring_signal_to_incident.rs index e8481a1b4..870eae833 100644 --- a/examples/v1_security-monitoring_add_security_monitoring_signal_to_incident.rs +++ b/examples/v1_security-monitoring_add_security_monitoring_signal_to_incident.rs @@ -1,12 +1,12 @@ // Add a security signal to an incident returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV1::model::AddSignalToIncidentRequest; #[tokio::main] async fn main() { let body = AddSignalToIncidentRequest::new(2609); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .add_security_monitoring_signal_to_incident( diff --git a/examples/v1_security-monitoring_edit_security_monitoring_signal_assignee.rs b/examples/v1_security-monitoring_edit_security_monitoring_signal_assignee.rs index a20945679..712b93e2b 100644 --- a/examples/v1_security-monitoring_edit_security_monitoring_signal_assignee.rs +++ b/examples/v1_security-monitoring_edit_security_monitoring_signal_assignee.rs @@ -1,12 +1,12 @@ // Modify the triage assignee of a security signal returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV1::model::SignalAssigneeUpdateRequest; #[tokio::main] async fn main() { let body = SignalAssigneeUpdateRequest::new("773b045d-ccf8-4808-bd3b-955ef6a8c940".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .edit_security_monitoring_signal_assignee( diff --git a/examples/v1_security-monitoring_edit_security_monitoring_signal_state.rs b/examples/v1_security-monitoring_edit_security_monitoring_signal_state.rs index b0ff8c882..8b0cb5d8f 100644 --- a/examples/v1_security-monitoring_edit_security_monitoring_signal_state.rs +++ b/examples/v1_security-monitoring_edit_security_monitoring_signal_state.rs @@ -1,6 +1,6 @@ // Change the triage state of a security signal returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV1::model::SignalArchiveReason; use datadog_api_client::datadogV1::model::SignalStateUpdateRequest; use datadog_api_client::datadogV1::model::SignalTriageState; @@ -9,7 +9,7 @@ use datadog_api_client::datadogV1::model::SignalTriageState; async fn main() { let body = SignalStateUpdateRequest::new(SignalTriageState::OPEN) .archive_reason(SignalArchiveReason::NONE); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .edit_security_monitoring_signal_state( diff --git a/examples/v1_service-checks_submit_service_check.rs b/examples/v1_service-checks_submit_service_check.rs index 006a49cb0..dfcc23767 100644 --- a/examples/v1_service-checks_submit_service_check.rs +++ b/examples/v1_service-checks_submit_service_check.rs @@ -1,6 +1,6 @@ // Submit a Service Check returns "Payload accepted" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_service_checks::ServiceChecksAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_service_checks::ServiceChecksAPI; use datadog_api_client::datadogV1::model::ServiceCheck; use datadog_api_client::datadogV1::model::ServiceCheckStatus; @@ -12,7 +12,7 @@ async fn main() { ServiceCheckStatus::OK, vec!["test:ExampleServiceCheck".to_string()], )]; - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceChecksAPI::with_config(configuration); let resp = api.submit_service_check(body).await; if let Ok(value) = resp { diff --git a/examples/v1_service-level-objective-corrections_create_slo_correction.rs b/examples/v1_service-level-objective-corrections_create_slo_correction.rs index dc4d3dec2..9ec3d8993 100644 --- a/examples/v1_service-level-objective-corrections_create_slo_correction.rs +++ b/examples/v1_service-level-objective-corrections_create_slo_correction.rs @@ -1,6 +1,6 @@ // Create an SLO correction returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_service_level_objective_corrections::ServiceLevelObjectiveCorrectionsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_service_level_objective_corrections::ServiceLevelObjectiveCorrectionsAPI; use datadog_api_client::datadogV1::model::SLOCorrectionCategory; use datadog_api_client::datadogV1::model::SLOCorrectionCreateData; use datadog_api_client::datadogV1::model::SLOCorrectionCreateRequest; @@ -23,7 +23,7 @@ async fn main() { .timezone("UTC".to_string()), ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceLevelObjectiveCorrectionsAPI::with_config(configuration); let resp = api.create_slo_correction(body).await; if let Ok(value) = resp { diff --git a/examples/v1_service-level-objective-corrections_create_slo_correction_1326388368.rs b/examples/v1_service-level-objective-corrections_create_slo_correction_1326388368.rs index 8e3f99412..b24d23d71 100644 --- a/examples/v1_service-level-objective-corrections_create_slo_correction_1326388368.rs +++ b/examples/v1_service-level-objective-corrections_create_slo_correction_1326388368.rs @@ -1,6 +1,6 @@ // Create an SLO correction with rrule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_service_level_objective_corrections::ServiceLevelObjectiveCorrectionsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_service_level_objective_corrections::ServiceLevelObjectiveCorrectionsAPI; use datadog_api_client::datadogV1::model::SLOCorrectionCategory; use datadog_api_client::datadogV1::model::SLOCorrectionCreateData; use datadog_api_client::datadogV1::model::SLOCorrectionCreateRequest; @@ -24,7 +24,7 @@ async fn main() { .timezone("UTC".to_string()), ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceLevelObjectiveCorrectionsAPI::with_config(configuration); let resp = api.create_slo_correction(body).await; if let Ok(value) = resp { diff --git a/examples/v1_service-level-objective-corrections_delete_slo_correction.rs b/examples/v1_service-level-objective-corrections_delete_slo_correction.rs index 8f8748ea7..250dbce2d 100644 --- a/examples/v1_service-level-objective-corrections_delete_slo_correction.rs +++ b/examples/v1_service-level-objective-corrections_delete_slo_correction.rs @@ -1,10 +1,10 @@ // Delete an SLO correction returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_service_level_objective_corrections::ServiceLevelObjectiveCorrectionsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_service_level_objective_corrections::ServiceLevelObjectiveCorrectionsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceLevelObjectiveCorrectionsAPI::with_config(configuration); let resp = api .delete_slo_correction("slo_correction_id".to_string()) diff --git a/examples/v1_service-level-objective-corrections_get_slo_correction.rs b/examples/v1_service-level-objective-corrections_get_slo_correction.rs index 71465ab6a..bb73ddded 100644 --- a/examples/v1_service-level-objective-corrections_get_slo_correction.rs +++ b/examples/v1_service-level-objective-corrections_get_slo_correction.rs @@ -1,12 +1,12 @@ // Get an SLO correction for an SLO returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_service_level_objective_corrections::ServiceLevelObjectiveCorrectionsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_service_level_objective_corrections::ServiceLevelObjectiveCorrectionsAPI; #[tokio::main] async fn main() { // there is a valid "correction" for "slo" let correction_data_id = std::env::var("CORRECTION_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceLevelObjectiveCorrectionsAPI::with_config(configuration); let resp = api.get_slo_correction(correction_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v1_service-level-objective-corrections_list_slo_correction.rs b/examples/v1_service-level-objective-corrections_list_slo_correction.rs index 969d827f1..e90967c37 100644 --- a/examples/v1_service-level-objective-corrections_list_slo_correction.rs +++ b/examples/v1_service-level-objective-corrections_list_slo_correction.rs @@ -1,11 +1,11 @@ // Get all SLO corrections returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_service_level_objective_corrections::ListSLOCorrectionOptionalParams; -use datadog_api_client::datadogV1::api::api_service_level_objective_corrections::ServiceLevelObjectiveCorrectionsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_service_level_objective_corrections::ListSLOCorrectionOptionalParams; +use datadog_api_client::datadogV1::api_service_level_objective_corrections::ServiceLevelObjectiveCorrectionsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceLevelObjectiveCorrectionsAPI::with_config(configuration); let resp = api .list_slo_correction( diff --git a/examples/v1_service-level-objective-corrections_list_slo_correction_2647266873.rs b/examples/v1_service-level-objective-corrections_list_slo_correction_2647266873.rs index a6d5732ab..71fd6ca93 100644 --- a/examples/v1_service-level-objective-corrections_list_slo_correction_2647266873.rs +++ b/examples/v1_service-level-objective-corrections_list_slo_correction_2647266873.rs @@ -1,13 +1,13 @@ // Get all SLO corrections returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_service_level_objective_corrections::ListSLOCorrectionOptionalParams; -use datadog_api_client::datadogV1::api::api_service_level_objective_corrections::ServiceLevelObjectiveCorrectionsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_service_level_objective_corrections::ListSLOCorrectionOptionalParams; +use datadog_api_client::datadogV1::api_service_level_objective_corrections::ServiceLevelObjectiveCorrectionsAPI; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceLevelObjectiveCorrectionsAPI::with_config(configuration); let response = api .list_slo_correction_with_pagination(ListSLOCorrectionOptionalParams::default().limit(2)); diff --git a/examples/v1_service-level-objective-corrections_update_slo_correction.rs b/examples/v1_service-level-objective-corrections_update_slo_correction.rs index feaf32a61..75c7af6e7 100644 --- a/examples/v1_service-level-objective-corrections_update_slo_correction.rs +++ b/examples/v1_service-level-objective-corrections_update_slo_correction.rs @@ -1,6 +1,6 @@ // Update an SLO correction returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_service_level_objective_corrections::ServiceLevelObjectiveCorrectionsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_service_level_objective_corrections::ServiceLevelObjectiveCorrectionsAPI; use datadog_api_client::datadogV1::model::SLOCorrectionCategory; use datadog_api_client::datadogV1::model::SLOCorrectionType; use datadog_api_client::datadogV1::model::SLOCorrectionUpdateData; @@ -23,7 +23,7 @@ async fn main() { ) .type_(SLOCorrectionType::CORRECTION), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceLevelObjectiveCorrectionsAPI::with_config(configuration); let resp = api .update_slo_correction(correction_data_id.clone(), body) diff --git a/examples/v1_service-level-objectives_check_can_delete_slo.rs b/examples/v1_service-level-objectives_check_can_delete_slo.rs index 18d1667ff..958c2a130 100644 --- a/examples/v1_service-level-objectives_check_can_delete_slo.rs +++ b/examples/v1_service-level-objectives_check_can_delete_slo.rs @@ -1,10 +1,10 @@ // Check if SLOs can be safely deleted returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_service_level_objectives::ServiceLevelObjectivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_service_level_objectives::ServiceLevelObjectivesAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceLevelObjectivesAPI::with_config(configuration); let resp = api.check_can_delete_slo("ids".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_service-level-objectives_create_slo.rs b/examples/v1_service-level-objectives_create_slo.rs index ecabbdd9d..ae06d88f1 100644 --- a/examples/v1_service-level-objectives_create_slo.rs +++ b/examples/v1_service-level-objectives_create_slo.rs @@ -1,6 +1,6 @@ // Create an SLO object returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_service_level_objectives::ServiceLevelObjectivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_service_level_objectives::ServiceLevelObjectivesAPI; use datadog_api_client::datadogV1::model::SLOThreshold; use datadog_api_client::datadogV1::model::SLOTimeframe; use datadog_api_client::datadogV1::model::SLOType; @@ -28,7 +28,7 @@ async fn main() { .target_threshold(97.0 as f64) .timeframe(SLOTimeframe::SEVEN_DAYS) .warning_threshold(98.0 as f64); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceLevelObjectivesAPI::with_config(configuration); let resp = api.create_slo(body).await; if let Ok(value) = resp { diff --git a/examples/v1_service-level-objectives_create_slo_3765703239.rs b/examples/v1_service-level-objectives_create_slo_3765703239.rs index 3007886ab..ce219e177 100644 --- a/examples/v1_service-level-objectives_create_slo_3765703239.rs +++ b/examples/v1_service-level-objectives_create_slo_3765703239.rs @@ -1,6 +1,6 @@ // Create a time-slice SLO object returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_service_level_objectives::ServiceLevelObjectivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_service_level_objectives::ServiceLevelObjectivesAPI; use datadog_api_client::datadogV1::model::FormulaAndFunctionMetricDataSource; use datadog_api_client::datadogV1::model::FormulaAndFunctionMetricQueryDefinition; use datadog_api_client::datadogV1::model::SLODataSourceQueryDefinition; @@ -48,7 +48,7 @@ async fn main() { .target_threshold(97.0 as f64) .timeframe(SLOTimeframe::SEVEN_DAYS) .warning_threshold(98.0 as f64); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceLevelObjectivesAPI::with_config(configuration); let resp = api.create_slo(body).await; if let Ok(value) = resp { diff --git a/examples/v1_service-level-objectives_delete_slo.rs b/examples/v1_service-level-objectives_delete_slo.rs index aeb64049f..87a26c321 100644 --- a/examples/v1_service-level-objectives_delete_slo.rs +++ b/examples/v1_service-level-objectives_delete_slo.rs @@ -1,13 +1,13 @@ // Delete an SLO returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_service_level_objectives::DeleteSLOOptionalParams; -use datadog_api_client::datadogV1::api::api_service_level_objectives::ServiceLevelObjectivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_service_level_objectives::DeleteSLOOptionalParams; +use datadog_api_client::datadogV1::api_service_level_objectives::ServiceLevelObjectivesAPI; #[tokio::main] async fn main() { // there is a valid "slo" in the system let slo_data_0_id = std::env::var("SLO_DATA_0_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceLevelObjectivesAPI::with_config(configuration); let resp = api .delete_slo(slo_data_0_id.clone(), DeleteSLOOptionalParams::default()) diff --git a/examples/v1_service-level-objectives_delete_slo_timeframe_in_bulk.rs b/examples/v1_service-level-objectives_delete_slo_timeframe_in_bulk.rs index af7a7b531..7928abe5c 100644 --- a/examples/v1_service-level-objectives_delete_slo_timeframe_in_bulk.rs +++ b/examples/v1_service-level-objectives_delete_slo_timeframe_in_bulk.rs @@ -1,6 +1,6 @@ // Bulk Delete SLO Timeframes returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_service_level_objectives::ServiceLevelObjectivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_service_level_objectives::ServiceLevelObjectivesAPI; use datadog_api_client::datadogV1::model::SLOTimeframe; use std::collections::BTreeMap; @@ -16,7 +16,7 @@ async fn main() { vec![SLOTimeframe::SEVEN_DAYS, SLOTimeframe::THIRTY_DAYS], ), ]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceLevelObjectivesAPI::with_config(configuration); let resp = api.delete_slo_timeframe_in_bulk(body).await; if let Ok(value) = resp { diff --git a/examples/v1_service-level-objectives_get_slo.rs b/examples/v1_service-level-objectives_get_slo.rs index 5db4a2862..9479322ab 100644 --- a/examples/v1_service-level-objectives_get_slo.rs +++ b/examples/v1_service-level-objectives_get_slo.rs @@ -1,13 +1,13 @@ // Get an SLO's details returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_service_level_objectives::GetSLOOptionalParams; -use datadog_api_client::datadogV1::api::api_service_level_objectives::ServiceLevelObjectivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_service_level_objectives::GetSLOOptionalParams; +use datadog_api_client::datadogV1::api_service_level_objectives::ServiceLevelObjectivesAPI; #[tokio::main] async fn main() { // there is a valid "slo" in the system let slo_data_0_id = std::env::var("SLO_DATA_0_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceLevelObjectivesAPI::with_config(configuration); let resp = api .get_slo(slo_data_0_id.clone(), GetSLOOptionalParams::default()) diff --git a/examples/v1_service-level-objectives_get_slo_corrections.rs b/examples/v1_service-level-objectives_get_slo_corrections.rs index 580f600ae..c6def738e 100644 --- a/examples/v1_service-level-objectives_get_slo_corrections.rs +++ b/examples/v1_service-level-objectives_get_slo_corrections.rs @@ -1,12 +1,12 @@ // Get Corrections For an SLO returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_service_level_objectives::ServiceLevelObjectivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_service_level_objectives::ServiceLevelObjectivesAPI; #[tokio::main] async fn main() { // there is a valid "slo" in the system let slo_data_0_id = std::env::var("SLO_DATA_0_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceLevelObjectivesAPI::with_config(configuration); let resp = api.get_slo_corrections(slo_data_0_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v1_service-level-objectives_get_slo_history.rs b/examples/v1_service-level-objectives_get_slo_history.rs index 2871bb59d..16f4d5309 100644 --- a/examples/v1_service-level-objectives_get_slo_history.rs +++ b/examples/v1_service-level-objectives_get_slo_history.rs @@ -1,13 +1,13 @@ // Get an SLO's history returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_service_level_objectives::GetSLOHistoryOptionalParams; -use datadog_api_client::datadogV1::api::api_service_level_objectives::ServiceLevelObjectivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_service_level_objectives::GetSLOHistoryOptionalParams; +use datadog_api_client::datadogV1::api_service_level_objectives::ServiceLevelObjectivesAPI; #[tokio::main] async fn main() { // there is a valid "slo" in the system let slo_data_0_id = std::env::var("SLO_DATA_0_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceLevelObjectivesAPI::with_config(configuration); let resp = api .get_slo_history( diff --git a/examples/v1_service-level-objectives_list_slos.rs b/examples/v1_service-level-objectives_list_slos.rs index 03af1c576..68b3f5728 100644 --- a/examples/v1_service-level-objectives_list_slos.rs +++ b/examples/v1_service-level-objectives_list_slos.rs @@ -1,13 +1,13 @@ // Get all SLOs returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_service_level_objectives::ListSLOsOptionalParams; -use datadog_api_client::datadogV1::api::api_service_level_objectives::ServiceLevelObjectivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_service_level_objectives::ListSLOsOptionalParams; +use datadog_api_client::datadogV1::api_service_level_objectives::ServiceLevelObjectivesAPI; #[tokio::main] async fn main() { // there is a valid "slo" in the system let slo_data_0_id = std::env::var("SLO_DATA_0_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceLevelObjectivesAPI::with_config(configuration); let resp = api .list_slos(ListSLOsOptionalParams::default().ids(slo_data_0_id.clone())) diff --git a/examples/v1_service-level-objectives_list_slos_3036942817.rs b/examples/v1_service-level-objectives_list_slos_3036942817.rs index 3a5f17533..9bc0ee9fa 100644 --- a/examples/v1_service-level-objectives_list_slos_3036942817.rs +++ b/examples/v1_service-level-objectives_list_slos_3036942817.rs @@ -1,13 +1,13 @@ // Get all SLOs returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_service_level_objectives::ListSLOsOptionalParams; -use datadog_api_client::datadogV1::api::api_service_level_objectives::ServiceLevelObjectivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_service_level_objectives::ListSLOsOptionalParams; +use datadog_api_client::datadogV1::api_service_level_objectives::ServiceLevelObjectivesAPI; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceLevelObjectivesAPI::with_config(configuration); let response = api.list_slos_with_pagination(ListSLOsOptionalParams::default().limit(2)); pin_mut!(response); diff --git a/examples/v1_service-level-objectives_search_slo.rs b/examples/v1_service-level-objectives_search_slo.rs index 77e334cde..0d9d9474d 100644 --- a/examples/v1_service-level-objectives_search_slo.rs +++ b/examples/v1_service-level-objectives_search_slo.rs @@ -1,13 +1,13 @@ // Search for SLOs returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_service_level_objectives::SearchSLOOptionalParams; -use datadog_api_client::datadogV1::api::api_service_level_objectives::ServiceLevelObjectivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_service_level_objectives::SearchSLOOptionalParams; +use datadog_api_client::datadogV1::api_service_level_objectives::ServiceLevelObjectivesAPI; #[tokio::main] async fn main() { // there is a valid "slo" in the system let slo_data_0_name = std::env::var("SLO_DATA_0_NAME").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceLevelObjectivesAPI::with_config(configuration); let resp = api .search_slo( diff --git a/examples/v1_service-level-objectives_update_slo.rs b/examples/v1_service-level-objectives_update_slo.rs index 8ff230de6..66a055917 100644 --- a/examples/v1_service-level-objectives_update_slo.rs +++ b/examples/v1_service-level-objectives_update_slo.rs @@ -1,6 +1,6 @@ // Update an SLO returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_service_level_objectives::ServiceLevelObjectivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_service_level_objectives::ServiceLevelObjectivesAPI; use datadog_api_client::datadogV1::model::SLOThreshold; use datadog_api_client::datadogV1::model::SLOTimeframe; use datadog_api_client::datadogV1::model::SLOType; @@ -24,7 +24,7 @@ async fn main() { .target_threshold(97.0 as f64) .timeframe(SLOTimeframe::SEVEN_DAYS) .warning_threshold(98.0 as f64); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceLevelObjectivesAPI::with_config(configuration); let resp = api.update_slo(slo_data_0_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v1_slack-integration_create_slack_integration_channel.rs b/examples/v1_slack-integration_create_slack_integration_channel.rs index 9aa1f0e11..ecfc36a62 100644 --- a/examples/v1_slack-integration_create_slack_integration_channel.rs +++ b/examples/v1_slack-integration_create_slack_integration_channel.rs @@ -1,6 +1,6 @@ // Create a Slack integration channel returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_slack_integration::SlackIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_slack_integration::SlackIntegrationAPI; use datadog_api_client::datadogV1::model::SlackIntegrationChannel; use datadog_api_client::datadogV1::model::SlackIntegrationChannelDisplay; @@ -15,7 +15,7 @@ async fn main() { .tags(true), ) .name("#general".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SlackIntegrationAPI::with_config(configuration); let resp = api .create_slack_integration_channel("account_name".to_string(), body) diff --git a/examples/v1_slack-integration_get_slack_integration_channel.rs b/examples/v1_slack-integration_get_slack_integration_channel.rs index b6447b661..d541b5462 100644 --- a/examples/v1_slack-integration_get_slack_integration_channel.rs +++ b/examples/v1_slack-integration_get_slack_integration_channel.rs @@ -1,10 +1,10 @@ // Get a Slack integration channel returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_slack_integration::SlackIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_slack_integration::SlackIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SlackIntegrationAPI::with_config(configuration); let resp = api .get_slack_integration_channel("account_name".to_string(), "channel_name".to_string()) diff --git a/examples/v1_slack-integration_get_slack_integration_channels.rs b/examples/v1_slack-integration_get_slack_integration_channels.rs index f01e9c6b1..ddb30f96e 100644 --- a/examples/v1_slack-integration_get_slack_integration_channels.rs +++ b/examples/v1_slack-integration_get_slack_integration_channels.rs @@ -1,10 +1,10 @@ // Get all channels in a Slack integration returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_slack_integration::SlackIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_slack_integration::SlackIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SlackIntegrationAPI::with_config(configuration); let resp = api .get_slack_integration_channels("account_name".to_string()) diff --git a/examples/v1_slack-integration_remove_slack_integration_channel.rs b/examples/v1_slack-integration_remove_slack_integration_channel.rs index dac767a6c..e5561136c 100644 --- a/examples/v1_slack-integration_remove_slack_integration_channel.rs +++ b/examples/v1_slack-integration_remove_slack_integration_channel.rs @@ -1,11 +1,11 @@ // Remove a Slack integration channel returns "The channel was removed // successfully." response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_slack_integration::SlackIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_slack_integration::SlackIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SlackIntegrationAPI::with_config(configuration); let resp = api .remove_slack_integration_channel("account_name".to_string(), "channel_name".to_string()) diff --git a/examples/v1_slack-integration_update_slack_integration_channel.rs b/examples/v1_slack-integration_update_slack_integration_channel.rs index 00fac246a..e84713c6f 100644 --- a/examples/v1_slack-integration_update_slack_integration_channel.rs +++ b/examples/v1_slack-integration_update_slack_integration_channel.rs @@ -1,6 +1,6 @@ // Update a Slack integration channel returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_slack_integration::SlackIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_slack_integration::SlackIntegrationAPI; use datadog_api_client::datadogV1::model::SlackIntegrationChannel; use datadog_api_client::datadogV1::model::SlackIntegrationChannelDisplay; @@ -15,7 +15,7 @@ async fn main() { .tags(true), ) .name("#general".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SlackIntegrationAPI::with_config(configuration); let resp = api .update_slack_integration_channel( diff --git a/examples/v1_snapshots_get_graph_snapshot.rs b/examples/v1_snapshots_get_graph_snapshot.rs index 1d1aed644..a84433a07 100644 --- a/examples/v1_snapshots_get_graph_snapshot.rs +++ b/examples/v1_snapshots_get_graph_snapshot.rs @@ -1,11 +1,11 @@ // Take graph snapshots returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_snapshots::GetGraphSnapshotOptionalParams; -use datadog_api_client::datadogV1::api::api_snapshots::SnapshotsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_snapshots::GetGraphSnapshotOptionalParams; +use datadog_api_client::datadogV1::api_snapshots::SnapshotsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SnapshotsAPI::with_config(configuration); let resp = api .get_graph_snapshot( diff --git a/examples/v1_synthetics_create_global_variable.rs b/examples/v1_synthetics_create_global_variable.rs index bab06d2b5..f054f539e 100644 --- a/examples/v1_synthetics_create_global_variable.rs +++ b/examples/v1_synthetics_create_global_variable.rs @@ -1,6 +1,6 @@ // Create a global variable returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsGlobalVariable; use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableAttributes; use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableParseTestOptions; @@ -35,7 +35,7 @@ async fn main() { ), ) .parse_test_public_id("abc-def-123".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.create_global_variable(body).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_create_global_variable_1068962881.rs b/examples/v1_synthetics_create_global_variable_1068962881.rs index 24f7f6d54..8a277f2cb 100644 --- a/examples/v1_synthetics_create_global_variable_1068962881.rs +++ b/examples/v1_synthetics_create_global_variable_1068962881.rs @@ -1,6 +1,6 @@ // Create a global variable from test returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsGlobalVariable; use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableOptions; use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableParseTestOptions; @@ -35,7 +35,7 @@ async fn main() { .local_variable_name("EXTRACTED_VALUE".to_string()), ) .parse_test_public_id(synthetics_api_test_multi_step_public_id.clone()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.create_global_variable(body).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_create_private_location.rs b/examples/v1_synthetics_create_private_location.rs index 9cc7d1d81..601827820 100644 --- a/examples/v1_synthetics_create_private_location.rs +++ b/examples/v1_synthetics_create_private_location.rs @@ -1,6 +1,6 @@ // Create a private location returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsPrivateLocation; use datadog_api_client::datadogV1::model::SyntheticsPrivateLocationMetadata; @@ -16,7 +16,7 @@ async fn main() { .metadata( SyntheticsPrivateLocationMetadata::new().restricted_roles(vec![role_data_id.clone()]), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.create_private_location(body).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_create_synthetics_api_test.rs b/examples/v1_synthetics_create_synthetics_api_test.rs index ea43f42b8..a3418a2d8 100644 --- a/examples/v1_synthetics_create_synthetics_api_test.rs +++ b/examples/v1_synthetics_create_synthetics_api_test.rs @@ -1,6 +1,6 @@ // Create an API test returns "OK - Returns the created test details." response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsAPITest; use datadog_api_client::datadogV1::model::SyntheticsAPITestConfig; use datadog_api_client::datadogV1::model::SyntheticsAPITestType; @@ -74,7 +74,7 @@ async fn main() { .status(SyntheticsTestPauseStatus::LIVE) .subtype(SyntheticsTestDetailsSubType::HTTP) .tags(vec!["env:production".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.create_synthetics_api_test(body).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_create_synthetics_api_test_1072503741.rs b/examples/v1_synthetics_create_synthetics_api_test_1072503741.rs index 20174c32b..4cc8e06c0 100644 --- a/examples/v1_synthetics_create_synthetics_api_test_1072503741.rs +++ b/examples/v1_synthetics_create_synthetics_api_test_1072503741.rs @@ -1,6 +1,6 @@ // Create an API SSL test returns "OK - Returns the created test details." response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsAPITest; use datadog_api_client::datadogV1::model::SyntheticsAPITestConfig; use datadog_api_client::datadogV1::model::SyntheticsAPITestType; @@ -40,7 +40,7 @@ async fn main() { ) .subtype(SyntheticsTestDetailsSubType::SSL) .tags(vec!["testing:api".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.create_synthetics_api_test(body).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_create_synthetics_api_test_1241981394.rs b/examples/v1_synthetics_create_synthetics_api_test_1241981394.rs index d7c77554a..099c673c1 100644 --- a/examples/v1_synthetics_create_synthetics_api_test_1241981394.rs +++ b/examples/v1_synthetics_create_synthetics_api_test_1241981394.rs @@ -1,7 +1,7 @@ // Create an API test with a file payload returns "OK - Returns the created test // details." response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsAPITest; use datadog_api_client::datadogV1::model::SyntheticsAPITestConfig; use datadog_api_client::datadogV1::model::SyntheticsAPITestType; @@ -158,7 +158,7 @@ async fn main() { ) .subtype(SyntheticsTestDetailsSubType::HTTP) .tags(vec!["testing:api".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.create_synthetics_api_test(body).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_create_synthetics_api_test_1279271422.rs b/examples/v1_synthetics_create_synthetics_api_test_1279271422.rs index 4dc7d2e5c..c33d7a441 100644 --- a/examples/v1_synthetics_create_synthetics_api_test_1279271422.rs +++ b/examples/v1_synthetics_create_synthetics_api_test_1279271422.rs @@ -1,7 +1,7 @@ // Create an API test with multi subtype returns "OK - Returns the created test // details." response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsAPIStep; use datadog_api_client::datadogV1::model::SyntheticsAPIStepSubtype; use datadog_api_client::datadogV1::model::SyntheticsAPITest; @@ -124,7 +124,7 @@ async fn main() { ) .subtype(SyntheticsTestDetailsSubType::MULTI) .tags(vec!["testing:api".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.create_synthetics_api_test(body).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_create_synthetics_api_test_1402674167.rs b/examples/v1_synthetics_create_synthetics_api_test_1402674167.rs index 36bd2bcb0..e2e02572b 100644 --- a/examples/v1_synthetics_create_synthetics_api_test_1402674167.rs +++ b/examples/v1_synthetics_create_synthetics_api_test_1402674167.rs @@ -1,7 +1,7 @@ // Create an API GRPC test returns "OK - Returns the created test details." // response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsAPITest; use datadog_api_client::datadogV1::model::SyntheticsAPITestConfig; use datadog_api_client::datadogV1::model::SyntheticsAPITestType; @@ -66,7 +66,7 @@ async fn main() { ) .subtype(SyntheticsTestDetailsSubType::GRPC) .tags(vec!["testing:api".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.create_synthetics_api_test(body).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_create_synthetics_api_test_1487281163.rs b/examples/v1_synthetics_create_synthetics_api_test_1487281163.rs index 4070b6c8a..627541fec 100644 --- a/examples/v1_synthetics_create_synthetics_api_test_1487281163.rs +++ b/examples/v1_synthetics_create_synthetics_api_test_1487281163.rs @@ -1,7 +1,7 @@ // Create an API HTTP test returns "OK - Returns the created test details." // response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsAPITest; use datadog_api_client::datadogV1::model::SyntheticsAPITestConfig; use datadog_api_client::datadogV1::model::SyntheticsAPITestType; @@ -151,7 +151,7 @@ async fn main() { ) .subtype(SyntheticsTestDetailsSubType::HTTP) .tags(vec!["testing:api".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.create_synthetics_api_test(body).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_create_synthetics_api_test_2472747642.rs b/examples/v1_synthetics_create_synthetics_api_test_2472747642.rs index 5edae9a1f..48bff2795 100644 --- a/examples/v1_synthetics_create_synthetics_api_test_2472747642.rs +++ b/examples/v1_synthetics_create_synthetics_api_test_2472747642.rs @@ -1,7 +1,7 @@ // Create an API test with WEBSOCKET subtype returns "OK - Returns the created // test details." response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsAPITest; use datadog_api_client::datadogV1::model::SyntheticsAPITestConfig; use datadog_api_client::datadogV1::model::SyntheticsAPITestType; @@ -62,7 +62,7 @@ async fn main() { ) .subtype(SyntheticsTestDetailsSubType::WEBSOCKET) .tags(vec!["testing:api".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.create_synthetics_api_test(body).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_create_synthetics_api_test_3829801148.rs b/examples/v1_synthetics_create_synthetics_api_test_3829801148.rs index 27308070d..bafdb423c 100644 --- a/examples/v1_synthetics_create_synthetics_api_test_3829801148.rs +++ b/examples/v1_synthetics_create_synthetics_api_test_3829801148.rs @@ -1,7 +1,7 @@ // Create an API test with UDP subtype returns "OK - Returns the created test // details." response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsAPITest; use datadog_api_client::datadogV1::model::SyntheticsAPITestConfig; use datadog_api_client::datadogV1::model::SyntheticsAPITestType; @@ -63,7 +63,7 @@ async fn main() { ) .subtype(SyntheticsTestDetailsSubType::UDP) .tags(vec!["testing:api".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.create_synthetics_api_test(body).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_create_synthetics_api_test_960766374.rs b/examples/v1_synthetics_create_synthetics_api_test_960766374.rs index 9b928ca82..ef69bc5ff 100644 --- a/examples/v1_synthetics_create_synthetics_api_test_960766374.rs +++ b/examples/v1_synthetics_create_synthetics_api_test_960766374.rs @@ -1,7 +1,7 @@ // Create an API HTTP with oauth-rop test returns "OK - Returns the created test // details." response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsAPITest; use datadog_api_client::datadogV1::model::SyntheticsAPITestConfig; use datadog_api_client::datadogV1::model::SyntheticsAPITestType; @@ -146,7 +146,7 @@ async fn main() { ) .subtype(SyntheticsTestDetailsSubType::HTTP) .tags(vec!["testing:api".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.create_synthetics_api_test(body).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_create_synthetics_browser_test.rs b/examples/v1_synthetics_create_synthetics_browser_test.rs index 75062625d..2e40eb856 100644 --- a/examples/v1_synthetics_create_synthetics_browser_test.rs +++ b/examples/v1_synthetics_create_synthetics_browser_test.rs @@ -1,6 +1,6 @@ // Create a browser test returns "OK - Returns the created test details." response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsBrowserTest; use datadog_api_client::datadogV1::model::SyntheticsBrowserTestConfig; use datadog_api_client::datadogV1::model::SyntheticsBrowserTestType; @@ -67,7 +67,7 @@ async fn main() { .params(BTreeMap::new()) .type_(SyntheticsStepType::REFRESH)]) .tags(vec!["testing:browser".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.create_synthetics_browser_test(body).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_create_synthetics_browser_test_2932742688.rs b/examples/v1_synthetics_create_synthetics_browser_test_2932742688.rs index c4bf317bb..0a6cab1d4 100644 --- a/examples/v1_synthetics_create_synthetics_browser_test_2932742688.rs +++ b/examples/v1_synthetics_create_synthetics_browser_test_2932742688.rs @@ -1,6 +1,6 @@ // Create a browser test returns "OK - Returns saved rumSettings." response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsBrowserTest; use datadog_api_client::datadogV1::model::SyntheticsBrowserTestConfig; use datadog_api_client::datadogV1::model::SyntheticsBrowserTestRumSettings; @@ -70,7 +70,7 @@ async fn main() { .params(BTreeMap::new()) .type_(SyntheticsStepType::REFRESH)]) .tags(vec!["testing:browser".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.create_synthetics_browser_test(body).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_create_synthetics_browser_test_397420811.rs b/examples/v1_synthetics_create_synthetics_browser_test_397420811.rs index c6ac56da7..8f8c35df9 100644 --- a/examples/v1_synthetics_create_synthetics_browser_test_397420811.rs +++ b/examples/v1_synthetics_create_synthetics_browser_test_397420811.rs @@ -1,7 +1,7 @@ // Create a browser test with advanced scheduling options returns "OK - Returns // the created test details." response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsBrowserTest; use datadog_api_client::datadogV1::model::SyntheticsBrowserTestConfig; use datadog_api_client::datadogV1::model::SyntheticsBrowserTestType; @@ -74,7 +74,7 @@ async fn main() { .params(BTreeMap::new()) .type_(SyntheticsStepType::REFRESH)]) .tags(vec!["testing:browser".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.create_synthetics_browser_test(body).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_delete_global_variable.rs b/examples/v1_synthetics_delete_global_variable.rs index 621dee60a..c1b072510 100644 --- a/examples/v1_synthetics_delete_global_variable.rs +++ b/examples/v1_synthetics_delete_global_variable.rs @@ -1,10 +1,10 @@ // Delete a global variable returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.delete_global_variable("variable_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_delete_private_location.rs b/examples/v1_synthetics_delete_private_location.rs index d8f40f14a..f992c357f 100644 --- a/examples/v1_synthetics_delete_private_location.rs +++ b/examples/v1_synthetics_delete_private_location.rs @@ -1,10 +1,10 @@ // Delete a private location returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.delete_private_location("location_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_delete_tests.rs b/examples/v1_synthetics_delete_tests.rs index 98295324f..67c961d81 100644 --- a/examples/v1_synthetics_delete_tests.rs +++ b/examples/v1_synthetics_delete_tests.rs @@ -1,6 +1,6 @@ // Delete tests returns "OK." response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsDeleteTestsPayload; #[tokio::main] @@ -9,7 +9,7 @@ async fn main() { let synthetics_api_test_public_id = std::env::var("SYNTHETICS_API_TEST_PUBLIC_ID").unwrap(); let body = SyntheticsDeleteTestsPayload::new().public_ids(vec![synthetics_api_test_public_id.clone()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.delete_tests(body).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_edit_global_variable.rs b/examples/v1_synthetics_edit_global_variable.rs index b29f7ab6d..8682af5bb 100644 --- a/examples/v1_synthetics_edit_global_variable.rs +++ b/examples/v1_synthetics_edit_global_variable.rs @@ -1,6 +1,6 @@ // Edit a global variable returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsGlobalVariable; use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableAttributes; use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableParseTestOptions; @@ -35,7 +35,7 @@ async fn main() { ), ) .parse_test_public_id("abc-def-123".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api .edit_global_variable("variable_id".to_string(), body) diff --git a/examples/v1_synthetics_get_api_test.rs b/examples/v1_synthetics_get_api_test.rs index 9434aaaa8..8ac66905f 100644 --- a/examples/v1_synthetics_get_api_test.rs +++ b/examples/v1_synthetics_get_api_test.rs @@ -1,10 +1,10 @@ // Get an API test returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.get_api_test("public_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_get_api_test_latest_results.rs b/examples/v1_synthetics_get_api_test_latest_results.rs index 5305d3d8d..414327ee9 100644 --- a/examples/v1_synthetics_get_api_test_latest_results.rs +++ b/examples/v1_synthetics_get_api_test_latest_results.rs @@ -1,11 +1,11 @@ // Get an API test's latest results summaries returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::GetAPITestLatestResultsOptionalParams; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::GetAPITestLatestResultsOptionalParams; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api .get_api_test_latest_results( diff --git a/examples/v1_synthetics_get_api_test_result.rs b/examples/v1_synthetics_get_api_test_result.rs index 89ca6478f..94ba317a6 100644 --- a/examples/v1_synthetics_get_api_test_result.rs +++ b/examples/v1_synthetics_get_api_test_result.rs @@ -1,10 +1,10 @@ // Get an API test result returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api .get_api_test_result("hwb-332-3xe".to_string(), "3420446318379485707".to_string()) diff --git a/examples/v1_synthetics_get_api_test_result_1321866518.rs b/examples/v1_synthetics_get_api_test_result_1321866518.rs index 6c2ff6f6c..1590b7bf3 100644 --- a/examples/v1_synthetics_get_api_test_result_1321866518.rs +++ b/examples/v1_synthetics_get_api_test_result_1321866518.rs @@ -1,6 +1,6 @@ // Get an API test result returns result with failure object -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; #[tokio::main] async fn main() { @@ -11,7 +11,7 @@ async fn main() { // the "synthetics_api_test_with_wrong_dns" is triggered let synthetics_api_test_with_wrong_dns_result_results_0_result_id = std::env::var("SYNTHETICS_API_TEST_WITH_WRONG_DNS_RESULT_RESULTS_0_RESULT_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api .get_api_test_result( diff --git a/examples/v1_synthetics_get_browser_test.rs b/examples/v1_synthetics_get_browser_test.rs index 48dcccc2f..c62ee12fa 100644 --- a/examples/v1_synthetics_get_browser_test.rs +++ b/examples/v1_synthetics_get_browser_test.rs @@ -1,10 +1,10 @@ // Get a browser test returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.get_browser_test("public_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_get_browser_test_latest_results.rs b/examples/v1_synthetics_get_browser_test_latest_results.rs index f4b83ddd2..605b12a2e 100644 --- a/examples/v1_synthetics_get_browser_test_latest_results.rs +++ b/examples/v1_synthetics_get_browser_test_latest_results.rs @@ -1,11 +1,11 @@ // Get a browser test's latest results summaries returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::GetBrowserTestLatestResultsOptionalParams; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::GetBrowserTestLatestResultsOptionalParams; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api .get_browser_test_latest_results( diff --git a/examples/v1_synthetics_get_browser_test_result.rs b/examples/v1_synthetics_get_browser_test_result.rs index 81d5e3195..3db90a5ba 100644 --- a/examples/v1_synthetics_get_browser_test_result.rs +++ b/examples/v1_synthetics_get_browser_test_result.rs @@ -1,10 +1,10 @@ // Get a browser test result returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api .get_browser_test_result("2yy-sem-mjh".to_string(), "5671719892074090418".to_string()) diff --git a/examples/v1_synthetics_get_global_variable.rs b/examples/v1_synthetics_get_global_variable.rs index 9edf03f2d..715392f01 100644 --- a/examples/v1_synthetics_get_global_variable.rs +++ b/examples/v1_synthetics_get_global_variable.rs @@ -1,10 +1,10 @@ // Get a global variable returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.get_global_variable("variable_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_get_private_location.rs b/examples/v1_synthetics_get_private_location.rs index 016d9c8ea..18b29ef04 100644 --- a/examples/v1_synthetics_get_private_location.rs +++ b/examples/v1_synthetics_get_private_location.rs @@ -1,10 +1,10 @@ // Get a private location returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.get_private_location("location_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_get_synthetics_ci_batch.rs b/examples/v1_synthetics_get_synthetics_ci_batch.rs index f771fea06..9ba1c7515 100644 --- a/examples/v1_synthetics_get_synthetics_ci_batch.rs +++ b/examples/v1_synthetics_get_synthetics_ci_batch.rs @@ -1,10 +1,10 @@ // Get details of batch returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.get_synthetics_ci_batch("batch_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_get_synthetics_default_locations.rs b/examples/v1_synthetics_get_synthetics_default_locations.rs index a8f9401e6..bca02f3e1 100644 --- a/examples/v1_synthetics_get_synthetics_default_locations.rs +++ b/examples/v1_synthetics_get_synthetics_default_locations.rs @@ -1,10 +1,10 @@ // Get the default locations returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.get_synthetics_default_locations().await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_get_synthetics_default_locations_746853380.rs b/examples/v1_synthetics_get_synthetics_default_locations_746853380.rs index 3b6156b5c..30069c09f 100644 --- a/examples/v1_synthetics_get_synthetics_default_locations_746853380.rs +++ b/examples/v1_synthetics_get_synthetics_default_locations_746853380.rs @@ -1,10 +1,10 @@ // Get the list of default locations returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.get_synthetics_default_locations().await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_get_test.rs b/examples/v1_synthetics_get_test.rs index 8ae361674..12d4a795c 100644 --- a/examples/v1_synthetics_get_test.rs +++ b/examples/v1_synthetics_get_test.rs @@ -1,10 +1,10 @@ // Get a test configuration returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.get_test("public_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_list_global_variables.rs b/examples/v1_synthetics_list_global_variables.rs index 45a2e28a4..1e473ef44 100644 --- a/examples/v1_synthetics_list_global_variables.rs +++ b/examples/v1_synthetics_list_global_variables.rs @@ -1,10 +1,10 @@ // Get all global variables returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.list_global_variables().await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_list_locations.rs b/examples/v1_synthetics_list_locations.rs index 24702f690..61f2b3c1f 100644 --- a/examples/v1_synthetics_list_locations.rs +++ b/examples/v1_synthetics_list_locations.rs @@ -1,10 +1,10 @@ // Get all locations (public and private) returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.list_locations().await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_list_tests.rs b/examples/v1_synthetics_list_tests.rs index e0d51cfd5..a4235b0b4 100644 --- a/examples/v1_synthetics_list_tests.rs +++ b/examples/v1_synthetics_list_tests.rs @@ -1,12 +1,12 @@ // Get the list of all Synthetic tests returns "OK - Returns the list of all // Synthetic tests." response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::ListTestsOptionalParams; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::ListTestsOptionalParams; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.list_tests(ListTestsOptionalParams::default()).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_list_tests_1938827783.rs b/examples/v1_synthetics_list_tests_1938827783.rs index 903f70481..2fe667c06 100644 --- a/examples/v1_synthetics_list_tests_1938827783.rs +++ b/examples/v1_synthetics_list_tests_1938827783.rs @@ -1,14 +1,14 @@ // Get the list of all Synthetic tests returns "OK - Returns the list of all // Synthetic tests." response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::ListTestsOptionalParams; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::ListTestsOptionalParams; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let response = api.list_tests_with_pagination(ListTestsOptionalParams::default().page_size(2)); pin_mut!(response); diff --git a/examples/v1_synthetics_list_tests_2779190961.rs b/examples/v1_synthetics_list_tests_2779190961.rs index 61a15c7bf..a27a9a9a2 100644 --- a/examples/v1_synthetics_list_tests_2779190961.rs +++ b/examples/v1_synthetics_list_tests_2779190961.rs @@ -1,11 +1,11 @@ // Client is resilient to enum and oneOf deserialization errors -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::ListTestsOptionalParams; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::ListTestsOptionalParams; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.list_tests(ListTestsOptionalParams::default()).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_patch_test.rs b/examples/v1_synthetics_patch_test.rs index 423a0b4c9..aabc80046 100644 --- a/examples/v1_synthetics_patch_test.rs +++ b/examples/v1_synthetics_patch_test.rs @@ -1,6 +1,6 @@ // Patch a Synthetic test returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsPatchTestBody; use datadog_api_client::datadogV1::model::SyntheticsPatchTestOperation; use datadog_api_client::datadogV1::model::SyntheticsPatchTestOperationName; @@ -19,7 +19,7 @@ async fn main() { .op(SyntheticsPatchTestOperationName::REMOVE) .path("/config/assertions/0".to_string()), ]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api .patch_test(synthetics_api_test_public_id.clone(), body) diff --git a/examples/v1_synthetics_trigger_ci_tests.rs b/examples/v1_synthetics_trigger_ci_tests.rs index 5d0acf1f7..495d5eff0 100644 --- a/examples/v1_synthetics_trigger_ci_tests.rs +++ b/examples/v1_synthetics_trigger_ci_tests.rs @@ -1,6 +1,6 @@ // Trigger tests from CI/CD pipelines returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsBasicAuth; use datadog_api_client::datadogV1::model::SyntheticsBasicAuthWeb; use datadog_api_client::datadogV1::model::SyntheticsBasicAuthWebType; @@ -32,7 +32,7 @@ async fn main() { .git(SyntheticsCIBatchMetadataGit::new()), ) .retry(SyntheticsTestOptionsRetry::new())]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.trigger_ci_tests(body).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_trigger_tests.rs b/examples/v1_synthetics_trigger_tests.rs index a1ba0e569..9510c3bf6 100644 --- a/examples/v1_synthetics_trigger_tests.rs +++ b/examples/v1_synthetics_trigger_tests.rs @@ -1,6 +1,6 @@ // Trigger Synthetic tests returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsTriggerBody; use datadog_api_client::datadogV1::model::SyntheticsTriggerTest; @@ -11,7 +11,7 @@ async fn main() { let body = SyntheticsTriggerBody::new(vec![SyntheticsTriggerTest::new( synthetics_api_test_public_id.clone(), )]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.trigger_tests(body).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_update_api_test.rs b/examples/v1_synthetics_update_api_test.rs index 7a833d1ec..eab4425c2 100644 --- a/examples/v1_synthetics_update_api_test.rs +++ b/examples/v1_synthetics_update_api_test.rs @@ -1,6 +1,6 @@ // Edit an API test returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsAPITest; use datadog_api_client::datadogV1::model::SyntheticsAPITestConfig; use datadog_api_client::datadogV1::model::SyntheticsAPITestType; @@ -109,7 +109,7 @@ async fn main() { .status(SyntheticsTestPauseStatus::LIVE) .subtype(SyntheticsTestDetailsSubType::HTTP) .tags(vec!["testing:api".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api .update_api_test(synthetics_api_test_public_id.clone(), body) diff --git a/examples/v1_synthetics_update_browser_test.rs b/examples/v1_synthetics_update_browser_test.rs index 294787344..71ef67695 100644 --- a/examples/v1_synthetics_update_browser_test.rs +++ b/examples/v1_synthetics_update_browser_test.rs @@ -1,6 +1,6 @@ // Edit a browser test returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsBasicAuth; use datadog_api_client::datadogV1::model::SyntheticsBasicAuthWeb; use datadog_api_client::datadogV1::model::SyntheticsBasicAuthWebType; @@ -104,7 +104,7 @@ async fn main() { SyntheticsStep::new().type_(SyntheticsStepType::ASSERT_ELEMENT_CONTENT) ]) .tags(vec!["env:prod".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.update_browser_test("public_id".to_string(), body).await; if let Ok(value) = resp { diff --git a/examples/v1_synthetics_update_private_location.rs b/examples/v1_synthetics_update_private_location.rs index 8babac472..ede748e38 100644 --- a/examples/v1_synthetics_update_private_location.rs +++ b/examples/v1_synthetics_update_private_location.rs @@ -1,6 +1,6 @@ // Edit a private location returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsPrivateLocation; use datadog_api_client::datadogV1::model::SyntheticsPrivateLocationMetadata; @@ -15,7 +15,7 @@ async fn main() { SyntheticsPrivateLocationMetadata::new() .restricted_roles(vec!["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string()]), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api .update_private_location("location_id".to_string(), body) diff --git a/examples/v1_synthetics_update_test_pause_status.rs b/examples/v1_synthetics_update_test_pause_status.rs index 061054173..4771bfcc1 100644 --- a/examples/v1_synthetics_update_test_pause_status.rs +++ b/examples/v1_synthetics_update_test_pause_status.rs @@ -1,7 +1,7 @@ // Pause or start a test returns "OK - Returns a boolean indicating if the update // was successful." response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV1::model::SyntheticsTestPauseStatus; use datadog_api_client::datadogV1::model::SyntheticsUpdateTestPauseStatusPayload; @@ -9,7 +9,7 @@ use datadog_api_client::datadogV1::model::SyntheticsUpdateTestPauseStatusPayload async fn main() { let body = SyntheticsUpdateTestPauseStatusPayload::new().new_status(SyntheticsTestPauseStatus::LIVE); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api .update_test_pause_status("public_id".to_string(), body) diff --git a/examples/v1_tags_create_host_tags.rs b/examples/v1_tags_create_host_tags.rs index 7c08218fe..57a9d0353 100644 --- a/examples/v1_tags_create_host_tags.rs +++ b/examples/v1_tags_create_host_tags.rs @@ -1,7 +1,7 @@ // Add tags to a host returns "Created" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_tags::CreateHostTagsOptionalParams; -use datadog_api_client::datadogV1::api::api_tags::TagsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_tags::CreateHostTagsOptionalParams; +use datadog_api_client::datadogV1::api_tags::TagsAPI; use datadog_api_client::datadogV1::model::HostTags; #[tokio::main] @@ -9,7 +9,7 @@ async fn main() { let body = HostTags::new() .host("test.host".to_string()) .tags(vec!["environment:production".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TagsAPI::with_config(configuration); let resp = api .create_host_tags( diff --git a/examples/v1_tags_delete_host_tags.rs b/examples/v1_tags_delete_host_tags.rs index d5ae94368..114c8c06c 100644 --- a/examples/v1_tags_delete_host_tags.rs +++ b/examples/v1_tags_delete_host_tags.rs @@ -1,11 +1,11 @@ // Remove host tags returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_tags::DeleteHostTagsOptionalParams; -use datadog_api_client::datadogV1::api::api_tags::TagsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_tags::DeleteHostTagsOptionalParams; +use datadog_api_client::datadogV1::api_tags::TagsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TagsAPI::with_config(configuration); let resp = api .delete_host_tags( diff --git a/examples/v1_tags_get_host_tags.rs b/examples/v1_tags_get_host_tags.rs index 25c9157e5..9f03e66e4 100644 --- a/examples/v1_tags_get_host_tags.rs +++ b/examples/v1_tags_get_host_tags.rs @@ -1,11 +1,11 @@ // Get host tags returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_tags::GetHostTagsOptionalParams; -use datadog_api_client::datadogV1::api::api_tags::TagsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_tags::GetHostTagsOptionalParams; +use datadog_api_client::datadogV1::api_tags::TagsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TagsAPI::with_config(configuration); let resp = api .get_host_tags( diff --git a/examples/v1_tags_list_host_tags.rs b/examples/v1_tags_list_host_tags.rs index f24fe0c0d..982cddb17 100644 --- a/examples/v1_tags_list_host_tags.rs +++ b/examples/v1_tags_list_host_tags.rs @@ -1,11 +1,11 @@ // Get Tags returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_tags::ListHostTagsOptionalParams; -use datadog_api_client::datadogV1::api::api_tags::TagsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_tags::ListHostTagsOptionalParams; +use datadog_api_client::datadogV1::api_tags::TagsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TagsAPI::with_config(configuration); let resp = api .list_host_tags(ListHostTagsOptionalParams::default()) diff --git a/examples/v1_tags_update_host_tags.rs b/examples/v1_tags_update_host_tags.rs index 49c3d1356..7e1c24992 100644 --- a/examples/v1_tags_update_host_tags.rs +++ b/examples/v1_tags_update_host_tags.rs @@ -1,7 +1,7 @@ // Update host tags returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_tags::TagsAPI; -use datadog_api_client::datadogV1::api::api_tags::UpdateHostTagsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_tags::TagsAPI; +use datadog_api_client::datadogV1::api_tags::UpdateHostTagsOptionalParams; use datadog_api_client::datadogV1::model::HostTags; #[tokio::main] @@ -9,7 +9,7 @@ async fn main() { let body = HostTags::new() .host("test.host".to_string()) .tags(vec!["environment:production".to_string()]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TagsAPI::with_config(configuration); let resp = api .update_host_tags( diff --git a/examples/v1_usage-metering_get_daily_custom_reports.rs b/examples/v1_usage-metering_get_daily_custom_reports.rs index f081fb9f5..78dae0ad5 100644 --- a/examples/v1_usage-metering_get_daily_custom_reports.rs +++ b/examples/v1_usage-metering_get_daily_custom_reports.rs @@ -1,11 +1,11 @@ // Get the list of available daily custom reports returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetDailyCustomReportsOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetDailyCustomReportsOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_daily_custom_reports(GetDailyCustomReportsOptionalParams::default()) diff --git a/examples/v1_usage-metering_get_hourly_usage_attribution.rs b/examples/v1_usage-metering_get_hourly_usage_attribution.rs index f47a64334..42691d155 100644 --- a/examples/v1_usage-metering_get_hourly_usage_attribution.rs +++ b/examples/v1_usage-metering_get_hourly_usage_attribution.rs @@ -1,12 +1,12 @@ // Get hourly usage attribution returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetHourlyUsageAttributionOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetHourlyUsageAttributionOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; use datadog_api_client::datadogV1::model::HourlyUsageAttributionUsageType; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_hourly_usage_attribution( diff --git a/examples/v1_usage-metering_get_incident_management.rs b/examples/v1_usage-metering_get_incident_management.rs index e007a726a..1312cf75e 100644 --- a/examples/v1_usage-metering_get_incident_management.rs +++ b/examples/v1_usage-metering_get_incident_management.rs @@ -1,11 +1,11 @@ // Get hourly usage for incident management returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetIncidentManagementOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetIncidentManagementOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_incident_management( diff --git a/examples/v1_usage-metering_get_ingested_spans.rs b/examples/v1_usage-metering_get_ingested_spans.rs index 4dc916252..99f52c4ea 100644 --- a/examples/v1_usage-metering_get_ingested_spans.rs +++ b/examples/v1_usage-metering_get_ingested_spans.rs @@ -1,11 +1,11 @@ // Get hourly usage for ingested spans returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetIngestedSpansOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetIngestedSpansOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_ingested_spans( diff --git a/examples/v1_usage-metering_get_monthly_custom_reports.rs b/examples/v1_usage-metering_get_monthly_custom_reports.rs index 2e73f3fb8..6147af11c 100644 --- a/examples/v1_usage-metering_get_monthly_custom_reports.rs +++ b/examples/v1_usage-metering_get_monthly_custom_reports.rs @@ -1,11 +1,11 @@ // Get the list of available monthly custom reports returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetMonthlyCustomReportsOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetMonthlyCustomReportsOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_monthly_custom_reports(GetMonthlyCustomReportsOptionalParams::default()) diff --git a/examples/v1_usage-metering_get_monthly_usage_attribution.rs b/examples/v1_usage-metering_get_monthly_usage_attribution.rs index 7295d5a89..b0d73ae60 100644 --- a/examples/v1_usage-metering_get_monthly_usage_attribution.rs +++ b/examples/v1_usage-metering_get_monthly_usage_attribution.rs @@ -1,12 +1,12 @@ // Get monthly usage attribution returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetMonthlyUsageAttributionOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetMonthlyUsageAttributionOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; use datadog_api_client::datadogV1::model::MonthlyUsageAttributionSupportedMetrics; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_monthly_usage_attribution( diff --git a/examples/v1_usage-metering_get_monthly_usage_attribution_3849653599.rs b/examples/v1_usage-metering_get_monthly_usage_attribution_3849653599.rs index de8bc7484..5a47f1dff 100644 --- a/examples/v1_usage-metering_get_monthly_usage_attribution_3849653599.rs +++ b/examples/v1_usage-metering_get_monthly_usage_attribution_3849653599.rs @@ -1,7 +1,7 @@ // Paginate monthly usage attribution -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetMonthlyUsageAttributionOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetMonthlyUsageAttributionOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; use datadog_api_client::datadogV1::model::MonthlyUsageAttributionSupportedMetrics; #[tokio::main] @@ -9,7 +9,7 @@ async fn main() { // there is a valid "monthly_usage_attribution" response let monthly_usage_attribution_metadata_pagination_next_record_id = std::env::var("MONTHLY_USAGE_ATTRIBUTION_METADATA_PAGINATION_NEXT_RECORD_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_monthly_usage_attribution( diff --git a/examples/v1_usage-metering_get_specified_daily_custom_reports.rs b/examples/v1_usage-metering_get_specified_daily_custom_reports.rs index 6546b2ae0..2f66fce9d 100644 --- a/examples/v1_usage-metering_get_specified_daily_custom_reports.rs +++ b/examples/v1_usage-metering_get_specified_daily_custom_reports.rs @@ -1,10 +1,10 @@ // Get specified daily custom reports returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_specified_daily_custom_reports("2022-03-20".to_string()) diff --git a/examples/v1_usage-metering_get_specified_monthly_custom_reports.rs b/examples/v1_usage-metering_get_specified_monthly_custom_reports.rs index 09d70d84c..c17b846c1 100644 --- a/examples/v1_usage-metering_get_specified_monthly_custom_reports.rs +++ b/examples/v1_usage-metering_get_specified_monthly_custom_reports.rs @@ -1,10 +1,10 @@ // Get specified monthly custom reports returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_specified_monthly_custom_reports("2021-05-01".to_string()) diff --git a/examples/v1_usage-metering_get_usage_analyzed_logs.rs b/examples/v1_usage-metering_get_usage_analyzed_logs.rs index 435c71a2b..7b5e7be14 100644 --- a/examples/v1_usage-metering_get_usage_analyzed_logs.rs +++ b/examples/v1_usage-metering_get_usage_analyzed_logs.rs @@ -1,11 +1,11 @@ // Get hourly usage for analyzed logs returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageAnalyzedLogsOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageAnalyzedLogsOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_analyzed_logs( diff --git a/examples/v1_usage-metering_get_usage_audit_logs.rs b/examples/v1_usage-metering_get_usage_audit_logs.rs index 5f391d151..17fb6995a 100644 --- a/examples/v1_usage-metering_get_usage_audit_logs.rs +++ b/examples/v1_usage-metering_get_usage_audit_logs.rs @@ -1,11 +1,11 @@ // Get hourly usage for audit logs returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageAuditLogsOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageAuditLogsOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_audit_logs( diff --git a/examples/v1_usage-metering_get_usage_billable_summary.rs b/examples/v1_usage-metering_get_usage_billable_summary.rs index e6e82cd6e..236910a5c 100644 --- a/examples/v1_usage-metering_get_usage_billable_summary.rs +++ b/examples/v1_usage-metering_get_usage_billable_summary.rs @@ -1,11 +1,11 @@ // Get billable usage across your account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageBillableSummaryOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageBillableSummaryOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_billable_summary(GetUsageBillableSummaryOptionalParams::default()) diff --git a/examples/v1_usage-metering_get_usage_ci_app.rs b/examples/v1_usage-metering_get_usage_ci_app.rs index 9d82bbc5c..412f3da9a 100644 --- a/examples/v1_usage-metering_get_usage_ci_app.rs +++ b/examples/v1_usage-metering_get_usage_ci_app.rs @@ -1,11 +1,11 @@ // Get hourly usage for CI visibility returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageCIAppOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageCIAppOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_ci_app( diff --git a/examples/v1_usage-metering_get_usage_cloud_security_posture_management.rs b/examples/v1_usage-metering_get_usage_cloud_security_posture_management.rs index 5753f01e3..995fb6a7a 100644 --- a/examples/v1_usage-metering_get_usage_cloud_security_posture_management.rs +++ b/examples/v1_usage-metering_get_usage_cloud_security_posture_management.rs @@ -1,11 +1,11 @@ // Get hourly usage for CSM Pro returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageCloudSecurityPostureManagementOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageCloudSecurityPostureManagementOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_cloud_security_posture_management( diff --git a/examples/v1_usage-metering_get_usage_cws.rs b/examples/v1_usage-metering_get_usage_cws.rs index ecc9fcbf9..a0c645ef2 100644 --- a/examples/v1_usage-metering_get_usage_cws.rs +++ b/examples/v1_usage-metering_get_usage_cws.rs @@ -1,11 +1,11 @@ // Get hourly usage for cloud workload security returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageCWSOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageCWSOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_cws( diff --git a/examples/v1_usage-metering_get_usage_dbm.rs b/examples/v1_usage-metering_get_usage_dbm.rs index 9145b7769..45f91dca5 100644 --- a/examples/v1_usage-metering_get_usage_dbm.rs +++ b/examples/v1_usage-metering_get_usage_dbm.rs @@ -1,11 +1,11 @@ // Get hourly usage for database monitoring returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageDBMOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageDBMOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_dbm( diff --git a/examples/v1_usage-metering_get_usage_dbm_3446806203.rs b/examples/v1_usage-metering_get_usage_dbm_3446806203.rs index e55484831..efe3e8c31 100644 --- a/examples/v1_usage-metering_get_usage_dbm_3446806203.rs +++ b/examples/v1_usage-metering_get_usage_dbm_3446806203.rs @@ -1,11 +1,11 @@ // Get hourly usage for Database Monitoring returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageDBMOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageDBMOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_dbm( diff --git a/examples/v1_usage-metering_get_usage_fargate.rs b/examples/v1_usage-metering_get_usage_fargate.rs index 3d23ed3ca..b98627b7a 100644 --- a/examples/v1_usage-metering_get_usage_fargate.rs +++ b/examples/v1_usage-metering_get_usage_fargate.rs @@ -1,11 +1,11 @@ // Get hourly usage for Fargate returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageFargateOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageFargateOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_fargate( diff --git a/examples/v1_usage-metering_get_usage_hosts.rs b/examples/v1_usage-metering_get_usage_hosts.rs index 17ad88667..20dfebafb 100644 --- a/examples/v1_usage-metering_get_usage_hosts.rs +++ b/examples/v1_usage-metering_get_usage_hosts.rs @@ -1,11 +1,11 @@ // Get hourly usage for hosts and containers returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageHostsOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageHostsOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_hosts( diff --git a/examples/v1_usage-metering_get_usage_indexed_spans.rs b/examples/v1_usage-metering_get_usage_indexed_spans.rs index 8175b43c9..4cab86609 100644 --- a/examples/v1_usage-metering_get_usage_indexed_spans.rs +++ b/examples/v1_usage-metering_get_usage_indexed_spans.rs @@ -1,11 +1,11 @@ // Get hourly usage for indexed spans returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageIndexedSpansOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageIndexedSpansOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_indexed_spans( diff --git a/examples/v1_usage-metering_get_usage_internet_of_things.rs b/examples/v1_usage-metering_get_usage_internet_of_things.rs index 70a065cae..3fcffdf90 100644 --- a/examples/v1_usage-metering_get_usage_internet_of_things.rs +++ b/examples/v1_usage-metering_get_usage_internet_of_things.rs @@ -1,11 +1,11 @@ // Get hourly usage for IoT returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageInternetOfThingsOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageInternetOfThingsOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_internet_of_things( diff --git a/examples/v1_usage-metering_get_usage_lambda.rs b/examples/v1_usage-metering_get_usage_lambda.rs index aad0fd21d..cab9a6524 100644 --- a/examples/v1_usage-metering_get_usage_lambda.rs +++ b/examples/v1_usage-metering_get_usage_lambda.rs @@ -1,11 +1,11 @@ // Get hourly usage for Lambda returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageLambdaOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageLambdaOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_lambda( diff --git a/examples/v1_usage-metering_get_usage_logs.rs b/examples/v1_usage-metering_get_usage_logs.rs index 9d0b1f912..99a44080b 100644 --- a/examples/v1_usage-metering_get_usage_logs.rs +++ b/examples/v1_usage-metering_get_usage_logs.rs @@ -1,11 +1,11 @@ // Get hourly usage for logs returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageLogsOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageLogsOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_logs( diff --git a/examples/v1_usage-metering_get_usage_logs_2562396405.rs b/examples/v1_usage-metering_get_usage_logs_2562396405.rs index 882724374..cddc7bee2 100644 --- a/examples/v1_usage-metering_get_usage_logs_2562396405.rs +++ b/examples/v1_usage-metering_get_usage_logs_2562396405.rs @@ -1,11 +1,11 @@ // Get hourly usage for Logs returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageLogsOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageLogsOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_logs( diff --git a/examples/v1_usage-metering_get_usage_logs_by_index.rs b/examples/v1_usage-metering_get_usage_logs_by_index.rs index a44d28ea0..bfd8308ae 100644 --- a/examples/v1_usage-metering_get_usage_logs_by_index.rs +++ b/examples/v1_usage-metering_get_usage_logs_by_index.rs @@ -1,11 +1,11 @@ // Get hourly usage for logs by index returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageLogsByIndexOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageLogsByIndexOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_logs_by_index( diff --git a/examples/v1_usage-metering_get_usage_logs_by_index_1025184776.rs b/examples/v1_usage-metering_get_usage_logs_by_index_1025184776.rs index 9c1fb44f3..cfcbc2dce 100644 --- a/examples/v1_usage-metering_get_usage_logs_by_index_1025184776.rs +++ b/examples/v1_usage-metering_get_usage_logs_by_index_1025184776.rs @@ -1,11 +1,11 @@ // Get hourly usage for Logs by Index returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageLogsByIndexOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageLogsByIndexOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_logs_by_index( diff --git a/examples/v1_usage-metering_get_usage_logs_by_retention.rs b/examples/v1_usage-metering_get_usage_logs_by_retention.rs index 31f42cf25..dac09c30b 100644 --- a/examples/v1_usage-metering_get_usage_logs_by_retention.rs +++ b/examples/v1_usage-metering_get_usage_logs_by_retention.rs @@ -1,11 +1,11 @@ // Get hourly logs usage by retention returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageLogsByRetentionOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageLogsByRetentionOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_logs_by_retention( diff --git a/examples/v1_usage-metering_get_usage_network_flows.rs b/examples/v1_usage-metering_get_usage_network_flows.rs index c3a74b2c4..56d6e587a 100644 --- a/examples/v1_usage-metering_get_usage_network_flows.rs +++ b/examples/v1_usage-metering_get_usage_network_flows.rs @@ -1,11 +1,11 @@ // get hourly usage for network flows returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageNetworkFlowsOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageNetworkFlowsOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_network_flows( diff --git a/examples/v1_usage-metering_get_usage_network_flows_1239422069.rs b/examples/v1_usage-metering_get_usage_network_flows_1239422069.rs index 137cb59b8..862c1982f 100644 --- a/examples/v1_usage-metering_get_usage_network_flows_1239422069.rs +++ b/examples/v1_usage-metering_get_usage_network_flows_1239422069.rs @@ -1,11 +1,11 @@ // Get hourly usage for Network Flows returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageNetworkFlowsOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageNetworkFlowsOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_network_flows( diff --git a/examples/v1_usage-metering_get_usage_network_hosts.rs b/examples/v1_usage-metering_get_usage_network_hosts.rs index 39a6a5d6d..375942d3e 100644 --- a/examples/v1_usage-metering_get_usage_network_hosts.rs +++ b/examples/v1_usage-metering_get_usage_network_hosts.rs @@ -1,11 +1,11 @@ // Get hourly usage for network hosts returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageNetworkHostsOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageNetworkHostsOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_network_hosts( diff --git a/examples/v1_usage-metering_get_usage_network_hosts_1249907835.rs b/examples/v1_usage-metering_get_usage_network_hosts_1249907835.rs index a8f0399bd..9fcb23dcc 100644 --- a/examples/v1_usage-metering_get_usage_network_hosts_1249907835.rs +++ b/examples/v1_usage-metering_get_usage_network_hosts_1249907835.rs @@ -1,11 +1,11 @@ // Get hourly usage for Network Hosts returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageNetworkHostsOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageNetworkHostsOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_network_hosts( diff --git a/examples/v1_usage-metering_get_usage_online_archive.rs b/examples/v1_usage-metering_get_usage_online_archive.rs index 226bcaa8d..4d4c63534 100644 --- a/examples/v1_usage-metering_get_usage_online_archive.rs +++ b/examples/v1_usage-metering_get_usage_online_archive.rs @@ -1,11 +1,11 @@ // Get hourly usage for online archive returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageOnlineArchiveOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageOnlineArchiveOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_online_archive( diff --git a/examples/v1_usage-metering_get_usage_online_archive_1501172903.rs b/examples/v1_usage-metering_get_usage_online_archive_1501172903.rs index b10fdc62a..1438c8061 100644 --- a/examples/v1_usage-metering_get_usage_online_archive_1501172903.rs +++ b/examples/v1_usage-metering_get_usage_online_archive_1501172903.rs @@ -1,11 +1,11 @@ // Get hourly usage for Online Archive returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageOnlineArchiveOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageOnlineArchiveOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_online_archive( diff --git a/examples/v1_usage-metering_get_usage_profiling.rs b/examples/v1_usage-metering_get_usage_profiling.rs index 0b6c6904b..91648cc7b 100644 --- a/examples/v1_usage-metering_get_usage_profiling.rs +++ b/examples/v1_usage-metering_get_usage_profiling.rs @@ -1,11 +1,11 @@ // Get hourly usage for profiled hosts returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageProfilingOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageProfilingOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_profiling( diff --git a/examples/v1_usage-metering_get_usage_rum_sessions.rs b/examples/v1_usage-metering_get_usage_rum_sessions.rs index 950ed91a3..8ceef406d 100644 --- a/examples/v1_usage-metering_get_usage_rum_sessions.rs +++ b/examples/v1_usage-metering_get_usage_rum_sessions.rs @@ -1,11 +1,11 @@ // Get hourly usage for RUM sessions returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageRumSessionsOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageRumSessionsOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_rum_sessions( diff --git a/examples/v1_usage-metering_get_usage_rum_sessions_3271366243.rs b/examples/v1_usage-metering_get_usage_rum_sessions_3271366243.rs index 4142a81c1..3ba8275c7 100644 --- a/examples/v1_usage-metering_get_usage_rum_sessions_3271366243.rs +++ b/examples/v1_usage-metering_get_usage_rum_sessions_3271366243.rs @@ -1,11 +1,11 @@ // Get mobile hourly usage for RUM Sessions returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageRumSessionsOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageRumSessionsOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_rum_sessions( diff --git a/examples/v1_usage-metering_get_usage_rum_sessions_714937291.rs b/examples/v1_usage-metering_get_usage_rum_sessions_714937291.rs index afb1d871f..50606d7ef 100644 --- a/examples/v1_usage-metering_get_usage_rum_sessions_714937291.rs +++ b/examples/v1_usage-metering_get_usage_rum_sessions_714937291.rs @@ -1,11 +1,11 @@ // Get hourly usage for RUM Sessions returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageRumSessionsOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageRumSessionsOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_rum_sessions( diff --git a/examples/v1_usage-metering_get_usage_rum_units.rs b/examples/v1_usage-metering_get_usage_rum_units.rs index bcd3e9431..39dd71cb1 100644 --- a/examples/v1_usage-metering_get_usage_rum_units.rs +++ b/examples/v1_usage-metering_get_usage_rum_units.rs @@ -1,11 +1,11 @@ // Get hourly usage for RUM units returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageRumUnitsOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageRumUnitsOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_rum_units( diff --git a/examples/v1_usage-metering_get_usage_rum_units_3959755399.rs b/examples/v1_usage-metering_get_usage_rum_units_3959755399.rs index 5cd84939c..c72a144b7 100644 --- a/examples/v1_usage-metering_get_usage_rum_units_3959755399.rs +++ b/examples/v1_usage-metering_get_usage_rum_units_3959755399.rs @@ -1,11 +1,11 @@ // Get hourly usage for RUM Units returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageRumUnitsOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageRumUnitsOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_rum_units( diff --git a/examples/v1_usage-metering_get_usage_sds.rs b/examples/v1_usage-metering_get_usage_sds.rs index df47e05b8..43de483df 100644 --- a/examples/v1_usage-metering_get_usage_sds.rs +++ b/examples/v1_usage-metering_get_usage_sds.rs @@ -1,11 +1,11 @@ // Get hourly usage for sensitive data scanner returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageSDSOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageSDSOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_sds( diff --git a/examples/v1_usage-metering_get_usage_sds_271128478.rs b/examples/v1_usage-metering_get_usage_sds_271128478.rs index 63f5346f9..e21379532 100644 --- a/examples/v1_usage-metering_get_usage_sds_271128478.rs +++ b/examples/v1_usage-metering_get_usage_sds_271128478.rs @@ -1,11 +1,11 @@ // Get hourly usage for Sensitive Data Scanner returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageSDSOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageSDSOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_sds( diff --git a/examples/v1_usage-metering_get_usage_snmp.rs b/examples/v1_usage-metering_get_usage_snmp.rs index d143a856e..dfdfaea0c 100644 --- a/examples/v1_usage-metering_get_usage_snmp.rs +++ b/examples/v1_usage-metering_get_usage_snmp.rs @@ -1,11 +1,11 @@ // Get hourly usage for SNMP devices returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageSNMPOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageSNMPOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_snmp( diff --git a/examples/v1_usage-metering_get_usage_summary.rs b/examples/v1_usage-metering_get_usage_summary.rs index 9938ca898..e6ccd818d 100644 --- a/examples/v1_usage-metering_get_usage_summary.rs +++ b/examples/v1_usage-metering_get_usage_summary.rs @@ -1,11 +1,11 @@ // Get usage across your account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageSummaryOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageSummaryOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_summary( diff --git a/examples/v1_usage-metering_get_usage_synthetics.rs b/examples/v1_usage-metering_get_usage_synthetics.rs index 615872c64..28be42241 100644 --- a/examples/v1_usage-metering_get_usage_synthetics.rs +++ b/examples/v1_usage-metering_get_usage_synthetics.rs @@ -1,11 +1,11 @@ // Get hourly usage for synthetics checks returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageSyntheticsOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageSyntheticsOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_synthetics( diff --git a/examples/v1_usage-metering_get_usage_synthetics_api.rs b/examples/v1_usage-metering_get_usage_synthetics_api.rs index be1a2bb7e..1372d70f1 100644 --- a/examples/v1_usage-metering_get_usage_synthetics_api.rs +++ b/examples/v1_usage-metering_get_usage_synthetics_api.rs @@ -1,11 +1,11 @@ // Get hourly usage for synthetics API checks returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageSyntheticsAPIOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageSyntheticsAPIOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_synthetics_api( diff --git a/examples/v1_usage-metering_get_usage_synthetics_api_4048033529.rs b/examples/v1_usage-metering_get_usage_synthetics_api_4048033529.rs index f8cccb41c..665c1b61c 100644 --- a/examples/v1_usage-metering_get_usage_synthetics_api_4048033529.rs +++ b/examples/v1_usage-metering_get_usage_synthetics_api_4048033529.rs @@ -1,11 +1,11 @@ // Get hourly usage for Synthetics API Checks returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageSyntheticsAPIOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageSyntheticsAPIOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_synthetics_api( diff --git a/examples/v1_usage-metering_get_usage_synthetics_browser.rs b/examples/v1_usage-metering_get_usage_synthetics_browser.rs index e191749b7..d542e4d9f 100644 --- a/examples/v1_usage-metering_get_usage_synthetics_browser.rs +++ b/examples/v1_usage-metering_get_usage_synthetics_browser.rs @@ -1,11 +1,11 @@ // Get hourly usage for synthetics browser checks returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageSyntheticsBrowserOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageSyntheticsBrowserOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_synthetics_browser( diff --git a/examples/v1_usage-metering_get_usage_synthetics_browser_1704663299.rs b/examples/v1_usage-metering_get_usage_synthetics_browser_1704663299.rs index 0540deeda..72a1e678d 100644 --- a/examples/v1_usage-metering_get_usage_synthetics_browser_1704663299.rs +++ b/examples/v1_usage-metering_get_usage_synthetics_browser_1704663299.rs @@ -1,11 +1,11 @@ // Get hourly usage for Synthetics Browser Checks returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageSyntheticsBrowserOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageSyntheticsBrowserOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_synthetics_browser( diff --git a/examples/v1_usage-metering_get_usage_timeseries.rs b/examples/v1_usage-metering_get_usage_timeseries.rs index 7f8a2c570..3289d70f0 100644 --- a/examples/v1_usage-metering_get_usage_timeseries.rs +++ b/examples/v1_usage-metering_get_usage_timeseries.rs @@ -1,11 +1,11 @@ // Get hourly usage for custom metrics returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageTimeseriesOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageTimeseriesOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_timeseries( diff --git a/examples/v1_usage-metering_get_usage_top_avg_metrics.rs b/examples/v1_usage-metering_get_usage_top_avg_metrics.rs index e73378bf1..1c742031a 100644 --- a/examples/v1_usage-metering_get_usage_top_avg_metrics.rs +++ b/examples/v1_usage-metering_get_usage_top_avg_metrics.rs @@ -1,11 +1,11 @@ // Get all custom metrics by hourly average returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageTopAvgMetricsOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_usage_metering::GetUsageTopAvgMetricsOptionalParams; +use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_top_avg_metrics( diff --git a/examples/v1_users_create_user.rs b/examples/v1_users_create_user.rs index 43ac8423e..d698f91f0 100644 --- a/examples/v1_users_create_user.rs +++ b/examples/v1_users_create_user.rs @@ -1,6 +1,6 @@ // Create a user returns "User created" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_users::UsersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_users::UsersAPI; use datadog_api_client::datadogV1::model::AccessRole; use datadog_api_client::datadogV1::model::User; @@ -12,7 +12,7 @@ async fn main() { .email("test@datadoghq.com".to_string()) .handle("test@datadoghq.com".to_string()) .name("test user".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsersAPI::with_config(configuration); let resp = api.create_user(body).await; if let Ok(value) = resp { diff --git a/examples/v1_users_create_user_266604071.rs b/examples/v1_users_create_user_266604071.rs index b63522a57..3ffa62902 100644 --- a/examples/v1_users_create_user_266604071.rs +++ b/examples/v1_users_create_user_266604071.rs @@ -1,6 +1,6 @@ // Create a user returns null access role -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_users::UsersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_users::UsersAPI; use datadog_api_client::datadogV1::model::User; #[tokio::main] @@ -11,7 +11,7 @@ async fn main() { .email("test@datadoghq.com".to_string()) .handle("test@datadoghq.com".to_string()) .name("test user".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsersAPI::with_config(configuration); let resp = api.create_user(body).await; if let Ok(value) = resp { diff --git a/examples/v1_users_disable_user.rs b/examples/v1_users_disable_user.rs index 993589e73..fa4b2f89d 100644 --- a/examples/v1_users_disable_user.rs +++ b/examples/v1_users_disable_user.rs @@ -1,10 +1,10 @@ // Disable a user returns "User disabled" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_users::UsersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_users::UsersAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsersAPI::with_config(configuration); let resp = api.disable_user("test@datadoghq.com".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_users_get_user.rs b/examples/v1_users_get_user.rs index 87f0129dd..8d7c51f59 100644 --- a/examples/v1_users_get_user.rs +++ b/examples/v1_users_get_user.rs @@ -1,10 +1,10 @@ // Get user details returns "OK for get user" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_users::UsersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_users::UsersAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsersAPI::with_config(configuration); let resp = api.get_user("test@datadoghq.com".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v1_users_list_users.rs b/examples/v1_users_list_users.rs index faa83cb27..7604df92e 100644 --- a/examples/v1_users_list_users.rs +++ b/examples/v1_users_list_users.rs @@ -1,10 +1,10 @@ // List all users returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_users::UsersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_users::UsersAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsersAPI::with_config(configuration); let resp = api.list_users().await; if let Ok(value) = resp { diff --git a/examples/v1_users_update_user.rs b/examples/v1_users_update_user.rs index 2043dde2a..f0fb2f91c 100644 --- a/examples/v1_users_update_user.rs +++ b/examples/v1_users_update_user.rs @@ -1,6 +1,6 @@ // Update a user returns "User updated" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_users::UsersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_users::UsersAPI; use datadog_api_client::datadogV1::model::AccessRole; use datadog_api_client::datadogV1::model::User; @@ -12,7 +12,7 @@ async fn main() { .email("test@datadoghq.com".to_string()) .handle("test@datadoghq.com".to_string()) .name("test user".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsersAPI::with_config(configuration); let resp = api .update_user("test@datadoghq.com".to_string(), body) diff --git a/examples/v1_webhooks-integration_create_webhooks_integration.rs b/examples/v1_webhooks-integration_create_webhooks_integration.rs index dcb512b11..c20efe09c 100644 --- a/examples/v1_webhooks-integration_create_webhooks_integration.rs +++ b/examples/v1_webhooks-integration_create_webhooks_integration.rs @@ -1,6 +1,6 @@ // Create a webhooks integration returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_webhooks_integration::WebhooksIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_webhooks_integration::WebhooksIntegrationAPI; use datadog_api_client::datadogV1::model::WebhooksIntegration; #[tokio::main] @@ -9,7 +9,7 @@ async fn main() { "Example-Webhooks-Integration".to_string(), "https://example.com/webhook".to_string(), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = WebhooksIntegrationAPI::with_config(configuration); let resp = api.create_webhooks_integration(body).await; if let Ok(value) = resp { diff --git a/examples/v1_webhooks-integration_create_webhooks_integration_custom_variable.rs b/examples/v1_webhooks-integration_create_webhooks_integration_custom_variable.rs index 404d17725..ae437e723 100644 --- a/examples/v1_webhooks-integration_create_webhooks_integration_custom_variable.rs +++ b/examples/v1_webhooks-integration_create_webhooks_integration_custom_variable.rs @@ -1,6 +1,6 @@ // Create a custom variable returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_webhooks_integration::WebhooksIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_webhooks_integration::WebhooksIntegrationAPI; use datadog_api_client::datadogV1::model::WebhooksIntegrationCustomVariable; #[tokio::main] @@ -10,7 +10,7 @@ async fn main() { "EXAMPLEWEBHOOKSINTEGRATION".to_string(), "CUSTOM_VARIABLE_VALUE".to_string(), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = WebhooksIntegrationAPI::with_config(configuration); let resp = api.create_webhooks_integration_custom_variable(body).await; if let Ok(value) = resp { diff --git a/examples/v1_webhooks-integration_delete_webhooks_integration.rs b/examples/v1_webhooks-integration_delete_webhooks_integration.rs index 39be12d61..318dc3038 100644 --- a/examples/v1_webhooks-integration_delete_webhooks_integration.rs +++ b/examples/v1_webhooks-integration_delete_webhooks_integration.rs @@ -1,12 +1,12 @@ // Delete a webhook returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_webhooks_integration::WebhooksIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_webhooks_integration::WebhooksIntegrationAPI; #[tokio::main] async fn main() { // there is a valid "webhook" in the system let webhook_name = std::env::var("WEBHOOK_NAME").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = WebhooksIntegrationAPI::with_config(configuration); let resp = api.delete_webhooks_integration(webhook_name.clone()).await; if let Ok(value) = resp { diff --git a/examples/v1_webhooks-integration_delete_webhooks_integration_custom_variable.rs b/examples/v1_webhooks-integration_delete_webhooks_integration_custom_variable.rs index 73ea3c579..6b78cd87a 100644 --- a/examples/v1_webhooks-integration_delete_webhooks_integration_custom_variable.rs +++ b/examples/v1_webhooks-integration_delete_webhooks_integration_custom_variable.rs @@ -1,12 +1,12 @@ // Delete a custom variable returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_webhooks_integration::WebhooksIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_webhooks_integration::WebhooksIntegrationAPI; #[tokio::main] async fn main() { // there is a valid "webhook_custom_variable" in the system let webhook_custom_variable_name = std::env::var("WEBHOOK_CUSTOM_VARIABLE_NAME").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = WebhooksIntegrationAPI::with_config(configuration); let resp = api .delete_webhooks_integration_custom_variable(webhook_custom_variable_name.clone()) diff --git a/examples/v1_webhooks-integration_get_webhooks_integration.rs b/examples/v1_webhooks-integration_get_webhooks_integration.rs index 3544fdd96..a5e0c0ce4 100644 --- a/examples/v1_webhooks-integration_get_webhooks_integration.rs +++ b/examples/v1_webhooks-integration_get_webhooks_integration.rs @@ -1,12 +1,12 @@ // Get a webhook integration returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_webhooks_integration::WebhooksIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_webhooks_integration::WebhooksIntegrationAPI; #[tokio::main] async fn main() { // there is a valid "webhook" in the system let webhook_name = std::env::var("WEBHOOK_NAME").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = WebhooksIntegrationAPI::with_config(configuration); let resp = api.get_webhooks_integration(webhook_name.clone()).await; if let Ok(value) = resp { diff --git a/examples/v1_webhooks-integration_get_webhooks_integration_custom_variable.rs b/examples/v1_webhooks-integration_get_webhooks_integration_custom_variable.rs index d33720952..23f5aaad4 100644 --- a/examples/v1_webhooks-integration_get_webhooks_integration_custom_variable.rs +++ b/examples/v1_webhooks-integration_get_webhooks_integration_custom_variable.rs @@ -1,10 +1,10 @@ // Get a custom variable returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_webhooks_integration::WebhooksIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_webhooks_integration::WebhooksIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = WebhooksIntegrationAPI::with_config(configuration); let resp = api .get_webhooks_integration_custom_variable("custom_variable_name".to_string()) diff --git a/examples/v1_webhooks-integration_update_webhooks_integration.rs b/examples/v1_webhooks-integration_update_webhooks_integration.rs index fd593e1c9..2166c24af 100644 --- a/examples/v1_webhooks-integration_update_webhooks_integration.rs +++ b/examples/v1_webhooks-integration_update_webhooks_integration.rs @@ -1,6 +1,6 @@ // Update a webhook returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_webhooks_integration::WebhooksIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_webhooks_integration::WebhooksIntegrationAPI; use datadog_api_client::datadogV1::model::WebhooksIntegrationUpdateRequest; #[tokio::main] @@ -9,7 +9,7 @@ async fn main() { let webhook_name = std::env::var("WEBHOOK_NAME").unwrap(); let body = WebhooksIntegrationUpdateRequest::new() .url("https://example.com/webhook-updated".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = WebhooksIntegrationAPI::with_config(configuration); let resp = api .update_webhooks_integration(webhook_name.clone(), body) diff --git a/examples/v1_webhooks-integration_update_webhooks_integration_custom_variable.rs b/examples/v1_webhooks-integration_update_webhooks_integration_custom_variable.rs index ef7d3f934..9209ca3d4 100644 --- a/examples/v1_webhooks-integration_update_webhooks_integration_custom_variable.rs +++ b/examples/v1_webhooks-integration_update_webhooks_integration_custom_variable.rs @@ -1,6 +1,6 @@ // Update a custom variable returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_webhooks_integration::WebhooksIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_webhooks_integration::WebhooksIntegrationAPI; use datadog_api_client::datadogV1::model::WebhooksIntegrationCustomVariableUpdateRequest; #[tokio::main] @@ -9,7 +9,7 @@ async fn main() { let webhook_custom_variable_name = std::env::var("WEBHOOK_CUSTOM_VARIABLE_NAME").unwrap(); let body = WebhooksIntegrationCustomVariableUpdateRequest::new().value("variable-updated".to_string()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = WebhooksIntegrationAPI::with_config(configuration); let resp = api .update_webhooks_integration_custom_variable(webhook_custom_variable_name.clone(), body) diff --git a/examples/v2_api-management_create_open_api.rs b/examples/v2_api-management_create_open_api.rs index ee035c595..dbc077e82 100644 --- a/examples/v2_api-management_create_open_api.rs +++ b/examples/v2_api-management_create_open_api.rs @@ -1,12 +1,12 @@ // Create a new API returns "API created successfully" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_api_management::APIManagementAPI; -use datadog_api_client::datadogV2::api::api_api_management::CreateOpenAPIOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_api_management::APIManagementAPI; +use datadog_api_client::datadogV2::api_api_management::CreateOpenAPIOptionalParams; use std::fs; #[tokio::main] async fn main() { - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.CreateOpenAPI", true); let api = APIManagementAPI::with_config(configuration); let resp = api diff --git a/examples/v2_api-management_delete_open_api.rs b/examples/v2_api-management_delete_open_api.rs index ab828a3a3..0e5c8d486 100644 --- a/examples/v2_api-management_delete_open_api.rs +++ b/examples/v2_api-management_delete_open_api.rs @@ -1,12 +1,12 @@ // Delete an API returns "API deleted successfully" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_api_management::APIManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_api_management::APIManagementAPI; #[tokio::main] async fn main() { // there is a valid "managed_api" in the system let managed_api_data_id = std::env::var("MANAGED_API_DATA_ID").unwrap(); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.DeleteOpenAPI", true); let api = APIManagementAPI::with_config(configuration); let resp = api.delete_open_api(managed_api_data_id.clone()).await; diff --git a/examples/v2_api-management_get_open_api.rs b/examples/v2_api-management_get_open_api.rs index 9068a113d..aed0646af 100644 --- a/examples/v2_api-management_get_open_api.rs +++ b/examples/v2_api-management_get_open_api.rs @@ -1,12 +1,12 @@ // Get an API returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_api_management::APIManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_api_management::APIManagementAPI; #[tokio::main] async fn main() { // there is a valid "managed_api" in the system let managed_api_data_id = std::env::var("MANAGED_API_DATA_ID").unwrap(); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.GetOpenAPI", true); let api = APIManagementAPI::with_config(configuration); let resp = api.get_open_api(managed_api_data_id.clone()).await; diff --git a/examples/v2_api-management_update_open_api.rs b/examples/v2_api-management_update_open_api.rs index c450a6bb4..cb63e10c3 100644 --- a/examples/v2_api-management_update_open_api.rs +++ b/examples/v2_api-management_update_open_api.rs @@ -1,14 +1,14 @@ // Update an API returns "API updated successfully" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_api_management::APIManagementAPI; -use datadog_api_client::datadogV2::api::api_api_management::UpdateOpenAPIOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_api_management::APIManagementAPI; +use datadog_api_client::datadogV2::api_api_management::UpdateOpenAPIOptionalParams; use std::fs; #[tokio::main] async fn main() { // there is a valid "managed_api" in the system let managed_api_data_id = std::env::var("MANAGED_API_DATA_ID").unwrap(); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.UpdateOpenAPI", true); let api = APIManagementAPI::with_config(configuration); let resp = api diff --git a/examples/v2_apm-retention-filters_create_apm_retention_filter.rs b/examples/v2_apm-retention-filters_create_apm_retention_filter.rs index d6c413ad0..176bd400e 100644 --- a/examples/v2_apm-retention-filters_create_apm_retention_filter.rs +++ b/examples/v2_apm-retention-filters_create_apm_retention_filter.rs @@ -1,6 +1,6 @@ // Create a retention filter returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_apm_retention_filters::APMRetentionFiltersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_apm_retention_filters::APMRetentionFiltersAPI; use datadog_api_client::datadogV2::model::ApmRetentionFilterType; use datadog_api_client::datadogV2::model::RetentionFilterCreateAttributes; use datadog_api_client::datadogV2::model::RetentionFilterCreateData; @@ -20,7 +20,7 @@ async fn main() { ), ApmRetentionFilterType::apm_retention_filter, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = APMRetentionFiltersAPI::with_config(configuration); let resp = api.create_apm_retention_filter(body).await; if let Ok(value) = resp { diff --git a/examples/v2_apm-retention-filters_delete_apm_retention_filter.rs b/examples/v2_apm-retention-filters_delete_apm_retention_filter.rs index 085a39ac6..ef5b44976 100644 --- a/examples/v2_apm-retention-filters_delete_apm_retention_filter.rs +++ b/examples/v2_apm-retention-filters_delete_apm_retention_filter.rs @@ -1,12 +1,12 @@ // Delete a retention filter returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_apm_retention_filters::APMRetentionFiltersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_apm_retention_filters::APMRetentionFiltersAPI; #[tokio::main] async fn main() { // there is a valid "retention_filter" in the system let retention_filter_data_id = std::env::var("RETENTION_FILTER_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = APMRetentionFiltersAPI::with_config(configuration); let resp = api .delete_apm_retention_filter(retention_filter_data_id.clone()) diff --git a/examples/v2_apm-retention-filters_get_apm_retention_filter.rs b/examples/v2_apm-retention-filters_get_apm_retention_filter.rs index 705f9c232..79f7ef13e 100644 --- a/examples/v2_apm-retention-filters_get_apm_retention_filter.rs +++ b/examples/v2_apm-retention-filters_get_apm_retention_filter.rs @@ -1,12 +1,12 @@ // Get a given APM retention filter returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_apm_retention_filters::APMRetentionFiltersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_apm_retention_filters::APMRetentionFiltersAPI; #[tokio::main] async fn main() { // there is a valid "retention_filter" in the system let retention_filter_data_id = std::env::var("RETENTION_FILTER_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = APMRetentionFiltersAPI::with_config(configuration); let resp = api .get_apm_retention_filter(retention_filter_data_id.clone()) diff --git a/examples/v2_apm-retention-filters_list_apm_retention_filters.rs b/examples/v2_apm-retention-filters_list_apm_retention_filters.rs index 2d62ef07a..5003a1e29 100644 --- a/examples/v2_apm-retention-filters_list_apm_retention_filters.rs +++ b/examples/v2_apm-retention-filters_list_apm_retention_filters.rs @@ -1,10 +1,10 @@ // List all APM retention filters returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_apm_retention_filters::APMRetentionFiltersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_apm_retention_filters::APMRetentionFiltersAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = APMRetentionFiltersAPI::with_config(configuration); let resp = api.list_apm_retention_filters().await; if let Ok(value) = resp { diff --git a/examples/v2_apm-retention-filters_reorder_apm_retention_filters.rs b/examples/v2_apm-retention-filters_reorder_apm_retention_filters.rs index f1bdcfad1..893c017ec 100644 --- a/examples/v2_apm-retention-filters_reorder_apm_retention_filters.rs +++ b/examples/v2_apm-retention-filters_reorder_apm_retention_filters.rs @@ -1,6 +1,6 @@ // Re-order retention filters returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_apm_retention_filters::APMRetentionFiltersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_apm_retention_filters::APMRetentionFiltersAPI; use datadog_api_client::datadogV2::model::ApmRetentionFilterType; use datadog_api_client::datadogV2::model::ReorderRetentionFiltersRequest; use datadog_api_client::datadogV2::model::RetentionFilterWithoutAttributes; @@ -17,7 +17,7 @@ async fn main() { ApmRetentionFilterType::apm_retention_filter, ), ]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = APMRetentionFiltersAPI::with_config(configuration); let resp = api.reorder_apm_retention_filters(body).await; if let Ok(value) = resp { diff --git a/examples/v2_apm-retention-filters_update_apm_retention_filter.rs b/examples/v2_apm-retention-filters_update_apm_retention_filter.rs index b3426c67f..3489f1393 100644 --- a/examples/v2_apm-retention-filters_update_apm_retention_filter.rs +++ b/examples/v2_apm-retention-filters_update_apm_retention_filter.rs @@ -1,6 +1,6 @@ // Update a retention filter returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_apm_retention_filters::APMRetentionFiltersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_apm_retention_filters::APMRetentionFiltersAPI; use datadog_api_client::datadogV2::model::ApmRetentionFilterType; use datadog_api_client::datadogV2::model::RetentionFilterCreateAttributes; use datadog_api_client::datadogV2::model::RetentionFilterType; @@ -23,7 +23,7 @@ async fn main() { "test-id".to_string(), ApmRetentionFilterType::apm_retention_filter, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = APMRetentionFiltersAPI::with_config(configuration); let resp = api .update_apm_retention_filter(retention_filter_data_id.clone(), body) diff --git a/examples/v2_audit_list_audit_logs.rs b/examples/v2_audit_list_audit_logs.rs index 25af669fb..f5d06fbab 100644 --- a/examples/v2_audit_list_audit_logs.rs +++ b/examples/v2_audit_list_audit_logs.rs @@ -1,11 +1,11 @@ // Get a list of Audit Logs events returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_audit::AuditAPI; -use datadog_api_client::datadogV2::api::api_audit::ListAuditLogsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_audit::AuditAPI; +use datadog_api_client::datadogV2::api_audit::ListAuditLogsOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AuditAPI::with_config(configuration); let resp = api .list_audit_logs(ListAuditLogsOptionalParams::default()) diff --git a/examples/v2_audit_list_audit_logs_1275402458.rs b/examples/v2_audit_list_audit_logs_1275402458.rs index 9842de968..2a5465cb3 100644 --- a/examples/v2_audit_list_audit_logs_1275402458.rs +++ b/examples/v2_audit_list_audit_logs_1275402458.rs @@ -1,13 +1,13 @@ // Get a list of Audit Logs events returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_audit::AuditAPI; -use datadog_api_client::datadogV2::api::api_audit::ListAuditLogsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_audit::AuditAPI; +use datadog_api_client::datadogV2::api_audit::ListAuditLogsOptionalParams; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AuditAPI::with_config(configuration); let response = api.list_audit_logs_with_pagination(ListAuditLogsOptionalParams::default().page_limit(2)); diff --git a/examples/v2_audit_search_audit_logs.rs b/examples/v2_audit_search_audit_logs.rs index e10204fa0..c003289fc 100644 --- a/examples/v2_audit_search_audit_logs.rs +++ b/examples/v2_audit_search_audit_logs.rs @@ -1,7 +1,7 @@ // Search Audit Logs events returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_audit::AuditAPI; -use datadog_api_client::datadogV2::api::api_audit::SearchAuditLogsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_audit::AuditAPI; +use datadog_api_client::datadogV2::api_audit::SearchAuditLogsOptionalParams; use datadog_api_client::datadogV2::model::AuditLogsQueryFilter; use datadog_api_client::datadogV2::model::AuditLogsQueryOptions; use datadog_api_client::datadogV2::model::AuditLogsQueryPageOptions; @@ -24,7 +24,7 @@ async fn main() { ) .page(AuditLogsQueryPageOptions::new().limit(25)) .sort(AuditLogsSort::TIMESTAMP_ASCENDING); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AuditAPI::with_config(configuration); let resp = api .search_audit_logs(SearchAuditLogsOptionalParams::default().body(body)) diff --git a/examples/v2_audit_search_audit_logs_3215529662.rs b/examples/v2_audit_search_audit_logs_3215529662.rs index d429e7cc4..6c6e509b0 100644 --- a/examples/v2_audit_search_audit_logs_3215529662.rs +++ b/examples/v2_audit_search_audit_logs_3215529662.rs @@ -1,7 +1,7 @@ // Search Audit Logs events returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_audit::AuditAPI; -use datadog_api_client::datadogV2::api::api_audit::SearchAuditLogsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_audit::AuditAPI; +use datadog_api_client::datadogV2::api_audit::SearchAuditLogsOptionalParams; use datadog_api_client::datadogV2::model::AuditLogsQueryFilter; use datadog_api_client::datadogV2::model::AuditLogsQueryOptions; use datadog_api_client::datadogV2::model::AuditLogsQueryPageOptions; @@ -21,7 +21,7 @@ async fn main() { .options(AuditLogsQueryOptions::new().timezone("GMT".to_string())) .page(AuditLogsQueryPageOptions::new().limit(2)) .sort(AuditLogsSort::TIMESTAMP_ASCENDING); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AuditAPI::with_config(configuration); let response = api.search_audit_logs_with_pagination(SearchAuditLogsOptionalParams::default().body(body)); diff --git a/examples/v2_authn-mappings_create_authn_mapping.rs b/examples/v2_authn-mappings_create_authn_mapping.rs index 929ab6832..add303926 100644 --- a/examples/v2_authn-mappings_create_authn_mapping.rs +++ b/examples/v2_authn-mappings_create_authn_mapping.rs @@ -1,6 +1,6 @@ // Create an AuthN Mapping returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_authn_mappings::AuthNMappingsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_authn_mappings::AuthNMappingsAPI; use datadog_api_client::datadogV2::model::AuthNMappingCreateAttributes; use datadog_api_client::datadogV2::model::AuthNMappingCreateData; use datadog_api_client::datadogV2::model::AuthNMappingCreateRelationships; @@ -34,7 +34,7 @@ async fn main() { )), ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AuthNMappingsAPI::with_config(configuration); let resp = api.create_authn_mapping(body).await; if let Ok(value) = resp { diff --git a/examples/v2_authn-mappings_delete_authn_mapping.rs b/examples/v2_authn-mappings_delete_authn_mapping.rs index 55e8385a0..42c497781 100644 --- a/examples/v2_authn-mappings_delete_authn_mapping.rs +++ b/examples/v2_authn-mappings_delete_authn_mapping.rs @@ -1,12 +1,12 @@ // Delete an AuthN Mapping returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_authn_mappings::AuthNMappingsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_authn_mappings::AuthNMappingsAPI; #[tokio::main] async fn main() { // there is a valid "authn_mapping" in the system let authn_mapping_data_id = std::env::var("AUTHN_MAPPING_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AuthNMappingsAPI::with_config(configuration); let resp = api .delete_authn_mapping(authn_mapping_data_id.clone()) diff --git a/examples/v2_authn-mappings_get_authn_mapping.rs b/examples/v2_authn-mappings_get_authn_mapping.rs index 3a4df6841..53f4850e3 100644 --- a/examples/v2_authn-mappings_get_authn_mapping.rs +++ b/examples/v2_authn-mappings_get_authn_mapping.rs @@ -1,12 +1,12 @@ // Get an AuthN Mapping by UUID returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_authn_mappings::AuthNMappingsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_authn_mappings::AuthNMappingsAPI; #[tokio::main] async fn main() { // there is a valid "authn_mapping" in the system let authn_mapping_data_id = std::env::var("AUTHN_MAPPING_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AuthNMappingsAPI::with_config(configuration); let resp = api.get_authn_mapping(authn_mapping_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_authn-mappings_list_authn_mappings.rs b/examples/v2_authn-mappings_list_authn_mappings.rs index 5053897a3..459daa158 100644 --- a/examples/v2_authn-mappings_list_authn_mappings.rs +++ b/examples/v2_authn-mappings_list_authn_mappings.rs @@ -1,11 +1,11 @@ // List all AuthN Mappings returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_authn_mappings::AuthNMappingsAPI; -use datadog_api_client::datadogV2::api::api_authn_mappings::ListAuthNMappingsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_authn_mappings::AuthNMappingsAPI; +use datadog_api_client::datadogV2::api_authn_mappings::ListAuthNMappingsOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AuthNMappingsAPI::with_config(configuration); let resp = api .list_authn_mappings(ListAuthNMappingsOptionalParams::default()) diff --git a/examples/v2_authn-mappings_update_authn_mapping.rs b/examples/v2_authn-mappings_update_authn_mapping.rs index 02877f578..d5951b584 100644 --- a/examples/v2_authn-mappings_update_authn_mapping.rs +++ b/examples/v2_authn-mappings_update_authn_mapping.rs @@ -1,6 +1,6 @@ // Edit an AuthN Mapping returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_authn_mappings::AuthNMappingsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_authn_mappings::AuthNMappingsAPI; use datadog_api_client::datadogV2::model::AuthNMappingRelationshipToRole; use datadog_api_client::datadogV2::model::AuthNMappingUpdateAttributes; use datadog_api_client::datadogV2::model::AuthNMappingUpdateData; @@ -40,7 +40,7 @@ async fn main() { )), ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = AuthNMappingsAPI::with_config(configuration); let resp = api .update_authn_mapping(authn_mapping_data_id.clone(), body) diff --git a/examples/v2_case-management_archive_case.rs b/examples/v2_case-management_archive_case.rs index 138a43ef5..7c7dde0b9 100644 --- a/examples/v2_case-management_archive_case.rs +++ b/examples/v2_case-management_archive_case.rs @@ -1,6 +1,6 @@ // Archive case returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_case_management::CaseManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI; use datadog_api_client::datadogV2::model::CaseEmpty; use datadog_api_client::datadogV2::model::CaseEmptyRequest; use datadog_api_client::datadogV2::model::CaseResourceType; @@ -10,7 +10,7 @@ async fn main() { // there is a valid "case" in the system let case_id = std::env::var("CASE_ID").unwrap(); let body = CaseEmptyRequest::new(CaseEmpty::new(CaseResourceType::CASE)); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CaseManagementAPI::with_config(configuration); let resp = api.archive_case(case_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_case-management_assign_case.rs b/examples/v2_case-management_assign_case.rs index 211226a1d..e978f2177 100644 --- a/examples/v2_case-management_assign_case.rs +++ b/examples/v2_case-management_assign_case.rs @@ -1,6 +1,6 @@ // Assign case returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_case_management::CaseManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI; use datadog_api_client::datadogV2::model::CaseAssign; use datadog_api_client::datadogV2::model::CaseAssignAttributes; use datadog_api_client::datadogV2::model::CaseAssignRequest; @@ -17,7 +17,7 @@ async fn main() { CaseAssignAttributes::new(user_data_id.clone()), CaseResourceType::CASE, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CaseManagementAPI::with_config(configuration); let resp = api.assign_case(case_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_case-management_create_case.rs b/examples/v2_case-management_create_case.rs index 246c6a180..073f6853b 100644 --- a/examples/v2_case-management_create_case.rs +++ b/examples/v2_case-management_create_case.rs @@ -1,6 +1,6 @@ // Create a case returns "CREATED" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_case_management::CaseManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI; use datadog_api_client::datadogV2::model::CaseCreate; use datadog_api_client::datadogV2::model::CaseCreateAttributes; use datadog_api_client::datadogV2::model::CaseCreateRelationships; @@ -38,7 +38,7 @@ async fn main() { )))), ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CaseManagementAPI::with_config(configuration); let resp = api.create_case(body).await; if let Ok(value) = resp { diff --git a/examples/v2_case-management_create_project.rs b/examples/v2_case-management_create_project.rs index 14992ad6f..91a594471 100644 --- a/examples/v2_case-management_create_project.rs +++ b/examples/v2_case-management_create_project.rs @@ -1,6 +1,6 @@ // Create a project returns "CREATED" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_case_management::CaseManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI; use datadog_api_client::datadogV2::model::ProjectCreate; use datadog_api_client::datadogV2::model::ProjectCreateAttributes; use datadog_api_client::datadogV2::model::ProjectCreateRequest; @@ -12,7 +12,7 @@ async fn main() { ProjectCreateAttributes::new("SEC".to_string(), "Security Investigation".to_string()), ProjectResourceType::PROJECT, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CaseManagementAPI::with_config(configuration); let resp = api.create_project(body).await; if let Ok(value) = resp { diff --git a/examples/v2_case-management_delete_project.rs b/examples/v2_case-management_delete_project.rs index 0370c9fac..a013e1447 100644 --- a/examples/v2_case-management_delete_project.rs +++ b/examples/v2_case-management_delete_project.rs @@ -1,10 +1,10 @@ // Remove a project returns "No Content" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_case_management::CaseManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CaseManagementAPI::with_config(configuration); let resp = api.delete_project("project_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v2_case-management_get_case.rs b/examples/v2_case-management_get_case.rs index daeadbe8d..4da9caefb 100644 --- a/examples/v2_case-management_get_case.rs +++ b/examples/v2_case-management_get_case.rs @@ -1,12 +1,12 @@ // Get the details of a case returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_case_management::CaseManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI; #[tokio::main] async fn main() { // there is a valid "case" in the system let case_id = std::env::var("CASE_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CaseManagementAPI::with_config(configuration); let resp = api.get_case(case_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_case-management_get_project.rs b/examples/v2_case-management_get_project.rs index 59028ae74..abf671a60 100644 --- a/examples/v2_case-management_get_project.rs +++ b/examples/v2_case-management_get_project.rs @@ -1,10 +1,10 @@ // Get the details of a project returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_case_management::CaseManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CaseManagementAPI::with_config(configuration); let resp = api.get_project("project_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v2_case-management_get_projects.rs b/examples/v2_case-management_get_projects.rs index d6192db37..9cf64333c 100644 --- a/examples/v2_case-management_get_projects.rs +++ b/examples/v2_case-management_get_projects.rs @@ -1,10 +1,10 @@ // Get all projects returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_case_management::CaseManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CaseManagementAPI::with_config(configuration); let resp = api.get_projects().await; if let Ok(value) = resp { diff --git a/examples/v2_case-management_search_cases.rs b/examples/v2_case-management_search_cases.rs index d973e0914..9f0986c2a 100644 --- a/examples/v2_case-management_search_cases.rs +++ b/examples/v2_case-management_search_cases.rs @@ -1,11 +1,11 @@ // Search cases returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_case_management::CaseManagementAPI; -use datadog_api_client::datadogV2::api::api_case_management::SearchCasesOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI; +use datadog_api_client::datadogV2::api_case_management::SearchCasesOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CaseManagementAPI::with_config(configuration); let resp = api.search_cases(SearchCasesOptionalParams::default()).await; if let Ok(value) = resp { diff --git a/examples/v2_case-management_search_cases_3433960044.rs b/examples/v2_case-management_search_cases_3433960044.rs index 1d5389919..298771abc 100644 --- a/examples/v2_case-management_search_cases_3433960044.rs +++ b/examples/v2_case-management_search_cases_3433960044.rs @@ -1,13 +1,13 @@ // Search cases returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_case_management::CaseManagementAPI; -use datadog_api_client::datadogV2::api::api_case_management::SearchCasesOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI; +use datadog_api_client::datadogV2::api_case_management::SearchCasesOptionalParams; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CaseManagementAPI::with_config(configuration); let response = api.search_cases_with_pagination(SearchCasesOptionalParams::default()); pin_mut!(response); diff --git a/examples/v2_case-management_unarchive_case.rs b/examples/v2_case-management_unarchive_case.rs index 5f6520b79..623887410 100644 --- a/examples/v2_case-management_unarchive_case.rs +++ b/examples/v2_case-management_unarchive_case.rs @@ -1,6 +1,6 @@ // Unarchive case returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_case_management::CaseManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI; use datadog_api_client::datadogV2::model::CaseEmpty; use datadog_api_client::datadogV2::model::CaseEmptyRequest; use datadog_api_client::datadogV2::model::CaseResourceType; @@ -10,7 +10,7 @@ async fn main() { // there is a valid "case" in the system let case_id = std::env::var("CASE_ID").unwrap(); let body = CaseEmptyRequest::new(CaseEmpty::new(CaseResourceType::CASE)); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CaseManagementAPI::with_config(configuration); let resp = api.unarchive_case(case_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_case-management_unassign_case.rs b/examples/v2_case-management_unassign_case.rs index 112b7fe33..b5b5b74ae 100644 --- a/examples/v2_case-management_unassign_case.rs +++ b/examples/v2_case-management_unassign_case.rs @@ -1,6 +1,6 @@ // Unassign case returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_case_management::CaseManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI; use datadog_api_client::datadogV2::model::CaseEmpty; use datadog_api_client::datadogV2::model::CaseEmptyRequest; use datadog_api_client::datadogV2::model::CaseResourceType; @@ -10,7 +10,7 @@ async fn main() { // there is a valid "case" in the system let case_id = std::env::var("CASE_ID").unwrap(); let body = CaseEmptyRequest::new(CaseEmpty::new(CaseResourceType::CASE)); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CaseManagementAPI::with_config(configuration); let resp = api.unassign_case(case_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_case-management_update_priority.rs b/examples/v2_case-management_update_priority.rs index f5e851253..1e0e33b14 100644 --- a/examples/v2_case-management_update_priority.rs +++ b/examples/v2_case-management_update_priority.rs @@ -1,6 +1,6 @@ // Update case priority returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_case_management::CaseManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI; use datadog_api_client::datadogV2::model::CasePriority; use datadog_api_client::datadogV2::model::CaseResourceType; use datadog_api_client::datadogV2::model::CaseUpdatePriority; @@ -15,7 +15,7 @@ async fn main() { CaseUpdatePriorityAttributes::new(CasePriority::P3), CaseResourceType::CASE, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CaseManagementAPI::with_config(configuration); let resp = api.update_priority(case_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_case-management_update_status.rs b/examples/v2_case-management_update_status.rs index a273ffb3f..d5d8ef9cc 100644 --- a/examples/v2_case-management_update_status.rs +++ b/examples/v2_case-management_update_status.rs @@ -1,6 +1,6 @@ // Update case status returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_case_management::CaseManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI; use datadog_api_client::datadogV2::model::CaseResourceType; use datadog_api_client::datadogV2::model::CaseStatus; use datadog_api_client::datadogV2::model::CaseUpdateStatus; @@ -15,7 +15,7 @@ async fn main() { CaseUpdateStatusAttributes::new(CaseStatus::IN_PROGRESS), CaseResourceType::CASE, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CaseManagementAPI::with_config(configuration); let resp = api.update_status(case_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_ci-visibility-pipelines_aggregate_ci_app_pipeline_events.rs b/examples/v2_ci-visibility-pipelines_aggregate_ci_app_pipeline_events.rs index ae62217dd..b9f983a1f 100644 --- a/examples/v2_ci-visibility-pipelines_aggregate_ci_app_pipeline_events.rs +++ b/examples/v2_ci-visibility-pipelines_aggregate_ci_app_pipeline_events.rs @@ -1,6 +1,6 @@ // Aggregate pipelines events returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_ci_visibility_pipelines::CIVisibilityPipelinesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_ci_visibility_pipelines::CIVisibilityPipelinesAPI; use datadog_api_client::datadogV2::model::CIAppAggregationFunction; use datadog_api_client::datadogV2::model::CIAppCompute; use datadog_api_client::datadogV2::model::CIAppComputeType; @@ -28,7 +28,7 @@ async fn main() { .limit(10) .total(CIAppGroupByTotal::CIAppGroupByTotalBoolean(false))]) .options(CIAppQueryOptions::new().timezone("GMT".to_string())); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CIVisibilityPipelinesAPI::with_config(configuration); let resp = api.aggregate_ci_app_pipeline_events(body).await; if let Ok(value) = resp { diff --git a/examples/v2_ci-visibility-pipelines_create_ci_app_pipeline_event.rs b/examples/v2_ci-visibility-pipelines_create_ci_app_pipeline_event.rs index 95df3d208..f4d4563f3 100644 --- a/examples/v2_ci-visibility-pipelines_create_ci_app_pipeline_event.rs +++ b/examples/v2_ci-visibility-pipelines_create_ci_app_pipeline_event.rs @@ -1,6 +1,6 @@ // Send pipeline event returns "Request accepted for processing" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_ci_visibility_pipelines::CIVisibilityPipelinesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_ci_visibility_pipelines::CIVisibilityPipelinesAPI; use datadog_api_client::datadogV2::model::CIAppCreatePipelineEventRequest; use datadog_api_client::datadogV2::model::CIAppCreatePipelineEventRequestAttributes; use datadog_api_client::datadogV2::model::CIAppCreatePipelineEventRequestAttributesResource; @@ -39,7 +39,7 @@ async fn main() { )) .type_(CIAppCreatePipelineEventRequestDataType::CIPIPELINE_RESOURCE_REQUEST), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CIVisibilityPipelinesAPI::with_config(configuration); let resp = api.create_ci_app_pipeline_event(body).await; if let Ok(value) = resp { diff --git a/examples/v2_ci-visibility-pipelines_create_ci_app_pipeline_event_129899466.rs b/examples/v2_ci-visibility-pipelines_create_ci_app_pipeline_event_129899466.rs index b7bfbc961..70b7144df 100644 --- a/examples/v2_ci-visibility-pipelines_create_ci_app_pipeline_event_129899466.rs +++ b/examples/v2_ci-visibility-pipelines_create_ci_app_pipeline_event_129899466.rs @@ -1,6 +1,6 @@ // Send pipeline job event returns "Request accepted for processing" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_ci_visibility_pipelines::CIVisibilityPipelinesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_ci_visibility_pipelines::CIVisibilityPipelinesAPI; use datadog_api_client::datadogV2::model::CIAppCreatePipelineEventRequest; use datadog_api_client::datadogV2::model::CIAppCreatePipelineEventRequestAttributes; use datadog_api_client::datadogV2::model::CIAppCreatePipelineEventRequestAttributesResource; @@ -31,7 +31,7 @@ async fn main() { )) .type_(CIAppCreatePipelineEventRequestDataType::CIPIPELINE_RESOURCE_REQUEST), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CIVisibilityPipelinesAPI::with_config(configuration); let resp = api.create_ci_app_pipeline_event(body).await; if let Ok(value) = resp { diff --git a/examples/v2_ci-visibility-pipelines_list_ci_app_pipeline_events.rs b/examples/v2_ci-visibility-pipelines_list_ci_app_pipeline_events.rs index bf544dedb..f4d32579d 100644 --- a/examples/v2_ci-visibility-pipelines_list_ci_app_pipeline_events.rs +++ b/examples/v2_ci-visibility-pipelines_list_ci_app_pipeline_events.rs @@ -1,11 +1,11 @@ // Get a list of pipelines events returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_ci_visibility_pipelines::CIVisibilityPipelinesAPI; -use datadog_api_client::datadogV2::api::api_ci_visibility_pipelines::ListCIAppPipelineEventsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_ci_visibility_pipelines::CIVisibilityPipelinesAPI; +use datadog_api_client::datadogV2::api_ci_visibility_pipelines::ListCIAppPipelineEventsOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CIVisibilityPipelinesAPI::with_config(configuration); let resp = api .list_ci_app_pipeline_events( diff --git a/examples/v2_ci-visibility-pipelines_list_ci_app_pipeline_events_1270618359.rs b/examples/v2_ci-visibility-pipelines_list_ci_app_pipeline_events_1270618359.rs index b781b0c7f..e85b74241 100644 --- a/examples/v2_ci-visibility-pipelines_list_ci_app_pipeline_events_1270618359.rs +++ b/examples/v2_ci-visibility-pipelines_list_ci_app_pipeline_events_1270618359.rs @@ -1,13 +1,13 @@ // Get a list of pipelines events returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_ci_visibility_pipelines::CIVisibilityPipelinesAPI; -use datadog_api_client::datadogV2::api::api_ci_visibility_pipelines::ListCIAppPipelineEventsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_ci_visibility_pipelines::CIVisibilityPipelinesAPI; +use datadog_api_client::datadogV2::api_ci_visibility_pipelines::ListCIAppPipelineEventsOptionalParams; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CIVisibilityPipelinesAPI::with_config(configuration); let response = api.list_ci_app_pipeline_events_with_pagination( ListCIAppPipelineEventsOptionalParams::default() diff --git a/examples/v2_ci-visibility-pipelines_search_ci_app_pipeline_events.rs b/examples/v2_ci-visibility-pipelines_search_ci_app_pipeline_events.rs index 56359bb1a..9dee9f23c 100644 --- a/examples/v2_ci-visibility-pipelines_search_ci_app_pipeline_events.rs +++ b/examples/v2_ci-visibility-pipelines_search_ci_app_pipeline_events.rs @@ -1,7 +1,7 @@ // Search pipelines events returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_ci_visibility_pipelines::CIVisibilityPipelinesAPI; -use datadog_api_client::datadogV2::api::api_ci_visibility_pipelines::SearchCIAppPipelineEventsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_ci_visibility_pipelines::CIVisibilityPipelinesAPI; +use datadog_api_client::datadogV2::api_ci_visibility_pipelines::SearchCIAppPipelineEventsOptionalParams; use datadog_api_client::datadogV2::model::CIAppPipelineEventsRequest; use datadog_api_client::datadogV2::model::CIAppPipelinesQueryFilter; use datadog_api_client::datadogV2::model::CIAppQueryOptions; @@ -20,7 +20,7 @@ async fn main() { .options(CIAppQueryOptions::new().timezone("GMT".to_string())) .page(CIAppQueryPageOptions::new().limit(5)) .sort(CIAppSort::TIMESTAMP_ASCENDING); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CIVisibilityPipelinesAPI::with_config(configuration); let resp = api .search_ci_app_pipeline_events( diff --git a/examples/v2_ci-visibility-pipelines_search_ci_app_pipeline_events_3246135003.rs b/examples/v2_ci-visibility-pipelines_search_ci_app_pipeline_events_3246135003.rs index 3e6e96480..78d95d5aa 100644 --- a/examples/v2_ci-visibility-pipelines_search_ci_app_pipeline_events_3246135003.rs +++ b/examples/v2_ci-visibility-pipelines_search_ci_app_pipeline_events_3246135003.rs @@ -1,7 +1,7 @@ // Search pipelines events returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_ci_visibility_pipelines::CIVisibilityPipelinesAPI; -use datadog_api_client::datadogV2::api::api_ci_visibility_pipelines::SearchCIAppPipelineEventsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_ci_visibility_pipelines::CIVisibilityPipelinesAPI; +use datadog_api_client::datadogV2::api_ci_visibility_pipelines::SearchCIAppPipelineEventsOptionalParams; use datadog_api_client::datadogV2::model::CIAppPipelineEventsRequest; use datadog_api_client::datadogV2::model::CIAppPipelinesQueryFilter; use datadog_api_client::datadogV2::model::CIAppQueryOptions; @@ -21,7 +21,7 @@ async fn main() { .options(CIAppQueryOptions::new().timezone("GMT".to_string())) .page(CIAppQueryPageOptions::new().limit(2)) .sort(CIAppSort::TIMESTAMP_ASCENDING); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CIVisibilityPipelinesAPI::with_config(configuration); let response = api.search_ci_app_pipeline_events_with_pagination( SearchCIAppPipelineEventsOptionalParams::default().body(body), diff --git a/examples/v2_ci-visibility-tests_aggregate_ci_app_test_events.rs b/examples/v2_ci-visibility-tests_aggregate_ci_app_test_events.rs index 8936cef46..1ad250b15 100644 --- a/examples/v2_ci-visibility-tests_aggregate_ci_app_test_events.rs +++ b/examples/v2_ci-visibility-tests_aggregate_ci_app_test_events.rs @@ -1,6 +1,6 @@ // Aggregate tests events returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_ci_visibility_tests::CIVisibilityTestsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_ci_visibility_tests::CIVisibilityTestsAPI; use datadog_api_client::datadogV2::model::CIAppAggregateSort; use datadog_api_client::datadogV2::model::CIAppAggregationFunction; use datadog_api_client::datadogV2::model::CIAppCompute; @@ -29,7 +29,7 @@ async fn main() { .sort(CIAppAggregateSort::new().order(CIAppSortOrder::ASCENDING)) .total(CIAppGroupByTotal::CIAppGroupByTotalBoolean(false))]) .options(CIAppQueryOptions::new().timezone("GMT".to_string())); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CIVisibilityTestsAPI::with_config(configuration); let resp = api.aggregate_ci_app_test_events(body).await; if let Ok(value) = resp { diff --git a/examples/v2_ci-visibility-tests_list_ci_app_test_events.rs b/examples/v2_ci-visibility-tests_list_ci_app_test_events.rs index 7246fffc6..00afb8de2 100644 --- a/examples/v2_ci-visibility-tests_list_ci_app_test_events.rs +++ b/examples/v2_ci-visibility-tests_list_ci_app_test_events.rs @@ -1,11 +1,11 @@ // Get a list of tests events returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_ci_visibility_tests::CIVisibilityTestsAPI; -use datadog_api_client::datadogV2::api::api_ci_visibility_tests::ListCIAppTestEventsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_ci_visibility_tests::CIVisibilityTestsAPI; +use datadog_api_client::datadogV2::api_ci_visibility_tests::ListCIAppTestEventsOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CIVisibilityTestsAPI::with_config(configuration); let resp = api .list_ci_app_test_events( diff --git a/examples/v2_ci-visibility-tests_list_ci_app_test_events_3852605281.rs b/examples/v2_ci-visibility-tests_list_ci_app_test_events_3852605281.rs index 06af9c8c5..60da69b79 100644 --- a/examples/v2_ci-visibility-tests_list_ci_app_test_events_3852605281.rs +++ b/examples/v2_ci-visibility-tests_list_ci_app_test_events_3852605281.rs @@ -1,13 +1,13 @@ // Get a list of tests events returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_ci_visibility_tests::CIVisibilityTestsAPI; -use datadog_api_client::datadogV2::api::api_ci_visibility_tests::ListCIAppTestEventsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_ci_visibility_tests::CIVisibilityTestsAPI; +use datadog_api_client::datadogV2::api_ci_visibility_tests::ListCIAppTestEventsOptionalParams; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CIVisibilityTestsAPI::with_config(configuration); let response = api.list_ci_app_test_events_with_pagination( ListCIAppTestEventsOptionalParams::default() diff --git a/examples/v2_ci-visibility-tests_search_ci_app_test_events.rs b/examples/v2_ci-visibility-tests_search_ci_app_test_events.rs index b7e934919..2aa75bbaf 100644 --- a/examples/v2_ci-visibility-tests_search_ci_app_test_events.rs +++ b/examples/v2_ci-visibility-tests_search_ci_app_test_events.rs @@ -1,7 +1,7 @@ // Search tests events returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_ci_visibility_tests::CIVisibilityTestsAPI; -use datadog_api_client::datadogV2::api::api_ci_visibility_tests::SearchCIAppTestEventsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_ci_visibility_tests::CIVisibilityTestsAPI; +use datadog_api_client::datadogV2::api_ci_visibility_tests::SearchCIAppTestEventsOptionalParams; use datadog_api_client::datadogV2::model::CIAppQueryOptions; use datadog_api_client::datadogV2::model::CIAppQueryPageOptions; use datadog_api_client::datadogV2::model::CIAppSort; @@ -20,7 +20,7 @@ async fn main() { .options(CIAppQueryOptions::new().timezone("GMT".to_string())) .page(CIAppQueryPageOptions::new().limit(25)) .sort(CIAppSort::TIMESTAMP_ASCENDING); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CIVisibilityTestsAPI::with_config(configuration); let resp = api .search_ci_app_test_events(SearchCIAppTestEventsOptionalParams::default().body(body)) diff --git a/examples/v2_ci-visibility-tests_search_ci_app_test_events_1675695429.rs b/examples/v2_ci-visibility-tests_search_ci_app_test_events_1675695429.rs index a49064150..5c2df3c82 100644 --- a/examples/v2_ci-visibility-tests_search_ci_app_test_events_1675695429.rs +++ b/examples/v2_ci-visibility-tests_search_ci_app_test_events_1675695429.rs @@ -1,7 +1,7 @@ // Search tests events returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_ci_visibility_tests::CIVisibilityTestsAPI; -use datadog_api_client::datadogV2::api::api_ci_visibility_tests::SearchCIAppTestEventsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_ci_visibility_tests::CIVisibilityTestsAPI; +use datadog_api_client::datadogV2::api_ci_visibility_tests::SearchCIAppTestEventsOptionalParams; use datadog_api_client::datadogV2::model::CIAppQueryPageOptions; use datadog_api_client::datadogV2::model::CIAppSort; use datadog_api_client::datadogV2::model::CIAppTestEventsRequest; @@ -20,7 +20,7 @@ async fn main() { ) .page(CIAppQueryPageOptions::new().limit(2)) .sort(CIAppSort::TIMESTAMP_ASCENDING); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CIVisibilityTestsAPI::with_config(configuration); let response = api.search_ci_app_test_events_with_pagination( SearchCIAppTestEventsOptionalParams::default().body(body), diff --git a/examples/v2_cloud-cost-management_create_cost_awscur_config.rs b/examples/v2_cloud-cost-management_create_cost_awscur_config.rs index adc65c504..7da454682 100644 --- a/examples/v2_cloud-cost-management_create_cost_awscur_config.rs +++ b/examples/v2_cloud-cost-management_create_cost_awscur_config.rs @@ -1,6 +1,6 @@ // Create Cloud Cost Management AWS CUR config returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_cost_management::CloudCostManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI; use datadog_api_client::datadogV2::model::AwsCURConfigPostData; use datadog_api_client::datadogV2::model::AwsCURConfigPostRequest; use datadog_api_client::datadogV2::model::AwsCURConfigPostRequestAttributes; @@ -18,7 +18,7 @@ async fn main() { .bucket_region("us-east-1".to_string()), AwsCURConfigPostRequestType::AWS_CUR_CONFIG_POST_REQUEST, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudCostManagementAPI::with_config(configuration); let resp = api.create_cost_awscur_config(body).await; if let Ok(value) = resp { diff --git a/examples/v2_cloud-cost-management_create_cost_azure_uc_configs.rs b/examples/v2_cloud-cost-management_create_cost_azure_uc_configs.rs index 6cc71d6d5..ff1e04a7b 100644 --- a/examples/v2_cloud-cost-management_create_cost_azure_uc_configs.rs +++ b/examples/v2_cloud-cost-management_create_cost_azure_uc_configs.rs @@ -1,6 +1,6 @@ // Create Cloud Cost Management Azure configs returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_cost_management::CloudCostManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI; use datadog_api_client::datadogV2::model::AzureUCConfigPostData; use datadog_api_client::datadogV2::model::AzureUCConfigPostRequest; use datadog_api_client::datadogV2::model::AzureUCConfigPostRequestAttributes; @@ -30,7 +30,7 @@ async fn main() { .is_enabled(true), AzureUCConfigPostRequestType::AZURE_UC_CONFIG_POST_REQUEST, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudCostManagementAPI::with_config(configuration); let resp = api.create_cost_azure_uc_configs(body).await; if let Ok(value) = resp { diff --git a/examples/v2_cloud-cost-management_delete_cost_awscur_config.rs b/examples/v2_cloud-cost-management_delete_cost_awscur_config.rs index 5911d04a0..3d20a6892 100644 --- a/examples/v2_cloud-cost-management_delete_cost_awscur_config.rs +++ b/examples/v2_cloud-cost-management_delete_cost_awscur_config.rs @@ -1,10 +1,10 @@ // Delete Cloud Cost Management AWS CUR config returns "No Content" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_cost_management::CloudCostManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudCostManagementAPI::with_config(configuration); let resp = api.delete_cost_awscur_config("100".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v2_cloud-cost-management_delete_cost_azure_uc_config.rs b/examples/v2_cloud-cost-management_delete_cost_azure_uc_config.rs index 2336aadc5..1a87e9389 100644 --- a/examples/v2_cloud-cost-management_delete_cost_azure_uc_config.rs +++ b/examples/v2_cloud-cost-management_delete_cost_azure_uc_config.rs @@ -1,10 +1,10 @@ // Delete Cloud Cost Management Azure config returns "No Content" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_cost_management::CloudCostManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudCostManagementAPI::with_config(configuration); let resp = api.delete_cost_azure_uc_config("100".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v2_cloud-cost-management_get_cloud_cost_activity.rs b/examples/v2_cloud-cost-management_get_cloud_cost_activity.rs index 549b7deaf..012d53a74 100644 --- a/examples/v2_cloud-cost-management_get_cloud_cost_activity.rs +++ b/examples/v2_cloud-cost-management_get_cloud_cost_activity.rs @@ -1,10 +1,10 @@ // Cloud Cost Enabled returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_cost_management::CloudCostManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudCostManagementAPI::with_config(configuration); let resp = api.get_cloud_cost_activity().await; if let Ok(value) = resp { diff --git a/examples/v2_cloud-cost-management_list_aws_related_accounts.rs b/examples/v2_cloud-cost-management_list_aws_related_accounts.rs index beae8a0a6..12c276331 100644 --- a/examples/v2_cloud-cost-management_list_aws_related_accounts.rs +++ b/examples/v2_cloud-cost-management_list_aws_related_accounts.rs @@ -1,10 +1,10 @@ // List related AWS accounts returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_cost_management::CloudCostManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudCostManagementAPI::with_config(configuration); let resp = api .list_aws_related_accounts("123456789123".to_string()) diff --git a/examples/v2_cloud-cost-management_list_cost_awscur_configs.rs b/examples/v2_cloud-cost-management_list_cost_awscur_configs.rs index e829f0319..8a6fbe68c 100644 --- a/examples/v2_cloud-cost-management_list_cost_awscur_configs.rs +++ b/examples/v2_cloud-cost-management_list_cost_awscur_configs.rs @@ -1,10 +1,10 @@ // List Cloud Cost Management AWS CUR configs returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_cost_management::CloudCostManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudCostManagementAPI::with_config(configuration); let resp = api.list_cost_awscur_configs().await; if let Ok(value) = resp { diff --git a/examples/v2_cloud-cost-management_list_cost_azure_uc_configs.rs b/examples/v2_cloud-cost-management_list_cost_azure_uc_configs.rs index 52597a435..66444c7e2 100644 --- a/examples/v2_cloud-cost-management_list_cost_azure_uc_configs.rs +++ b/examples/v2_cloud-cost-management_list_cost_azure_uc_configs.rs @@ -1,10 +1,10 @@ // List Cloud Cost Management Azure configs returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_cost_management::CloudCostManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudCostManagementAPI::with_config(configuration); let resp = api.list_cost_azure_uc_configs().await; if let Ok(value) = resp { diff --git a/examples/v2_cloud-cost-management_update_cost_awscur_config.rs b/examples/v2_cloud-cost-management_update_cost_awscur_config.rs index 916c654f1..8418f4cd8 100644 --- a/examples/v2_cloud-cost-management_update_cost_awscur_config.rs +++ b/examples/v2_cloud-cost-management_update_cost_awscur_config.rs @@ -1,6 +1,6 @@ // Update Cloud Cost Management AWS CUR config returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_cost_management::CloudCostManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI; use datadog_api_client::datadogV2::model::AwsCURConfigPatchData; use datadog_api_client::datadogV2::model::AwsCURConfigPatchRequest; use datadog_api_client::datadogV2::model::AwsCURConfigPatchRequestAttributes; @@ -12,7 +12,7 @@ async fn main() { AwsCURConfigPatchRequestAttributes::new(true), AwsCURConfigPatchRequestType::AWS_CUR_CONFIG_PATCH_REQUEST, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudCostManagementAPI::with_config(configuration); let resp = api.update_cost_awscur_config("100".to_string(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_cloud-cost-management_update_cost_azure_uc_configs.rs b/examples/v2_cloud-cost-management_update_cost_azure_uc_configs.rs index 88c80ee52..0a3538656 100644 --- a/examples/v2_cloud-cost-management_update_cost_azure_uc_configs.rs +++ b/examples/v2_cloud-cost-management_update_cost_azure_uc_configs.rs @@ -1,6 +1,6 @@ // Update Cloud Cost Management Azure config returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_cost_management::CloudCostManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI; use datadog_api_client::datadogV2::model::AzureUCConfigPatchData; use datadog_api_client::datadogV2::model::AzureUCConfigPatchRequest; use datadog_api_client::datadogV2::model::AzureUCConfigPatchRequestAttributes; @@ -12,7 +12,7 @@ async fn main() { AzureUCConfigPatchRequestAttributes::new(true), AzureUCConfigPatchRequestType::AZURE_UC_CONFIG_PATCH_REQUEST, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudCostManagementAPI::with_config(configuration); let resp = api .update_cost_azure_uc_configs("100".to_string(), body) diff --git a/examples/v2_cloud-workload-security_create_cloud_workload_security_agent_rule.rs b/examples/v2_cloud-workload-security_create_cloud_workload_security_agent_rule.rs index 5096f681e..80e718415 100644 --- a/examples/v2_cloud-workload-security_create_cloud_workload_security_agent_rule.rs +++ b/examples/v2_cloud-workload-security_create_cloud_workload_security_agent_rule.rs @@ -1,6 +1,6 @@ // Create a Cloud Workload Security Agent rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_workload_security::CloudWorkloadSecurityAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_workload_security::CloudWorkloadSecurityAPI; use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleCreateAttributes; use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleCreateData; use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleCreateRequest; @@ -19,7 +19,7 @@ async fn main() { CloudWorkloadSecurityAgentRuleType::AGENT_RULE, ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudWorkloadSecurityAPI::with_config(configuration); let resp = api.create_cloud_workload_security_agent_rule(body).await; if let Ok(value) = resp { diff --git a/examples/v2_cloud-workload-security_create_csm_threats_agent_rule.rs b/examples/v2_cloud-workload-security_create_csm_threats_agent_rule.rs index 062e48a63..7305f789d 100644 --- a/examples/v2_cloud-workload-security_create_csm_threats_agent_rule.rs +++ b/examples/v2_cloud-workload-security_create_csm_threats_agent_rule.rs @@ -1,6 +1,6 @@ // Create a CSM Threats Agent rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_workload_security::CloudWorkloadSecurityAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_workload_security::CloudWorkloadSecurityAPI; use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleCreateAttributes; use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleCreateData; use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleCreateRequest; @@ -19,7 +19,7 @@ async fn main() { CloudWorkloadSecurityAgentRuleType::AGENT_RULE, ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudWorkloadSecurityAPI::with_config(configuration); let resp = api.create_csm_threats_agent_rule(body).await; if let Ok(value) = resp { diff --git a/examples/v2_cloud-workload-security_delete_cloud_workload_security_agent_rule.rs b/examples/v2_cloud-workload-security_delete_cloud_workload_security_agent_rule.rs index 6b3dc8b5d..497947484 100644 --- a/examples/v2_cloud-workload-security_delete_cloud_workload_security_agent_rule.rs +++ b/examples/v2_cloud-workload-security_delete_cloud_workload_security_agent_rule.rs @@ -1,12 +1,12 @@ // Delete a Cloud Workload Security Agent rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_workload_security::CloudWorkloadSecurityAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_workload_security::CloudWorkloadSecurityAPI; #[tokio::main] async fn main() { // there is a valid "agent_rule" in the system let agent_rule_data_id = std::env::var("AGENT_RULE_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudWorkloadSecurityAPI::with_config(configuration); let resp = api .delete_cloud_workload_security_agent_rule(agent_rule_data_id.clone()) diff --git a/examples/v2_cloud-workload-security_delete_csm_threats_agent_rule.rs b/examples/v2_cloud-workload-security_delete_csm_threats_agent_rule.rs index 95139d399..de5e337c4 100644 --- a/examples/v2_cloud-workload-security_delete_csm_threats_agent_rule.rs +++ b/examples/v2_cloud-workload-security_delete_csm_threats_agent_rule.rs @@ -1,12 +1,12 @@ // Delete a CSM Threats Agent rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_workload_security::CloudWorkloadSecurityAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_workload_security::CloudWorkloadSecurityAPI; #[tokio::main] async fn main() { // there is a valid "agent_rule_rc" in the system let agent_rule_data_id = std::env::var("AGENT_RULE_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudWorkloadSecurityAPI::with_config(configuration); let resp = api .delete_csm_threats_agent_rule(agent_rule_data_id.clone()) diff --git a/examples/v2_cloud-workload-security_download_cloud_workload_policy_file.rs b/examples/v2_cloud-workload-security_download_cloud_workload_policy_file.rs index 7f0ce894a..3505ab7a4 100644 --- a/examples/v2_cloud-workload-security_download_cloud_workload_policy_file.rs +++ b/examples/v2_cloud-workload-security_download_cloud_workload_policy_file.rs @@ -1,10 +1,10 @@ // Get the latest Cloud Workload Security policy returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_workload_security::CloudWorkloadSecurityAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_workload_security::CloudWorkloadSecurityAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudWorkloadSecurityAPI::with_config(configuration); let resp = api.download_cloud_workload_policy_file().await; if let Ok(value) = resp { diff --git a/examples/v2_cloud-workload-security_download_csm_threats_policy.rs b/examples/v2_cloud-workload-security_download_csm_threats_policy.rs index e9283b9ee..d32128e4a 100644 --- a/examples/v2_cloud-workload-security_download_csm_threats_policy.rs +++ b/examples/v2_cloud-workload-security_download_csm_threats_policy.rs @@ -1,10 +1,10 @@ // Get the latest CSM Threats policy returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_workload_security::CloudWorkloadSecurityAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_workload_security::CloudWorkloadSecurityAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudWorkloadSecurityAPI::with_config(configuration); let resp = api.download_csm_threats_policy().await; if let Ok(value) = resp { diff --git a/examples/v2_cloud-workload-security_get_cloud_workload_security_agent_rule.rs b/examples/v2_cloud-workload-security_get_cloud_workload_security_agent_rule.rs index 07dcd9575..be0666fa3 100644 --- a/examples/v2_cloud-workload-security_get_cloud_workload_security_agent_rule.rs +++ b/examples/v2_cloud-workload-security_get_cloud_workload_security_agent_rule.rs @@ -1,12 +1,12 @@ // Get a Cloud Workload Security Agent rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_workload_security::CloudWorkloadSecurityAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_workload_security::CloudWorkloadSecurityAPI; #[tokio::main] async fn main() { // there is a valid "agent_rule" in the system let agent_rule_data_id = std::env::var("AGENT_RULE_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudWorkloadSecurityAPI::with_config(configuration); let resp = api .get_cloud_workload_security_agent_rule(agent_rule_data_id.clone()) diff --git a/examples/v2_cloud-workload-security_get_csm_threats_agent_rule.rs b/examples/v2_cloud-workload-security_get_csm_threats_agent_rule.rs index 7d6f119d8..9d572982b 100644 --- a/examples/v2_cloud-workload-security_get_csm_threats_agent_rule.rs +++ b/examples/v2_cloud-workload-security_get_csm_threats_agent_rule.rs @@ -1,12 +1,12 @@ // Get a CSM Threats Agent rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_workload_security::CloudWorkloadSecurityAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_workload_security::CloudWorkloadSecurityAPI; #[tokio::main] async fn main() { // there is a valid "agent_rule_rc" in the system let agent_rule_data_id = std::env::var("AGENT_RULE_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudWorkloadSecurityAPI::with_config(configuration); let resp = api .get_csm_threats_agent_rule(agent_rule_data_id.clone()) diff --git a/examples/v2_cloud-workload-security_list_cloud_workload_security_agent_rules.rs b/examples/v2_cloud-workload-security_list_cloud_workload_security_agent_rules.rs index 0a7412fb6..1f6c914ac 100644 --- a/examples/v2_cloud-workload-security_list_cloud_workload_security_agent_rules.rs +++ b/examples/v2_cloud-workload-security_list_cloud_workload_security_agent_rules.rs @@ -1,10 +1,10 @@ // Get all Cloud Workload Security Agent rules returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_workload_security::CloudWorkloadSecurityAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_workload_security::CloudWorkloadSecurityAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudWorkloadSecurityAPI::with_config(configuration); let resp = api.list_cloud_workload_security_agent_rules().await; if let Ok(value) = resp { diff --git a/examples/v2_cloud-workload-security_list_csm_threats_agent_rules.rs b/examples/v2_cloud-workload-security_list_csm_threats_agent_rules.rs index 56bc3cfe8..a4f38ba7d 100644 --- a/examples/v2_cloud-workload-security_list_csm_threats_agent_rules.rs +++ b/examples/v2_cloud-workload-security_list_csm_threats_agent_rules.rs @@ -1,10 +1,10 @@ // Get all CSM Threats Agent rules returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_workload_security::CloudWorkloadSecurityAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_workload_security::CloudWorkloadSecurityAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudWorkloadSecurityAPI::with_config(configuration); let resp = api.list_csm_threats_agent_rules().await; if let Ok(value) = resp { diff --git a/examples/v2_cloud-workload-security_update_cloud_workload_security_agent_rule.rs b/examples/v2_cloud-workload-security_update_cloud_workload_security_agent_rule.rs index 5c8f281ff..967e4b7cc 100644 --- a/examples/v2_cloud-workload-security_update_cloud_workload_security_agent_rule.rs +++ b/examples/v2_cloud-workload-security_update_cloud_workload_security_agent_rule.rs @@ -1,6 +1,6 @@ // Update a Cloud Workload Security Agent rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_workload_security::CloudWorkloadSecurityAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_workload_security::CloudWorkloadSecurityAPI; use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleType; use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleUpdateAttributes; use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleUpdateData; @@ -19,7 +19,7 @@ async fn main() { CloudWorkloadSecurityAgentRuleType::AGENT_RULE, ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudWorkloadSecurityAPI::with_config(configuration); let resp = api .update_cloud_workload_security_agent_rule(agent_rule_data_id.clone(), body) diff --git a/examples/v2_cloud-workload-security_update_csm_threats_agent_rule.rs b/examples/v2_cloud-workload-security_update_csm_threats_agent_rule.rs index 1c603bf7e..e3c05cafc 100644 --- a/examples/v2_cloud-workload-security_update_csm_threats_agent_rule.rs +++ b/examples/v2_cloud-workload-security_update_csm_threats_agent_rule.rs @@ -1,6 +1,6 @@ // Update a CSM Threats Agent rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloud_workload_security::CloudWorkloadSecurityAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloud_workload_security::CloudWorkloadSecurityAPI; use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleType; use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleUpdateAttributes; use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleUpdateData; @@ -20,7 +20,7 @@ async fn main() { ) .id(agent_rule_data_id.clone()), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudWorkloadSecurityAPI::with_config(configuration); let resp = api .update_csm_threats_agent_rule(agent_rule_data_id.clone(), body) diff --git a/examples/v2_cloudflare-integration_create_cloudflare_account.rs b/examples/v2_cloudflare-integration_create_cloudflare_account.rs index a0b3117d4..39ea4a4db 100644 --- a/examples/v2_cloudflare-integration_create_cloudflare_account.rs +++ b/examples/v2_cloudflare-integration_create_cloudflare_account.rs @@ -1,6 +1,6 @@ // Add Cloudflare account returns "CREATED" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloudflare_integration::CloudflareIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloudflare_integration::CloudflareIntegrationAPI; use datadog_api_client::datadogV2::model::CloudflareAccountCreateRequest; use datadog_api_client::datadogV2::model::CloudflareAccountCreateRequestAttributes; use datadog_api_client::datadogV2::model::CloudflareAccountCreateRequestData; @@ -16,7 +16,7 @@ async fn main() { .email("dev@datadoghq.com".to_string()), CloudflareAccountType::CLOUDFLARE_ACCOUNTS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudflareIntegrationAPI::with_config(configuration); let resp = api.create_cloudflare_account(body).await; if let Ok(value) = resp { diff --git a/examples/v2_cloudflare-integration_delete_cloudflare_account.rs b/examples/v2_cloudflare-integration_delete_cloudflare_account.rs index b708b554b..c242a81db 100644 --- a/examples/v2_cloudflare-integration_delete_cloudflare_account.rs +++ b/examples/v2_cloudflare-integration_delete_cloudflare_account.rs @@ -1,10 +1,10 @@ // Delete Cloudflare account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloudflare_integration::CloudflareIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloudflare_integration::CloudflareIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudflareIntegrationAPI::with_config(configuration); let resp = api .delete_cloudflare_account("account_id".to_string()) diff --git a/examples/v2_cloudflare-integration_get_cloudflare_account.rs b/examples/v2_cloudflare-integration_get_cloudflare_account.rs index 3b93aebf8..b29e2b617 100644 --- a/examples/v2_cloudflare-integration_get_cloudflare_account.rs +++ b/examples/v2_cloudflare-integration_get_cloudflare_account.rs @@ -1,12 +1,12 @@ // Get Cloudflare account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloudflare_integration::CloudflareIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloudflare_integration::CloudflareIntegrationAPI; #[tokio::main] async fn main() { // there is a valid "cloudflare_account" in the system let cloudflare_account_data_id = std::env::var("CLOUDFLARE_ACCOUNT_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudflareIntegrationAPI::with_config(configuration); let resp = api .get_cloudflare_account(cloudflare_account_data_id.clone()) diff --git a/examples/v2_cloudflare-integration_list_cloudflare_accounts.rs b/examples/v2_cloudflare-integration_list_cloudflare_accounts.rs index 6f13f175c..aa0737cfa 100644 --- a/examples/v2_cloudflare-integration_list_cloudflare_accounts.rs +++ b/examples/v2_cloudflare-integration_list_cloudflare_accounts.rs @@ -1,10 +1,10 @@ // List Cloudflare accounts returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloudflare_integration::CloudflareIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloudflare_integration::CloudflareIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudflareIntegrationAPI::with_config(configuration); let resp = api.list_cloudflare_accounts().await; if let Ok(value) = resp { diff --git a/examples/v2_cloudflare-integration_update_cloudflare_account.rs b/examples/v2_cloudflare-integration_update_cloudflare_account.rs index 942cc08eb..10cc613b6 100644 --- a/examples/v2_cloudflare-integration_update_cloudflare_account.rs +++ b/examples/v2_cloudflare-integration_update_cloudflare_account.rs @@ -1,6 +1,6 @@ // Update Cloudflare account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_cloudflare_integration::CloudflareIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_cloudflare_integration::CloudflareIntegrationAPI; use datadog_api_client::datadogV2::model::CloudflareAccountType; use datadog_api_client::datadogV2::model::CloudflareAccountUpdateRequest; use datadog_api_client::datadogV2::model::CloudflareAccountUpdateRequestAttributes; @@ -19,7 +19,7 @@ async fn main() { ) .type_(CloudflareAccountType::CLOUDFLARE_ACCOUNTS), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = CloudflareIntegrationAPI::with_config(configuration); let resp = api .update_cloudflare_account(cloudflare_account_data_id.clone(), body) diff --git a/examples/v2_confluent-cloud_create_confluent_account.rs b/examples/v2_confluent-cloud_create_confluent_account.rs index 64852e1f2..9d55d391b 100644 --- a/examples/v2_confluent-cloud_create_confluent_account.rs +++ b/examples/v2_confluent-cloud_create_confluent_account.rs @@ -1,6 +1,6 @@ // Add Confluent account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_confluent_cloud::ConfluentCloudAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_confluent_cloud::ConfluentCloudAPI; use datadog_api_client::datadogV2::model::ConfluentAccountCreateRequest; use datadog_api_client::datadogV2::model::ConfluentAccountCreateRequestAttributes; use datadog_api_client::datadogV2::model::ConfluentAccountCreateRequestData; @@ -23,7 +23,7 @@ async fn main() { .tags(vec!["myTag".to_string(), "myTag2:myValue".to_string()]), ConfluentAccountType::CONFLUENT_CLOUD_ACCOUNTS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ConfluentCloudAPI::with_config(configuration); let resp = api.create_confluent_account(body).await; if let Ok(value) = resp { diff --git a/examples/v2_confluent-cloud_create_confluent_resource.rs b/examples/v2_confluent-cloud_create_confluent_resource.rs index 2d49dd74a..1b9d76e10 100644 --- a/examples/v2_confluent-cloud_create_confluent_resource.rs +++ b/examples/v2_confluent-cloud_create_confluent_resource.rs @@ -1,6 +1,6 @@ // Add resource to Confluent account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_confluent_cloud::ConfluentCloudAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_confluent_cloud::ConfluentCloudAPI; use datadog_api_client::datadogV2::model::ConfluentResourceRequest; use datadog_api_client::datadogV2::model::ConfluentResourceRequestAttributes; use datadog_api_client::datadogV2::model::ConfluentResourceRequestData; @@ -17,7 +17,7 @@ async fn main() { "exampleconfluentcloud".to_string(), ConfluentResourceType::CONFLUENT_CLOUD_RESOURCES, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ConfluentCloudAPI::with_config(configuration); let resp = api .create_confluent_resource(confluent_account_data_id.clone(), body) diff --git a/examples/v2_confluent-cloud_delete_confluent_account.rs b/examples/v2_confluent-cloud_delete_confluent_account.rs index ebfecde9a..2c4892a43 100644 --- a/examples/v2_confluent-cloud_delete_confluent_account.rs +++ b/examples/v2_confluent-cloud_delete_confluent_account.rs @@ -1,12 +1,12 @@ // Delete Confluent account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_confluent_cloud::ConfluentCloudAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_confluent_cloud::ConfluentCloudAPI; #[tokio::main] async fn main() { // there is a valid "confluent_account" in the system let confluent_account_data_id = std::env::var("CONFLUENT_ACCOUNT_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ConfluentCloudAPI::with_config(configuration); let resp = api .delete_confluent_account(confluent_account_data_id.clone()) diff --git a/examples/v2_confluent-cloud_delete_confluent_resource.rs b/examples/v2_confluent-cloud_delete_confluent_resource.rs index 5a8b4f19c..007f22ba7 100644 --- a/examples/v2_confluent-cloud_delete_confluent_resource.rs +++ b/examples/v2_confluent-cloud_delete_confluent_resource.rs @@ -1,10 +1,10 @@ // Delete resource from Confluent account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_confluent_cloud::ConfluentCloudAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_confluent_cloud::ConfluentCloudAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ConfluentCloudAPI::with_config(configuration); let resp = api .delete_confluent_resource("account_id".to_string(), "resource_id".to_string()) diff --git a/examples/v2_confluent-cloud_get_confluent_account.rs b/examples/v2_confluent-cloud_get_confluent_account.rs index 827425199..b8536c94c 100644 --- a/examples/v2_confluent-cloud_get_confluent_account.rs +++ b/examples/v2_confluent-cloud_get_confluent_account.rs @@ -1,12 +1,12 @@ // Get Confluent account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_confluent_cloud::ConfluentCloudAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_confluent_cloud::ConfluentCloudAPI; #[tokio::main] async fn main() { // there is a valid "confluent_account" in the system let confluent_account_data_id = std::env::var("CONFLUENT_ACCOUNT_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ConfluentCloudAPI::with_config(configuration); let resp = api .get_confluent_account(confluent_account_data_id.clone()) diff --git a/examples/v2_confluent-cloud_get_confluent_resource.rs b/examples/v2_confluent-cloud_get_confluent_resource.rs index d85eee881..b4e58b4bd 100644 --- a/examples/v2_confluent-cloud_get_confluent_resource.rs +++ b/examples/v2_confluent-cloud_get_confluent_resource.rs @@ -1,10 +1,10 @@ // Get resource from Confluent account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_confluent_cloud::ConfluentCloudAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_confluent_cloud::ConfluentCloudAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ConfluentCloudAPI::with_config(configuration); let resp = api .get_confluent_resource("account_id".to_string(), "resource_id".to_string()) diff --git a/examples/v2_confluent-cloud_list_confluent_account.rs b/examples/v2_confluent-cloud_list_confluent_account.rs index d5956d5fd..0db0c6084 100644 --- a/examples/v2_confluent-cloud_list_confluent_account.rs +++ b/examples/v2_confluent-cloud_list_confluent_account.rs @@ -1,10 +1,10 @@ // List Confluent accounts returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_confluent_cloud::ConfluentCloudAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_confluent_cloud::ConfluentCloudAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ConfluentCloudAPI::with_config(configuration); let resp = api.list_confluent_account().await; if let Ok(value) = resp { diff --git a/examples/v2_confluent-cloud_list_confluent_resource.rs b/examples/v2_confluent-cloud_list_confluent_resource.rs index b4156df26..73f1e25c2 100644 --- a/examples/v2_confluent-cloud_list_confluent_resource.rs +++ b/examples/v2_confluent-cloud_list_confluent_resource.rs @@ -1,10 +1,10 @@ // List Confluent Account resources returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_confluent_cloud::ConfluentCloudAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_confluent_cloud::ConfluentCloudAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ConfluentCloudAPI::with_config(configuration); let resp = api.list_confluent_resource("account_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v2_confluent-cloud_update_confluent_account.rs b/examples/v2_confluent-cloud_update_confluent_account.rs index ebb52e02a..3162f081b 100644 --- a/examples/v2_confluent-cloud_update_confluent_account.rs +++ b/examples/v2_confluent-cloud_update_confluent_account.rs @@ -1,6 +1,6 @@ // Update Confluent account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_confluent_cloud::ConfluentCloudAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_confluent_cloud::ConfluentCloudAPI; use datadog_api_client::datadogV2::model::ConfluentAccountType; use datadog_api_client::datadogV2::model::ConfluentAccountUpdateRequest; use datadog_api_client::datadogV2::model::ConfluentAccountUpdateRequestAttributes; @@ -20,7 +20,7 @@ async fn main() { .tags(vec!["updated_tag:val".to_string()]), ConfluentAccountType::CONFLUENT_CLOUD_ACCOUNTS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ConfluentCloudAPI::with_config(configuration); let resp = api .update_confluent_account(confluent_account_data_id.clone(), body) diff --git a/examples/v2_confluent-cloud_update_confluent_resource.rs b/examples/v2_confluent-cloud_update_confluent_resource.rs index 36762821e..61bce314a 100644 --- a/examples/v2_confluent-cloud_update_confluent_resource.rs +++ b/examples/v2_confluent-cloud_update_confluent_resource.rs @@ -1,6 +1,6 @@ // Update resource in Confluent account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_confluent_cloud::ConfluentCloudAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_confluent_cloud::ConfluentCloudAPI; use datadog_api_client::datadogV2::model::ConfluentResourceRequest; use datadog_api_client::datadogV2::model::ConfluentResourceRequestAttributes; use datadog_api_client::datadogV2::model::ConfluentResourceRequestData; @@ -15,7 +15,7 @@ async fn main() { "resource-id-123".to_string(), ConfluentResourceType::CONFLUENT_CLOUD_RESOURCES, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ConfluentCloudAPI::with_config(configuration); let resp = api .update_confluent_resource("account_id".to_string(), "resource_id".to_string(), body) diff --git a/examples/v2_container-images_list_container_images.rs b/examples/v2_container-images_list_container_images.rs index 10589d6c9..31ce5337b 100644 --- a/examples/v2_container-images_list_container_images.rs +++ b/examples/v2_container-images_list_container_images.rs @@ -1,11 +1,11 @@ // Get all Container Images returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_container_images::ContainerImagesAPI; -use datadog_api_client::datadogV2::api::api_container_images::ListContainerImagesOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_container_images::ContainerImagesAPI; +use datadog_api_client::datadogV2::api_container_images::ListContainerImagesOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ContainerImagesAPI::with_config(configuration); let resp = api .list_container_images(ListContainerImagesOptionalParams::default()) diff --git a/examples/v2_container-images_list_container_images_3088586393.rs b/examples/v2_container-images_list_container_images_3088586393.rs index aedb28a7a..0085b53c0 100644 --- a/examples/v2_container-images_list_container_images_3088586393.rs +++ b/examples/v2_container-images_list_container_images_3088586393.rs @@ -1,13 +1,13 @@ // Get all Container Images returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_container_images::ContainerImagesAPI; -use datadog_api_client::datadogV2::api::api_container_images::ListContainerImagesOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_container_images::ContainerImagesAPI; +use datadog_api_client::datadogV2::api_container_images::ListContainerImagesOptionalParams; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ContainerImagesAPI::with_config(configuration); let response = api.list_container_images_with_pagination( ListContainerImagesOptionalParams::default().page_size(2), diff --git a/examples/v2_container-images_list_container_images_3974828736.rs b/examples/v2_container-images_list_container_images_3974828736.rs index 725f50b1f..8f1b9e2a6 100644 --- a/examples/v2_container-images_list_container_images_3974828736.rs +++ b/examples/v2_container-images_list_container_images_3974828736.rs @@ -1,11 +1,11 @@ // Get all Container Image groups returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_container_images::ContainerImagesAPI; -use datadog_api_client::datadogV2::api::api_container_images::ListContainerImagesOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_container_images::ContainerImagesAPI; +use datadog_api_client::datadogV2::api_container_images::ListContainerImagesOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ContainerImagesAPI::with_config(configuration); let resp = api .list_container_images( diff --git a/examples/v2_containers_list_containers.rs b/examples/v2_containers_list_containers.rs index c6ebadbb6..6fdd243b4 100644 --- a/examples/v2_containers_list_containers.rs +++ b/examples/v2_containers_list_containers.rs @@ -1,11 +1,11 @@ // Get All Containers returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_containers::ContainersAPI; -use datadog_api_client::datadogV2::api::api_containers::ListContainersOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_containers::ContainersAPI; +use datadog_api_client::datadogV2::api_containers::ListContainersOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ContainersAPI::with_config(configuration); let resp = api .list_containers(ListContainersOptionalParams::default()) diff --git a/examples/v2_containers_list_containers_2175733917.rs b/examples/v2_containers_list_containers_2175733917.rs index bd295dca1..6727c9e15 100644 --- a/examples/v2_containers_list_containers_2175733917.rs +++ b/examples/v2_containers_list_containers_2175733917.rs @@ -1,11 +1,11 @@ // Get All Container groups returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_containers::ContainersAPI; -use datadog_api_client::datadogV2::api::api_containers::ListContainersOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_containers::ContainersAPI; +use datadog_api_client::datadogV2::api_containers::ListContainersOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ContainersAPI::with_config(configuration); let resp = api .list_containers( diff --git a/examples/v2_containers_list_containers_931009654.rs b/examples/v2_containers_list_containers_931009654.rs index 4fbff9ddb..d95146931 100644 --- a/examples/v2_containers_list_containers_931009654.rs +++ b/examples/v2_containers_list_containers_931009654.rs @@ -1,13 +1,13 @@ // Get All Containers returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_containers::ContainersAPI; -use datadog_api_client::datadogV2::api::api_containers::ListContainersOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_containers::ContainersAPI; +use datadog_api_client::datadogV2::api_containers::ListContainersOptionalParams; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ContainersAPI::with_config(configuration); let response = api.list_containers_with_pagination(ListContainersOptionalParams::default().page_size(2)); diff --git a/examples/v2_dashboard-lists_create_dashboard_list_items.rs b/examples/v2_dashboard-lists_create_dashboard_list_items.rs index a97ff8add..206332860 100644 --- a/examples/v2_dashboard-lists_create_dashboard_list_items.rs +++ b/examples/v2_dashboard-lists_create_dashboard_list_items.rs @@ -1,6 +1,6 @@ // Add Items to a Dashboard List returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_dashboard_lists::DashboardListsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_dashboard_lists::DashboardListsAPI; use datadog_api_client::datadogV2::model::DashboardListAddItemsRequest; use datadog_api_client::datadogV2::model::DashboardListItemRequest; use datadog_api_client::datadogV2::model::DashboardType; @@ -11,7 +11,7 @@ async fn main() { "q5j-nti-fv6".to_string(), DashboardType::HOST_TIMEBOARD, )]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardListsAPI::with_config(configuration); let resp = api .create_dashboard_list_items(9223372036854775807, body) diff --git a/examples/v2_dashboard-lists_create_dashboard_list_items_3995409989.rs b/examples/v2_dashboard-lists_create_dashboard_list_items_3995409989.rs index 41d635134..52ce410c5 100644 --- a/examples/v2_dashboard-lists_create_dashboard_list_items_3995409989.rs +++ b/examples/v2_dashboard-lists_create_dashboard_list_items_3995409989.rs @@ -1,7 +1,7 @@ // Add custom timeboard dashboard to an existing dashboard list returns "OK" // response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_dashboard_lists::DashboardListsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_dashboard_lists::DashboardListsAPI; use datadog_api_client::datadogV2::model::DashboardListAddItemsRequest; use datadog_api_client::datadogV2::model::DashboardListItemRequest; use datadog_api_client::datadogV2::model::DashboardType; @@ -17,7 +17,7 @@ async fn main() { dashboard_id.clone(), DashboardType::CUSTOM_TIMEBOARD, )]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardListsAPI::with_config(configuration); let resp = api .create_dashboard_list_items(dashboard_list_id.clone(), body) diff --git a/examples/v2_dashboard-lists_create_dashboard_list_items_825696022.rs b/examples/v2_dashboard-lists_create_dashboard_list_items_825696022.rs index 5b5d5eadb..35e0f8a45 100644 --- a/examples/v2_dashboard-lists_create_dashboard_list_items_825696022.rs +++ b/examples/v2_dashboard-lists_create_dashboard_list_items_825696022.rs @@ -1,7 +1,7 @@ // Add custom screenboard dashboard to an existing dashboard list returns "OK" // response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_dashboard_lists::DashboardListsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_dashboard_lists::DashboardListsAPI; use datadog_api_client::datadogV2::model::DashboardListAddItemsRequest; use datadog_api_client::datadogV2::model::DashboardListItemRequest; use datadog_api_client::datadogV2::model::DashboardType; @@ -17,7 +17,7 @@ async fn main() { screenboard_dashboard_id.clone(), DashboardType::CUSTOM_SCREENBOARD, )]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardListsAPI::with_config(configuration); let resp = api .create_dashboard_list_items(dashboard_list_id.clone(), body) diff --git a/examples/v2_dashboard-lists_delete_dashboard_list_items.rs b/examples/v2_dashboard-lists_delete_dashboard_list_items.rs index 3fb35e2e7..71ffb561d 100644 --- a/examples/v2_dashboard-lists_delete_dashboard_list_items.rs +++ b/examples/v2_dashboard-lists_delete_dashboard_list_items.rs @@ -1,6 +1,6 @@ // Delete items from a dashboard list returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_dashboard_lists::DashboardListsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_dashboard_lists::DashboardListsAPI; use datadog_api_client::datadogV2::model::DashboardListDeleteItemsRequest; use datadog_api_client::datadogV2::model::DashboardListItemRequest; use datadog_api_client::datadogV2::model::DashboardType; @@ -12,7 +12,7 @@ async fn main() { "q5j-nti-fv6".to_string(), DashboardType::HOST_TIMEBOARD, )]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardListsAPI::with_config(configuration); let resp = api .delete_dashboard_list_items(9223372036854775807, body) diff --git a/examples/v2_dashboard-lists_delete_dashboard_list_items_2656706656.rs b/examples/v2_dashboard-lists_delete_dashboard_list_items_2656706656.rs index 0a45c10a5..0dfba9d42 100644 --- a/examples/v2_dashboard-lists_delete_dashboard_list_items_2656706656.rs +++ b/examples/v2_dashboard-lists_delete_dashboard_list_items_2656706656.rs @@ -1,7 +1,7 @@ // Delete custom timeboard dashboard from an existing dashboard list returns "OK" // response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_dashboard_lists::DashboardListsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_dashboard_lists::DashboardListsAPI; use datadog_api_client::datadogV2::model::DashboardListDeleteItemsRequest; use datadog_api_client::datadogV2::model::DashboardListItemRequest; use datadog_api_client::datadogV2::model::DashboardType; @@ -18,7 +18,7 @@ async fn main() { dashboard_id.clone(), DashboardType::CUSTOM_TIMEBOARD, )]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardListsAPI::with_config(configuration); let resp = api .delete_dashboard_list_items(dashboard_list_id.clone(), body) diff --git a/examples/v2_dashboard-lists_delete_dashboard_list_items_3851624753.rs b/examples/v2_dashboard-lists_delete_dashboard_list_items_3851624753.rs index 9b4e7c98c..8a705bee1 100644 --- a/examples/v2_dashboard-lists_delete_dashboard_list_items_3851624753.rs +++ b/examples/v2_dashboard-lists_delete_dashboard_list_items_3851624753.rs @@ -1,7 +1,7 @@ // Delete custom screenboard dashboard from an existing dashboard list returns // "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_dashboard_lists::DashboardListsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_dashboard_lists::DashboardListsAPI; use datadog_api_client::datadogV2::model::DashboardListDeleteItemsRequest; use datadog_api_client::datadogV2::model::DashboardListItemRequest; use datadog_api_client::datadogV2::model::DashboardType; @@ -18,7 +18,7 @@ async fn main() { screenboard_dashboard_id.clone(), DashboardType::CUSTOM_SCREENBOARD, )]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardListsAPI::with_config(configuration); let resp = api .delete_dashboard_list_items(dashboard_list_id.clone(), body) diff --git a/examples/v2_dashboard-lists_get_dashboard_list_items.rs b/examples/v2_dashboard-lists_get_dashboard_list_items.rs index cc723f471..87de05a13 100644 --- a/examples/v2_dashboard-lists_get_dashboard_list_items.rs +++ b/examples/v2_dashboard-lists_get_dashboard_list_items.rs @@ -1,12 +1,12 @@ // Get items of a Dashboard List returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_dashboard_lists::DashboardListsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_dashboard_lists::DashboardListsAPI; #[tokio::main] async fn main() { // there is a valid "dashboard_list" in the system let dashboard_list_id: i64 = std::env::var("DASHBOARD_LIST_ID").unwrap().parse().unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardListsAPI::with_config(configuration); let resp = api .get_dashboard_list_items(dashboard_list_id.clone()) diff --git a/examples/v2_dashboard-lists_update_dashboard_list_items.rs b/examples/v2_dashboard-lists_update_dashboard_list_items.rs index b9db775aa..19fcf601d 100644 --- a/examples/v2_dashboard-lists_update_dashboard_list_items.rs +++ b/examples/v2_dashboard-lists_update_dashboard_list_items.rs @@ -1,6 +1,6 @@ // Update items of a dashboard list returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_dashboard_lists::DashboardListsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_dashboard_lists::DashboardListsAPI; use datadog_api_client::datadogV2::model::DashboardListItemRequest; use datadog_api_client::datadogV2::model::DashboardListUpdateItemsRequest; use datadog_api_client::datadogV2::model::DashboardType; @@ -17,7 +17,7 @@ async fn main() { screenboard_dashboard_id.clone(), DashboardType::CUSTOM_SCREENBOARD, )]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DashboardListsAPI::with_config(configuration); let resp = api .update_dashboard_list_items(dashboard_list_id.clone(), body) diff --git a/examples/v2_dora-metrics_create_dora_deployment.rs b/examples/v2_dora-metrics_create_dora_deployment.rs index cb10679a6..93dce5ac8 100644 --- a/examples/v2_dora-metrics_create_dora_deployment.rs +++ b/examples/v2_dora-metrics_create_dora_deployment.rs @@ -1,6 +1,6 @@ // Send a deployment event for DORA Metrics returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_dora_metrics::DORAMetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_dora_metrics::DORAMetricsAPI; use datadog_api_client::datadogV2::model::DORADeploymentRequest; use datadog_api_client::datadogV2::model::DORADeploymentRequestAttributes; use datadog_api_client::datadogV2::model::DORADeploymentRequestData; @@ -20,7 +20,7 @@ async fn main() { )) .version("v1.12.07".to_string()), )); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.CreateDORADeployment", true); let api = DORAMetricsAPI::with_config(configuration); let resp = api.create_dora_deployment(body).await; diff --git a/examples/v2_dora-metrics_create_dora_incident.rs b/examples/v2_dora-metrics_create_dora_incident.rs index fef8370cb..a811344f0 100644 --- a/examples/v2_dora-metrics_create_dora_incident.rs +++ b/examples/v2_dora-metrics_create_dora_incident.rs @@ -1,6 +1,6 @@ // Send an incident event for DORA Metrics returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_dora_metrics::DORAMetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_dora_metrics::DORAMetricsAPI; use datadog_api_client::datadogV2::model::DORAGitInfo; use datadog_api_client::datadogV2::model::DORAIncidentRequest; use datadog_api_client::datadogV2::model::DORAIncidentRequestAttributes; @@ -21,7 +21,7 @@ async fn main() { .team("backend".to_string()) .version("v1.12.07".to_string()), )); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.CreateDORAIncident", true); let api = DORAMetricsAPI::with_config(configuration); let resp = api.create_dora_incident(body).await; diff --git a/examples/v2_downtimes_cancel_downtime.rs b/examples/v2_downtimes_cancel_downtime.rs index 5405f67c1..f6401f0e4 100644 --- a/examples/v2_downtimes_cancel_downtime.rs +++ b/examples/v2_downtimes_cancel_downtime.rs @@ -1,12 +1,12 @@ // Cancel a downtime returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_downtimes::DowntimesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_downtimes::DowntimesAPI; #[tokio::main] async fn main() { // there is a valid "downtime_v2" in the system let downtime_v2_data_id = std::env::var("DOWNTIME_V2_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DowntimesAPI::with_config(configuration); let resp = api.cancel_downtime(downtime_v2_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_downtimes_create_downtime.rs b/examples/v2_downtimes_create_downtime.rs index 56d10e520..eb25c00f8 100644 --- a/examples/v2_downtimes_create_downtime.rs +++ b/examples/v2_downtimes_create_downtime.rs @@ -1,6 +1,6 @@ // Schedule a downtime returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_downtimes::DowntimesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_downtimes::DowntimesAPI; use datadog_api_client::datadogV2::model::DowntimeCreateRequest; use datadog_api_client::datadogV2::model::DowntimeCreateRequestAttributes; use datadog_api_client::datadogV2::model::DowntimeCreateRequestData; @@ -27,7 +27,7 @@ async fn main() { ), DowntimeResourceType::DOWNTIME, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DowntimesAPI::with_config(configuration); let resp = api.create_downtime(body).await; if let Ok(value) = resp { diff --git a/examples/v2_downtimes_get_downtime.rs b/examples/v2_downtimes_get_downtime.rs index 7f94c8845..b06ddf68a 100644 --- a/examples/v2_downtimes_get_downtime.rs +++ b/examples/v2_downtimes_get_downtime.rs @@ -1,13 +1,13 @@ // Get a downtime returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_downtimes::DowntimesAPI; -use datadog_api_client::datadogV2::api::api_downtimes::GetDowntimeOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_downtimes::DowntimesAPI; +use datadog_api_client::datadogV2::api_downtimes::GetDowntimeOptionalParams; #[tokio::main] async fn main() { // there is a valid "downtime_v2" in the system let downtime_v2_data_id = std::env::var("DOWNTIME_V2_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DowntimesAPI::with_config(configuration); let resp = api .get_downtime( diff --git a/examples/v2_downtimes_list_downtimes.rs b/examples/v2_downtimes_list_downtimes.rs index 60e84615d..cd93c83bb 100644 --- a/examples/v2_downtimes_list_downtimes.rs +++ b/examples/v2_downtimes_list_downtimes.rs @@ -1,11 +1,11 @@ // Get all downtimes returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_downtimes::DowntimesAPI; -use datadog_api_client::datadogV2::api::api_downtimes::ListDowntimesOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_downtimes::DowntimesAPI; +use datadog_api_client::datadogV2::api_downtimes::ListDowntimesOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DowntimesAPI::with_config(configuration); let resp = api .list_downtimes(ListDowntimesOptionalParams::default()) diff --git a/examples/v2_downtimes_list_downtimes_805770330.rs b/examples/v2_downtimes_list_downtimes_805770330.rs index bfa23efad..e043e4d0d 100644 --- a/examples/v2_downtimes_list_downtimes_805770330.rs +++ b/examples/v2_downtimes_list_downtimes_805770330.rs @@ -1,13 +1,13 @@ // Get all downtimes returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_downtimes::DowntimesAPI; -use datadog_api_client::datadogV2::api::api_downtimes::ListDowntimesOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_downtimes::DowntimesAPI; +use datadog_api_client::datadogV2::api_downtimes::ListDowntimesOptionalParams; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DowntimesAPI::with_config(configuration); let response = api.list_downtimes_with_pagination(ListDowntimesOptionalParams::default().page_limit(2)); diff --git a/examples/v2_downtimes_list_monitor_downtimes.rs b/examples/v2_downtimes_list_monitor_downtimes.rs index b8f91c103..01ea2d586 100644 --- a/examples/v2_downtimes_list_monitor_downtimes.rs +++ b/examples/v2_downtimes_list_monitor_downtimes.rs @@ -1,11 +1,11 @@ // Get active downtimes for a monitor returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_downtimes::DowntimesAPI; -use datadog_api_client::datadogV2::api::api_downtimes::ListMonitorDowntimesOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_downtimes::DowntimesAPI; +use datadog_api_client::datadogV2::api_downtimes::ListMonitorDowntimesOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DowntimesAPI::with_config(configuration); let resp = api .list_monitor_downtimes(35534610, ListMonitorDowntimesOptionalParams::default()) diff --git a/examples/v2_downtimes_list_monitor_downtimes_3316718253.rs b/examples/v2_downtimes_list_monitor_downtimes_3316718253.rs index 478915184..cdc544fec 100644 --- a/examples/v2_downtimes_list_monitor_downtimes_3316718253.rs +++ b/examples/v2_downtimes_list_monitor_downtimes_3316718253.rs @@ -1,13 +1,13 @@ // Get active downtimes for a monitor returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_downtimes::DowntimesAPI; -use datadog_api_client::datadogV2::api::api_downtimes::ListMonitorDowntimesOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_downtimes::DowntimesAPI; +use datadog_api_client::datadogV2::api_downtimes::ListMonitorDowntimesOptionalParams; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DowntimesAPI::with_config(configuration); let response = api.list_monitor_downtimes_with_pagination( 9223372036854775807, diff --git a/examples/v2_downtimes_update_downtime.rs b/examples/v2_downtimes_update_downtime.rs index f76b04126..431492f26 100644 --- a/examples/v2_downtimes_update_downtime.rs +++ b/examples/v2_downtimes_update_downtime.rs @@ -1,6 +1,6 @@ // Update a downtime returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_downtimes::DowntimesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_downtimes::DowntimesAPI; use datadog_api_client::datadogV2::model::DowntimeResourceType; use datadog_api_client::datadogV2::model::DowntimeUpdateRequest; use datadog_api_client::datadogV2::model::DowntimeUpdateRequestAttributes; @@ -15,7 +15,7 @@ async fn main() { downtime_v2_data_id.clone(), DowntimeResourceType::DOWNTIME, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = DowntimesAPI::with_config(configuration); let resp = api.update_downtime(downtime_v2_data_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_events_list_events.rs b/examples/v2_events_list_events.rs index 6be467d73..f0301c6db 100644 --- a/examples/v2_events_list_events.rs +++ b/examples/v2_events_list_events.rs @@ -1,11 +1,11 @@ // Get a list of events returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_events::EventsAPI; -use datadog_api_client::datadogV2::api::api_events::ListEventsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_events::EventsAPI; +use datadog_api_client::datadogV2::api_events::ListEventsOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = EventsAPI::with_config(configuration); let resp = api.list_events(ListEventsOptionalParams::default()).await; if let Ok(value) = resp { diff --git a/examples/v2_events_list_events_1527584014.rs b/examples/v2_events_list_events_1527584014.rs index 1a106cb3b..79726b5ae 100644 --- a/examples/v2_events_list_events_1527584014.rs +++ b/examples/v2_events_list_events_1527584014.rs @@ -1,13 +1,13 @@ // Get a list of events returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_events::EventsAPI; -use datadog_api_client::datadogV2::api::api_events::ListEventsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_events::EventsAPI; +use datadog_api_client::datadogV2::api_events::ListEventsOptionalParams; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = EventsAPI::with_config(configuration); let response = api.list_events_with_pagination( ListEventsOptionalParams::default() diff --git a/examples/v2_events_list_events_2663715109.rs b/examples/v2_events_list_events_2663715109.rs index 8617acb7f..bfc213c4f 100644 --- a/examples/v2_events_list_events_2663715109.rs +++ b/examples/v2_events_list_events_2663715109.rs @@ -1,11 +1,11 @@ // Get a quick list of events returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_events::EventsAPI; -use datadog_api_client::datadogV2::api::api_events::ListEventsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_events::EventsAPI; +use datadog_api_client::datadogV2::api_events::ListEventsOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = EventsAPI::with_config(configuration); let resp = api .list_events( diff --git a/examples/v2_events_search_events.rs b/examples/v2_events_search_events.rs index 592646cce..752acfcc0 100644 --- a/examples/v2_events_search_events.rs +++ b/examples/v2_events_search_events.rs @@ -1,7 +1,7 @@ // Search events returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_events::EventsAPI; -use datadog_api_client::datadogV2::api::api_events::SearchEventsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_events::EventsAPI; +use datadog_api_client::datadogV2::api_events::SearchEventsOptionalParams; use datadog_api_client::datadogV2::model::EventsListRequest; use datadog_api_client::datadogV2::model::EventsQueryFilter; use datadog_api_client::datadogV2::model::EventsRequestPage; @@ -18,7 +18,7 @@ async fn main() { ) .page(EventsRequestPage::new().limit(5)) .sort(EventsSort::TIMESTAMP_ASCENDING); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = EventsAPI::with_config(configuration); let resp = api .search_events(SearchEventsOptionalParams::default().body(body)) diff --git a/examples/v2_events_search_events_3856995058.rs b/examples/v2_events_search_events_3856995058.rs index 10d015e29..c86d100c0 100644 --- a/examples/v2_events_search_events_3856995058.rs +++ b/examples/v2_events_search_events_3856995058.rs @@ -1,7 +1,7 @@ // Search events returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_events::EventsAPI; -use datadog_api_client::datadogV2::api::api_events::SearchEventsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_events::EventsAPI; +use datadog_api_client::datadogV2::api_events::SearchEventsOptionalParams; use datadog_api_client::datadogV2::model::EventsListRequest; use datadog_api_client::datadogV2::model::EventsQueryFilter; use datadog_api_client::datadogV2::model::EventsQueryOptions; @@ -21,7 +21,7 @@ async fn main() { .options(EventsQueryOptions::new().timezone("GMT".to_string())) .page(EventsRequestPage::new().limit(2)) .sort(EventsSort::TIMESTAMP_ASCENDING); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = EventsAPI::with_config(configuration); let response = api.search_events_with_pagination(SearchEventsOptionalParams::default().body(body)); diff --git a/examples/v2_fastly-integration_create_fastly_account.rs b/examples/v2_fastly-integration_create_fastly_account.rs index 563d8b2b5..d41184a2d 100644 --- a/examples/v2_fastly-integration_create_fastly_account.rs +++ b/examples/v2_fastly-integration_create_fastly_account.rs @@ -1,6 +1,6 @@ // Add Fastly account returns "CREATED" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_fastly_integration::FastlyIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_fastly_integration::FastlyIntegrationAPI; use datadog_api_client::datadogV2::model::FastlyAccountCreateRequest; use datadog_api_client::datadogV2::model::FastlyAccountCreateRequestAttributes; use datadog_api_client::datadogV2::model::FastlyAccountCreateRequestData; @@ -16,7 +16,7 @@ async fn main() { .services(vec![]), FastlyAccountType::FASTLY_ACCOUNTS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = FastlyIntegrationAPI::with_config(configuration); let resp = api.create_fastly_account(body).await; if let Ok(value) = resp { diff --git a/examples/v2_fastly-integration_create_fastly_service.rs b/examples/v2_fastly-integration_create_fastly_service.rs index e2ee79c32..172e5895e 100644 --- a/examples/v2_fastly-integration_create_fastly_service.rs +++ b/examples/v2_fastly-integration_create_fastly_service.rs @@ -1,6 +1,6 @@ // Add Fastly service returns "CREATED" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_fastly_integration::FastlyIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_fastly_integration::FastlyIntegrationAPI; use datadog_api_client::datadogV2::model::FastlyServiceAttributes; use datadog_api_client::datadogV2::model::FastlyServiceData; use datadog_api_client::datadogV2::model::FastlyServiceRequest; @@ -15,7 +15,7 @@ async fn main() { .tags(vec!["myTag".to_string(), "myTag2:myValue".to_string()]), ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = FastlyIntegrationAPI::with_config(configuration); let resp = api .create_fastly_service("account_id".to_string(), body) diff --git a/examples/v2_fastly-integration_delete_fastly_account.rs b/examples/v2_fastly-integration_delete_fastly_account.rs index 4e85b9bd4..eeed863fa 100644 --- a/examples/v2_fastly-integration_delete_fastly_account.rs +++ b/examples/v2_fastly-integration_delete_fastly_account.rs @@ -1,10 +1,10 @@ // Delete Fastly account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_fastly_integration::FastlyIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_fastly_integration::FastlyIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = FastlyIntegrationAPI::with_config(configuration); let resp = api.delete_fastly_account("account_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v2_fastly-integration_delete_fastly_service.rs b/examples/v2_fastly-integration_delete_fastly_service.rs index 600216cd7..2bd5c31b8 100644 --- a/examples/v2_fastly-integration_delete_fastly_service.rs +++ b/examples/v2_fastly-integration_delete_fastly_service.rs @@ -1,10 +1,10 @@ // Delete Fastly service returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_fastly_integration::FastlyIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_fastly_integration::FastlyIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = FastlyIntegrationAPI::with_config(configuration); let resp = api .delete_fastly_service("account_id".to_string(), "service_id".to_string()) diff --git a/examples/v2_fastly-integration_get_fastly_account.rs b/examples/v2_fastly-integration_get_fastly_account.rs index 1b074305c..df0184235 100644 --- a/examples/v2_fastly-integration_get_fastly_account.rs +++ b/examples/v2_fastly-integration_get_fastly_account.rs @@ -1,12 +1,12 @@ // Get Fastly account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_fastly_integration::FastlyIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_fastly_integration::FastlyIntegrationAPI; #[tokio::main] async fn main() { // there is a valid "fastly_account" in the system let fastly_account_data_id = std::env::var("FASTLY_ACCOUNT_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = FastlyIntegrationAPI::with_config(configuration); let resp = api.get_fastly_account(fastly_account_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_fastly-integration_get_fastly_service.rs b/examples/v2_fastly-integration_get_fastly_service.rs index bcd11ed3b..65babf67f 100644 --- a/examples/v2_fastly-integration_get_fastly_service.rs +++ b/examples/v2_fastly-integration_get_fastly_service.rs @@ -1,10 +1,10 @@ // Get Fastly service returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_fastly_integration::FastlyIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_fastly_integration::FastlyIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = FastlyIntegrationAPI::with_config(configuration); let resp = api .get_fastly_service("account_id".to_string(), "service_id".to_string()) diff --git a/examples/v2_fastly-integration_list_fastly_accounts.rs b/examples/v2_fastly-integration_list_fastly_accounts.rs index 5cd6d152a..ceb8c92cd 100644 --- a/examples/v2_fastly-integration_list_fastly_accounts.rs +++ b/examples/v2_fastly-integration_list_fastly_accounts.rs @@ -1,10 +1,10 @@ // List Fastly accounts returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_fastly_integration::FastlyIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_fastly_integration::FastlyIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = FastlyIntegrationAPI::with_config(configuration); let resp = api.list_fastly_accounts().await; if let Ok(value) = resp { diff --git a/examples/v2_fastly-integration_list_fastly_services.rs b/examples/v2_fastly-integration_list_fastly_services.rs index ca9923786..2dd7b1813 100644 --- a/examples/v2_fastly-integration_list_fastly_services.rs +++ b/examples/v2_fastly-integration_list_fastly_services.rs @@ -1,10 +1,10 @@ // List Fastly services returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_fastly_integration::FastlyIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_fastly_integration::FastlyIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = FastlyIntegrationAPI::with_config(configuration); let resp = api.list_fastly_services("account_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v2_fastly-integration_update_fastly_account.rs b/examples/v2_fastly-integration_update_fastly_account.rs index 01f481da1..06c504b05 100644 --- a/examples/v2_fastly-integration_update_fastly_account.rs +++ b/examples/v2_fastly-integration_update_fastly_account.rs @@ -1,6 +1,6 @@ // Update Fastly account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_fastly_integration::FastlyIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_fastly_integration::FastlyIntegrationAPI; use datadog_api_client::datadogV2::model::FastlyAccountType; use datadog_api_client::datadogV2::model::FastlyAccountUpdateRequest; use datadog_api_client::datadogV2::model::FastlyAccountUpdateRequestAttributes; @@ -17,7 +17,7 @@ async fn main() { ) .type_(FastlyAccountType::FASTLY_ACCOUNTS), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = FastlyIntegrationAPI::with_config(configuration); let resp = api .update_fastly_account(fastly_account_data_id.clone(), body) diff --git a/examples/v2_fastly-integration_update_fastly_service.rs b/examples/v2_fastly-integration_update_fastly_service.rs index 06b27ca16..e0c2699f9 100644 --- a/examples/v2_fastly-integration_update_fastly_service.rs +++ b/examples/v2_fastly-integration_update_fastly_service.rs @@ -1,6 +1,6 @@ // Update Fastly service returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_fastly_integration::FastlyIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_fastly_integration::FastlyIntegrationAPI; use datadog_api_client::datadogV2::model::FastlyServiceAttributes; use datadog_api_client::datadogV2::model::FastlyServiceData; use datadog_api_client::datadogV2::model::FastlyServiceRequest; @@ -15,7 +15,7 @@ async fn main() { .tags(vec!["myTag".to_string(), "myTag2:myValue".to_string()]), ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = FastlyIntegrationAPI::with_config(configuration); let resp = api .update_fastly_service("account_id".to_string(), "service_id".to_string(), body) diff --git a/examples/v2_gcp-integration_create_gcpsts_account.rs b/examples/v2_gcp-integration_create_gcpsts_account.rs index 9290866a7..b90b41383 100644 --- a/examples/v2_gcp-integration_create_gcpsts_account.rs +++ b/examples/v2_gcp-integration_create_gcpsts_account.rs @@ -1,6 +1,6 @@ // Create a new entry for your service account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_gcp_integration::GCPIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_gcp_integration::GCPIntegrationAPI; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountAttributes; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountCreateRequest; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountData; @@ -19,7 +19,7 @@ async fn main() { ) .type_(GCPServiceAccountType::GCP_SERVICE_ACCOUNT), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = GCPIntegrationAPI::with_config(configuration); let resp = api.create_gcpsts_account(body).await; if let Ok(value) = resp { diff --git a/examples/v2_gcp-integration_create_gcpsts_account_109518525.rs b/examples/v2_gcp-integration_create_gcpsts_account_109518525.rs index a4b0edb29..a4a6e37b0 100644 --- a/examples/v2_gcp-integration_create_gcpsts_account_109518525.rs +++ b/examples/v2_gcp-integration_create_gcpsts_account_109518525.rs @@ -1,7 +1,7 @@ // Create a new entry for your service account with account_tags returns "OK" // response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_gcp_integration::GCPIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_gcp_integration::GCPIntegrationAPI; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountAttributes; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountCreateRequest; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountData; @@ -21,7 +21,7 @@ async fn main() { ) .type_(GCPServiceAccountType::GCP_SERVICE_ACCOUNT), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = GCPIntegrationAPI::with_config(configuration); let resp = api.create_gcpsts_account(body).await; if let Ok(value) = resp { diff --git a/examples/v2_gcp-integration_create_gcpsts_account_130557025.rs b/examples/v2_gcp-integration_create_gcpsts_account_130557025.rs index 377ad87ec..bd05af7fb 100644 --- a/examples/v2_gcp-integration_create_gcpsts_account_130557025.rs +++ b/examples/v2_gcp-integration_create_gcpsts_account_130557025.rs @@ -1,7 +1,7 @@ // Create a new entry for your service account with resource collection enabled // returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_gcp_integration::GCPIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_gcp_integration::GCPIntegrationAPI; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountAttributes; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountCreateRequest; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountData; @@ -21,7 +21,7 @@ async fn main() { ) .type_(GCPServiceAccountType::GCP_SERVICE_ACCOUNT), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = GCPIntegrationAPI::with_config(configuration); let resp = api.create_gcpsts_account(body).await; if let Ok(value) = resp { diff --git a/examples/v2_gcp-integration_create_gcpsts_account_194782945.rs b/examples/v2_gcp-integration_create_gcpsts_account_194782945.rs index 9a9107a8a..6767c7890 100644 --- a/examples/v2_gcp-integration_create_gcpsts_account_194782945.rs +++ b/examples/v2_gcp-integration_create_gcpsts_account_194782945.rs @@ -1,7 +1,7 @@ // Create a new entry for your service account with cloud run revision filters // enabled returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_gcp_integration::GCPIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_gcp_integration::GCPIntegrationAPI; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountAttributes; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountCreateRequest; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountData; @@ -21,7 +21,7 @@ async fn main() { ) .type_(GCPServiceAccountType::GCP_SERVICE_ACCOUNT), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = GCPIntegrationAPI::with_config(configuration); let resp = api.create_gcpsts_account(body).await; if let Ok(value) = resp { diff --git a/examples/v2_gcp-integration_create_gcpsts_account_2597004741.rs b/examples/v2_gcp-integration_create_gcpsts_account_2597004741.rs index f23bdf042..4b6566877 100644 --- a/examples/v2_gcp-integration_create_gcpsts_account_2597004741.rs +++ b/examples/v2_gcp-integration_create_gcpsts_account_2597004741.rs @@ -1,7 +1,7 @@ // Create a new entry for your service account with security command center // enabled returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_gcp_integration::GCPIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_gcp_integration::GCPIntegrationAPI; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountAttributes; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountCreateRequest; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountData; @@ -21,7 +21,7 @@ async fn main() { ) .type_(GCPServiceAccountType::GCP_SERVICE_ACCOUNT), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = GCPIntegrationAPI::with_config(configuration); let resp = api.create_gcpsts_account(body).await; if let Ok(value) = resp { diff --git a/examples/v2_gcp-integration_create_gcpsts_account_4235664992.rs b/examples/v2_gcp-integration_create_gcpsts_account_4235664992.rs index 094a59912..326d3ee2b 100644 --- a/examples/v2_gcp-integration_create_gcpsts_account_4235664992.rs +++ b/examples/v2_gcp-integration_create_gcpsts_account_4235664992.rs @@ -1,7 +1,7 @@ // Create a new entry for your service account with cspm enabled returns "OK" // response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_gcp_integration::GCPIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_gcp_integration::GCPIntegrationAPI; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountAttributes; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountCreateRequest; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountData; @@ -22,7 +22,7 @@ async fn main() { ) .type_(GCPServiceAccountType::GCP_SERVICE_ACCOUNT), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = GCPIntegrationAPI::with_config(configuration); let resp = api.create_gcpsts_account(body).await; if let Ok(value) = resp { diff --git a/examples/v2_gcp-integration_delete_gcpsts_account.rs b/examples/v2_gcp-integration_delete_gcpsts_account.rs index 27583c03b..1cdca7d38 100644 --- a/examples/v2_gcp-integration_delete_gcpsts_account.rs +++ b/examples/v2_gcp-integration_delete_gcpsts_account.rs @@ -1,10 +1,10 @@ // Delete an STS enabled GCP Account returns "No Content" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_gcp_integration::GCPIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_gcp_integration::GCPIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = GCPIntegrationAPI::with_config(configuration); let resp = api.delete_gcpsts_account("account_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v2_gcp-integration_get_gcpsts_delegate.rs b/examples/v2_gcp-integration_get_gcpsts_delegate.rs index 689f773db..0ff67baba 100644 --- a/examples/v2_gcp-integration_get_gcpsts_delegate.rs +++ b/examples/v2_gcp-integration_get_gcpsts_delegate.rs @@ -1,10 +1,10 @@ // List delegate account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_gcp_integration::GCPIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_gcp_integration::GCPIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = GCPIntegrationAPI::with_config(configuration); let resp = api.get_gcpsts_delegate().await; if let Ok(value) = resp { diff --git a/examples/v2_gcp-integration_list_gcpsts_accounts.rs b/examples/v2_gcp-integration_list_gcpsts_accounts.rs index 64b4560fb..19755a441 100644 --- a/examples/v2_gcp-integration_list_gcpsts_accounts.rs +++ b/examples/v2_gcp-integration_list_gcpsts_accounts.rs @@ -1,10 +1,10 @@ // List all GCP STS-enabled service accounts returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_gcp_integration::GCPIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_gcp_integration::GCPIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = GCPIntegrationAPI::with_config(configuration); let resp = api.list_gcpsts_accounts().await; if let Ok(value) = resp { diff --git a/examples/v2_gcp-integration_make_gcpsts_delegate.rs b/examples/v2_gcp-integration_make_gcpsts_delegate.rs index 045d10b04..dfa101614 100644 --- a/examples/v2_gcp-integration_make_gcpsts_delegate.rs +++ b/examples/v2_gcp-integration_make_gcpsts_delegate.rs @@ -1,11 +1,11 @@ // Create a Datadog GCP principal returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_gcp_integration::GCPIntegrationAPI; -use datadog_api_client::datadogV2::api::api_gcp_integration::MakeGCPSTSDelegateOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_gcp_integration::GCPIntegrationAPI; +use datadog_api_client::datadogV2::api_gcp_integration::MakeGCPSTSDelegateOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = GCPIntegrationAPI::with_config(configuration); let resp = api .make_gcpsts_delegate(MakeGCPSTSDelegateOptionalParams::default()) diff --git a/examples/v2_gcp-integration_make_gcpsts_delegate_962598975.rs b/examples/v2_gcp-integration_make_gcpsts_delegate_962598975.rs index 4c41d054f..ddf32e438 100644 --- a/examples/v2_gcp-integration_make_gcpsts_delegate_962598975.rs +++ b/examples/v2_gcp-integration_make_gcpsts_delegate_962598975.rs @@ -1,13 +1,13 @@ // Create a Datadog GCP principal with empty body returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_gcp_integration::GCPIntegrationAPI; -use datadog_api_client::datadogV2::api::api_gcp_integration::MakeGCPSTSDelegateOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_gcp_integration::GCPIntegrationAPI; +use datadog_api_client::datadogV2::api_gcp_integration::MakeGCPSTSDelegateOptionalParams; use std::collections::BTreeMap; #[tokio::main] async fn main() { let body = BTreeMap::new(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = GCPIntegrationAPI::with_config(configuration); let resp = api .make_gcpsts_delegate(MakeGCPSTSDelegateOptionalParams::default().body(body)) diff --git a/examples/v2_gcp-integration_update_gcpsts_account.rs b/examples/v2_gcp-integration_update_gcpsts_account.rs index de4eeb635..f46a2cd22 100644 --- a/examples/v2_gcp-integration_update_gcpsts_account.rs +++ b/examples/v2_gcp-integration_update_gcpsts_account.rs @@ -1,6 +1,6 @@ // Update STS Service Account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_gcp_integration::GCPIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_gcp_integration::GCPIntegrationAPI; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountAttributes; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountUpdateRequest; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountUpdateRequestData; @@ -20,7 +20,7 @@ async fn main() { .id(gcp_sts_account_data_id.clone()) .type_(GCPServiceAccountType::GCP_SERVICE_ACCOUNT), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = GCPIntegrationAPI::with_config(configuration); let resp = api .update_gcpsts_account(gcp_sts_account_data_id.clone(), body) diff --git a/examples/v2_gcp-integration_update_gcpsts_account_2241994060.rs b/examples/v2_gcp-integration_update_gcpsts_account_2241994060.rs index d72669a51..220b45eec 100644 --- a/examples/v2_gcp-integration_update_gcpsts_account_2241994060.rs +++ b/examples/v2_gcp-integration_update_gcpsts_account_2241994060.rs @@ -1,6 +1,6 @@ // Update STS Service Account returns "OK" response with cloud run revision filters -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_gcp_integration::GCPIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_gcp_integration::GCPIntegrationAPI; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountAttributes; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountUpdateRequest; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountUpdateRequestData; @@ -20,7 +20,7 @@ async fn main() { .id(gcp_sts_account_data_id.clone()) .type_(GCPServiceAccountType::GCP_SERVICE_ACCOUNT), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = GCPIntegrationAPI::with_config(configuration); let resp = api .update_gcpsts_account(gcp_sts_account_data_id.clone(), body) diff --git a/examples/v2_gcp-integration_update_gcpsts_account_3205636354.rs b/examples/v2_gcp-integration_update_gcpsts_account_3205636354.rs index 2b783c7e6..0139c644d 100644 --- a/examples/v2_gcp-integration_update_gcpsts_account_3205636354.rs +++ b/examples/v2_gcp-integration_update_gcpsts_account_3205636354.rs @@ -1,7 +1,7 @@ // Update STS Service Account returns "OK" response with enable resource // collection turned on -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_gcp_integration::GCPIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_gcp_integration::GCPIntegrationAPI; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountAttributes; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountUpdateRequest; use datadog_api_client::datadogV2::model::GCPSTSServiceAccountUpdateRequestData; @@ -21,7 +21,7 @@ async fn main() { .id(gcp_sts_account_data_id.clone()) .type_(GCPServiceAccountType::GCP_SERVICE_ACCOUNT), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = GCPIntegrationAPI::with_config(configuration); let resp = api .update_gcpsts_account(gcp_sts_account_data_id.clone(), body) diff --git a/examples/v2_incident-services_create_incident_service.rs b/examples/v2_incident-services_create_incident_service.rs index 1fab4409e..64ae8abce 100644 --- a/examples/v2_incident-services_create_incident_service.rs +++ b/examples/v2_incident-services_create_incident_service.rs @@ -1,6 +1,6 @@ // Create a new incident service returns "CREATED" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incident_services::IncidentServicesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incident_services::IncidentServicesAPI; use datadog_api_client::datadogV2::model::IncidentServiceCreateAttributes; use datadog_api_client::datadogV2::model::IncidentServiceCreateData; use datadog_api_client::datadogV2::model::IncidentServiceCreateRequest; @@ -13,7 +13,7 @@ async fn main() { IncidentServiceCreateAttributes::new("Example-Incident-Service".to_string()), ), ); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.CreateIncidentService", true); let api = IncidentServicesAPI::with_config(configuration); let resp = api.create_incident_service(body).await; diff --git a/examples/v2_incident-services_delete_incident_service.rs b/examples/v2_incident-services_delete_incident_service.rs index 0296fcf6c..696721e30 100644 --- a/examples/v2_incident-services_delete_incident_service.rs +++ b/examples/v2_incident-services_delete_incident_service.rs @@ -1,12 +1,12 @@ // Delete an existing incident service returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incident_services::IncidentServicesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incident_services::IncidentServicesAPI; #[tokio::main] async fn main() { // there is a valid "service" in the system let service_data_id = std::env::var("SERVICE_DATA_ID").unwrap(); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.DeleteIncidentService", true); let api = IncidentServicesAPI::with_config(configuration); let resp = api.delete_incident_service(service_data_id.clone()).await; diff --git a/examples/v2_incident-services_get_incident_service.rs b/examples/v2_incident-services_get_incident_service.rs index 27a982713..bc0dfd5bd 100644 --- a/examples/v2_incident-services_get_incident_service.rs +++ b/examples/v2_incident-services_get_incident_service.rs @@ -1,13 +1,13 @@ // Get details of an incident service returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incident_services::GetIncidentServiceOptionalParams; -use datadog_api_client::datadogV2::api::api_incident_services::IncidentServicesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incident_services::GetIncidentServiceOptionalParams; +use datadog_api_client::datadogV2::api_incident_services::IncidentServicesAPI; #[tokio::main] async fn main() { // there is a valid "service" in the system let service_data_id = std::env::var("SERVICE_DATA_ID").unwrap(); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.GetIncidentService", true); let api = IncidentServicesAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incident-services_list_incident_services.rs b/examples/v2_incident-services_list_incident_services.rs index e36bae768..ae99642fa 100644 --- a/examples/v2_incident-services_list_incident_services.rs +++ b/examples/v2_incident-services_list_incident_services.rs @@ -1,13 +1,13 @@ // Get a list of all incident services returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incident_services::IncidentServicesAPI; -use datadog_api_client::datadogV2::api::api_incident_services::ListIncidentServicesOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incident_services::IncidentServicesAPI; +use datadog_api_client::datadogV2::api_incident_services::ListIncidentServicesOptionalParams; #[tokio::main] async fn main() { // there is a valid "service" in the system let service_data_attributes_name = std::env::var("SERVICE_DATA_ATTRIBUTES_NAME").unwrap(); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.ListIncidentServices", true); let api = IncidentServicesAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incident-services_update_incident_service.rs b/examples/v2_incident-services_update_incident_service.rs index eab4f4eb8..196227a63 100644 --- a/examples/v2_incident-services_update_incident_service.rs +++ b/examples/v2_incident-services_update_incident_service.rs @@ -1,6 +1,6 @@ // Update an existing incident service returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incident_services::IncidentServicesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incident_services::IncidentServicesAPI; use datadog_api_client::datadogV2::model::IncidentServiceType; use datadog_api_client::datadogV2::model::IncidentServiceUpdateAttributes; use datadog_api_client::datadogV2::model::IncidentServiceUpdateData; @@ -15,7 +15,7 @@ async fn main() { IncidentServiceUpdateAttributes::new("service name-updated".to_string()), ), ); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.UpdateIncidentService", true); let api = IncidentServicesAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incident-teams_create_incident_team.rs b/examples/v2_incident-teams_create_incident_team.rs index b2d2e8236..9e610dc43 100644 --- a/examples/v2_incident-teams_create_incident_team.rs +++ b/examples/v2_incident-teams_create_incident_team.rs @@ -1,6 +1,6 @@ // Create a new incident team returns "CREATED" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incident_teams::IncidentTeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incident_teams::IncidentTeamsAPI; use datadog_api_client::datadogV2::model::IncidentTeamCreateAttributes; use datadog_api_client::datadogV2::model::IncidentTeamCreateData; use datadog_api_client::datadogV2::model::IncidentTeamCreateRequest; @@ -13,7 +13,7 @@ async fn main() { IncidentTeamCreateAttributes::new("Example-Incident-Team".to_string()), ), ); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.CreateIncidentTeam", true); let api = IncidentTeamsAPI::with_config(configuration); let resp = api.create_incident_team(body).await; diff --git a/examples/v2_incident-teams_delete_incident_team.rs b/examples/v2_incident-teams_delete_incident_team.rs index 6a45aefec..2bf61b508 100644 --- a/examples/v2_incident-teams_delete_incident_team.rs +++ b/examples/v2_incident-teams_delete_incident_team.rs @@ -1,12 +1,12 @@ // Delete an existing incident team returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incident_teams::IncidentTeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incident_teams::IncidentTeamsAPI; #[tokio::main] async fn main() { // there is a valid "team" in the system let team_data_id = std::env::var("TEAM_DATA_ID").unwrap(); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.DeleteIncidentTeam", true); let api = IncidentTeamsAPI::with_config(configuration); let resp = api.delete_incident_team(team_data_id.clone()).await; diff --git a/examples/v2_incident-teams_get_incident_team.rs b/examples/v2_incident-teams_get_incident_team.rs index a2c0e66e0..32117517c 100644 --- a/examples/v2_incident-teams_get_incident_team.rs +++ b/examples/v2_incident-teams_get_incident_team.rs @@ -1,13 +1,13 @@ // Get details of an incident team returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incident_teams::GetIncidentTeamOptionalParams; -use datadog_api_client::datadogV2::api::api_incident_teams::IncidentTeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incident_teams::GetIncidentTeamOptionalParams; +use datadog_api_client::datadogV2::api_incident_teams::IncidentTeamsAPI; #[tokio::main] async fn main() { // there is a valid "team" in the system let team_data_id = std::env::var("TEAM_DATA_ID").unwrap(); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.GetIncidentTeam", true); let api = IncidentTeamsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incident-teams_list_incident_teams.rs b/examples/v2_incident-teams_list_incident_teams.rs index 1612e835e..76614029d 100644 --- a/examples/v2_incident-teams_list_incident_teams.rs +++ b/examples/v2_incident-teams_list_incident_teams.rs @@ -1,13 +1,13 @@ // Get a list of all incident teams returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incident_teams::IncidentTeamsAPI; -use datadog_api_client::datadogV2::api::api_incident_teams::ListIncidentTeamsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incident_teams::IncidentTeamsAPI; +use datadog_api_client::datadogV2::api_incident_teams::ListIncidentTeamsOptionalParams; #[tokio::main] async fn main() { // there is a valid "team" in the system let team_data_attributes_name = std::env::var("TEAM_DATA_ATTRIBUTES_NAME").unwrap(); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.ListIncidentTeams", true); let api = IncidentTeamsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incident-teams_update_incident_team.rs b/examples/v2_incident-teams_update_incident_team.rs index 9fa4332f0..78befccd4 100644 --- a/examples/v2_incident-teams_update_incident_team.rs +++ b/examples/v2_incident-teams_update_incident_team.rs @@ -1,6 +1,6 @@ // Update an existing incident team returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incident_teams::IncidentTeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incident_teams::IncidentTeamsAPI; use datadog_api_client::datadogV2::model::IncidentTeamType; use datadog_api_client::datadogV2::model::IncidentTeamUpdateAttributes; use datadog_api_client::datadogV2::model::IncidentTeamUpdateData; @@ -15,7 +15,7 @@ async fn main() { IncidentTeamUpdateAttributes::new("team name-updated".to_string()), ), ); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.UpdateIncidentTeam", true); let api = IncidentTeamsAPI::with_config(configuration); let resp = api.update_incident_team(team_data_id.clone(), body).await; diff --git a/examples/v2_incidents_create_incident.rs b/examples/v2_incidents_create_incident.rs index f52ea36b2..2e87e1457 100644 --- a/examples/v2_incidents_create_incident.rs +++ b/examples/v2_incidents_create_incident.rs @@ -1,6 +1,6 @@ // Create an incident returns "CREATED" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; use datadog_api_client::datadogV2::model::IncidentCreateAttributes; use datadog_api_client::datadogV2::model::IncidentCreateData; use datadog_api_client::datadogV2::model::IncidentCreateRelationships; @@ -39,7 +39,7 @@ async fn main() { ))), ))), ); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.CreateIncident", true); let api = IncidentsAPI::with_config(configuration); let resp = api.create_incident(body).await; diff --git a/examples/v2_incidents_create_incident_integration.rs b/examples/v2_incidents_create_incident_integration.rs index 566ab7143..af118be3a 100644 --- a/examples/v2_incidents_create_incident_integration.rs +++ b/examples/v2_incidents_create_incident_integration.rs @@ -1,6 +1,6 @@ // Create an incident integration metadata returns "CREATED" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataAttributes; use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataCreateData; use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataCreateRequest; @@ -30,7 +30,7 @@ async fn main() { .incident_id(incident_data_id.clone()), IncidentIntegrationMetadataType::INCIDENT_INTEGRATIONS, )); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.CreateIncidentIntegration", true); let api = IncidentsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incidents_create_incident_todo.rs b/examples/v2_incidents_create_incident_todo.rs index f2ada014e..bfbf0e951 100644 --- a/examples/v2_incidents_create_incident_todo.rs +++ b/examples/v2_incidents_create_incident_todo.rs @@ -1,6 +1,6 @@ // Create an incident todo returns "CREATED" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; use datadog_api_client::datadogV2::model::IncidentTodoAssignee; use datadog_api_client::datadogV2::model::IncidentTodoAttributes; use datadog_api_client::datadogV2::model::IncidentTodoCreateData; @@ -20,7 +20,7 @@ async fn main() { ), IncidentTodoType::INCIDENT_TODOS, )); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.CreateIncidentTodo", true); let api = IncidentsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incidents_delete_incident.rs b/examples/v2_incidents_delete_incident.rs index 7f3ab9223..1052d0e8d 100644 --- a/examples/v2_incidents_delete_incident.rs +++ b/examples/v2_incidents_delete_incident.rs @@ -1,12 +1,12 @@ // Delete an existing incident returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; #[tokio::main] async fn main() { // there is a valid "incident" in the system let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap(); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.DeleteIncident", true); let api = IncidentsAPI::with_config(configuration); let resp = api.delete_incident(incident_data_id.clone()).await; diff --git a/examples/v2_incidents_delete_incident_integration.rs b/examples/v2_incidents_delete_incident_integration.rs index 0f976cb3a..092eacdbb 100644 --- a/examples/v2_incidents_delete_incident_integration.rs +++ b/examples/v2_incidents_delete_incident_integration.rs @@ -1,6 +1,6 @@ // Delete an incident integration metadata returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; #[tokio::main] async fn main() { @@ -10,7 +10,7 @@ async fn main() { // the "incident" has an "incident_integration_metadata" let incident_integration_metadata_data_id = std::env::var("INCIDENT_INTEGRATION_METADATA_DATA_ID").unwrap(); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.DeleteIncidentIntegration", true); let api = IncidentsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incidents_delete_incident_todo.rs b/examples/v2_incidents_delete_incident_todo.rs index 6b7282adc..eb74fb9bc 100644 --- a/examples/v2_incidents_delete_incident_todo.rs +++ b/examples/v2_incidents_delete_incident_todo.rs @@ -1,6 +1,6 @@ // Delete an incident todo returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; #[tokio::main] async fn main() { @@ -9,7 +9,7 @@ async fn main() { // the "incident" has an "incident_todo" let incident_todo_data_id = std::env::var("INCIDENT_TODO_DATA_ID").unwrap(); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.DeleteIncidentTodo", true); let api = IncidentsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incidents_get_incident.rs b/examples/v2_incidents_get_incident.rs index ed6d00892..7884276ff 100644 --- a/examples/v2_incidents_get_incident.rs +++ b/examples/v2_incidents_get_incident.rs @@ -1,13 +1,13 @@ // Get the details of an incident returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::GetIncidentOptionalParams; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::GetIncidentOptionalParams; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; #[tokio::main] async fn main() { // there is a valid "incident" in the system let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap(); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.GetIncident", true); let api = IncidentsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incidents_get_incident_integration.rs b/examples/v2_incidents_get_incident_integration.rs index c060670b6..5ffde972d 100644 --- a/examples/v2_incidents_get_incident_integration.rs +++ b/examples/v2_incidents_get_incident_integration.rs @@ -1,6 +1,6 @@ // Get incident integration metadata details returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; #[tokio::main] async fn main() { @@ -10,7 +10,7 @@ async fn main() { // the "incident" has an "incident_integration_metadata" let incident_integration_metadata_data_id = std::env::var("INCIDENT_INTEGRATION_METADATA_DATA_ID").unwrap(); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.GetIncidentIntegration", true); let api = IncidentsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incidents_get_incident_todo.rs b/examples/v2_incidents_get_incident_todo.rs index 1320d1f26..140824943 100644 --- a/examples/v2_incidents_get_incident_todo.rs +++ b/examples/v2_incidents_get_incident_todo.rs @@ -1,6 +1,6 @@ // Get incident todo details returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; #[tokio::main] async fn main() { @@ -9,7 +9,7 @@ async fn main() { // the "incident" has an "incident_todo" let incident_todo_data_id = std::env::var("INCIDENT_TODO_DATA_ID").unwrap(); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.GetIncidentTodo", true); let api = IncidentsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incidents_list_incident_attachments.rs b/examples/v2_incidents_list_incident_attachments.rs index cb471132f..2cedca5f6 100644 --- a/examples/v2_incidents_list_incident_attachments.rs +++ b/examples/v2_incidents_list_incident_attachments.rs @@ -1,11 +1,11 @@ // Get a list of attachments returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; -use datadog_api_client::datadogV2::api::api_incidents::ListIncidentAttachmentsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; +use datadog_api_client::datadogV2::api_incidents::ListIncidentAttachmentsOptionalParams; #[tokio::main] async fn main() { - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.ListIncidentAttachments", true); let api = IncidentsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incidents_list_incident_attachments_2457735435.rs b/examples/v2_incidents_list_incident_attachments_2457735435.rs index 0aa563bae..8ced7b70c 100644 --- a/examples/v2_incidents_list_incident_attachments_2457735435.rs +++ b/examples/v2_incidents_list_incident_attachments_2457735435.rs @@ -1,13 +1,13 @@ // Get incident attachments returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; -use datadog_api_client::datadogV2::api::api_incidents::ListIncidentAttachmentsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; +use datadog_api_client::datadogV2::api_incidents::ListIncidentAttachmentsOptionalParams; #[tokio::main] async fn main() { // there is a valid "incident" in the system let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap(); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.ListIncidentAttachments", true); let api = IncidentsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incidents_list_incident_integrations.rs b/examples/v2_incidents_list_incident_integrations.rs index 64c837cd3..29a561fd2 100644 --- a/examples/v2_incidents_list_incident_integrations.rs +++ b/examples/v2_incidents_list_incident_integrations.rs @@ -1,12 +1,12 @@ // Get a list of an incident's integration metadata returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; #[tokio::main] async fn main() { // there is a valid "incident" in the system let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap(); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.ListIncidentIntegrations", true); let api = IncidentsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incidents_list_incident_todos.rs b/examples/v2_incidents_list_incident_todos.rs index 642ab20c2..4a94c5526 100644 --- a/examples/v2_incidents_list_incident_todos.rs +++ b/examples/v2_incidents_list_incident_todos.rs @@ -1,12 +1,12 @@ // Get a list of an incident's todos returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; #[tokio::main] async fn main() { // there is a valid "incident" in the system let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap(); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.ListIncidentTodos", true); let api = IncidentsAPI::with_config(configuration); let resp = api.list_incident_todos(incident_data_id.clone()).await; diff --git a/examples/v2_incidents_list_incidents.rs b/examples/v2_incidents_list_incidents.rs index 13395a077..168a309f1 100644 --- a/examples/v2_incidents_list_incidents.rs +++ b/examples/v2_incidents_list_incidents.rs @@ -1,11 +1,11 @@ // Get a list of incidents returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; -use datadog_api_client::datadogV2::api::api_incidents::ListIncidentsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; +use datadog_api_client::datadogV2::api_incidents::ListIncidentsOptionalParams; #[tokio::main] async fn main() { - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.ListIncidents", true); let api = IncidentsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incidents_list_incidents_2665616954.rs b/examples/v2_incidents_list_incidents_2665616954.rs index 9cf033060..99be0451c 100644 --- a/examples/v2_incidents_list_incidents_2665616954.rs +++ b/examples/v2_incidents_list_incidents_2665616954.rs @@ -1,13 +1,13 @@ // Get a list of incidents returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; -use datadog_api_client::datadogV2::api::api_incidents::ListIncidentsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; +use datadog_api_client::datadogV2::api_incidents::ListIncidentsOptionalParams; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.ListIncidents", true); let api = IncidentsAPI::with_config(configuration); let response = diff --git a/examples/v2_incidents_search_incidents.rs b/examples/v2_incidents_search_incidents.rs index e0f345cbf..490af4a52 100644 --- a/examples/v2_incidents_search_incidents.rs +++ b/examples/v2_incidents_search_incidents.rs @@ -1,11 +1,11 @@ // Search for incidents returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; -use datadog_api_client::datadogV2::api::api_incidents::SearchIncidentsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; +use datadog_api_client::datadogV2::api_incidents::SearchIncidentsOptionalParams; #[tokio::main] async fn main() { - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.SearchIncidents", true); let api = IncidentsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incidents_search_incidents_1931679109.rs b/examples/v2_incidents_search_incidents_1931679109.rs index 0d83c051e..f618c4425 100644 --- a/examples/v2_incidents_search_incidents_1931679109.rs +++ b/examples/v2_incidents_search_incidents_1931679109.rs @@ -1,13 +1,13 @@ // Search for incidents returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; -use datadog_api_client::datadogV2::api::api_incidents::SearchIncidentsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; +use datadog_api_client::datadogV2::api_incidents::SearchIncidentsOptionalParams; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.SearchIncidents", true); let api = IncidentsAPI::with_config(configuration); let response = api.search_incidents_with_pagination( diff --git a/examples/v2_incidents_update_incident.rs b/examples/v2_incidents_update_incident.rs index b239e7dee..ddc08b210 100644 --- a/examples/v2_incidents_update_incident.rs +++ b/examples/v2_incidents_update_incident.rs @@ -1,7 +1,7 @@ // Update an existing incident returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; -use datadog_api_client::datadogV2::api::api_incidents::UpdateIncidentOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; +use datadog_api_client::datadogV2::api_incidents::UpdateIncidentOptionalParams; use datadog_api_client::datadogV2::model::IncidentFieldAttributes; use datadog_api_client::datadogV2::model::IncidentFieldAttributesSingleValue; use datadog_api_client::datadogV2::model::IncidentFieldAttributesSingleValueType; @@ -29,7 +29,7 @@ async fn main() { .title("A test incident title-updated".to_string()), ), ); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.UpdateIncident", true); let api = IncidentsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incidents_update_incident_1009194038.rs b/examples/v2_incidents_update_incident_1009194038.rs index 16cf4d3fa..bfd8b1e23 100644 --- a/examples/v2_incidents_update_incident_1009194038.rs +++ b/examples/v2_incidents_update_incident_1009194038.rs @@ -1,7 +1,7 @@ // Remove commander from an incident returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; -use datadog_api_client::datadogV2::api::api_incidents::UpdateIncidentOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; +use datadog_api_client::datadogV2::api_incidents::UpdateIncidentOptionalParams; use datadog_api_client::datadogV2::model::IncidentType; use datadog_api_client::datadogV2::model::IncidentUpdateData; use datadog_api_client::datadogV2::model::IncidentUpdateRelationships; @@ -18,7 +18,7 @@ async fn main() { .commander_user(Some(NullableRelationshipToUser::new(None))), ), ); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.UpdateIncident", true); let api = IncidentsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incidents_update_incident_3369341440.rs b/examples/v2_incidents_update_incident_3369341440.rs index 94879433f..6ba86348c 100644 --- a/examples/v2_incidents_update_incident_3369341440.rs +++ b/examples/v2_incidents_update_incident_3369341440.rs @@ -1,7 +1,7 @@ // Add commander to an incident returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; -use datadog_api_client::datadogV2::api::api_incidents::UpdateIncidentOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; +use datadog_api_client::datadogV2::api_incidents::UpdateIncidentOptionalParams; use datadog_api_client::datadogV2::model::IncidentType; use datadog_api_client::datadogV2::model::IncidentUpdateData; use datadog_api_client::datadogV2::model::IncidentUpdateRelationships; @@ -27,7 +27,7 @@ async fn main() { )), ), ); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.UpdateIncident", true); let api = IncidentsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incidents_update_incident_attachments.rs b/examples/v2_incidents_update_incident_attachments.rs index 0ff5aa324..f4577da9c 100644 --- a/examples/v2_incidents_update_incident_attachments.rs +++ b/examples/v2_incidents_update_incident_attachments.rs @@ -1,7 +1,7 @@ // Create, update, and delete incident attachments returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; -use datadog_api_client::datadogV2::api::api_incidents::UpdateIncidentAttachmentsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; +use datadog_api_client::datadogV2::api_incidents::UpdateIncidentAttachmentsOptionalParams; use datadog_api_client::datadogV2::model::IncidentAttachmentLinkAttachmentType; use datadog_api_client::datadogV2::model::IncidentAttachmentLinkAttributes; use datadog_api_client::datadogV2::model::IncidentAttachmentLinkAttributesAttachmentObject; @@ -43,7 +43,7 @@ async fn main() { IncidentAttachmentUpdateData::new(IncidentAttachmentType::INCIDENT_ATTACHMENTS) .id("00000000-abcd-0003-0000-000000000000".to_string()), ]); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.UpdateIncidentAttachments", true); let api = IncidentsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incidents_update_incident_attachments_3881702075.rs b/examples/v2_incidents_update_incident_attachments_3881702075.rs index 2930cf4b1..7c15570b9 100644 --- a/examples/v2_incidents_update_incident_attachments_3881702075.rs +++ b/examples/v2_incidents_update_incident_attachments_3881702075.rs @@ -1,7 +1,7 @@ // Create an incident attachment returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; -use datadog_api_client::datadogV2::api::api_incidents::UpdateIncidentAttachmentsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; +use datadog_api_client::datadogV2::api_incidents::UpdateIncidentAttachmentsOptionalParams; use datadog_api_client::datadogV2::model::IncidentAttachmentLinkAttachmentType; use datadog_api_client::datadogV2::model::IncidentAttachmentLinkAttributes; use datadog_api_client::datadogV2::model::IncidentAttachmentLinkAttributesAttachmentObject; @@ -28,7 +28,7 @@ async fn main() { ), )), )]); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.UpdateIncidentAttachments", true); let api = IncidentsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incidents_update_incident_integration.rs b/examples/v2_incidents_update_incident_integration.rs index b91cd0f72..4a0097ec6 100644 --- a/examples/v2_incidents_update_incident_integration.rs +++ b/examples/v2_incidents_update_incident_integration.rs @@ -1,6 +1,6 @@ // Update an existing incident integration metadata returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataAttributes; use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataMetadata; use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataPatchData; @@ -34,7 +34,7 @@ async fn main() { .incident_id(incident_data_id.clone()), IncidentIntegrationMetadataType::INCIDENT_INTEGRATIONS, )); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.UpdateIncidentIntegration", true); let api = IncidentsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_incidents_update_incident_todo.rs b/examples/v2_incidents_update_incident_todo.rs index a6dd02ece..1dfbb0dad 100644 --- a/examples/v2_incidents_update_incident_todo.rs +++ b/examples/v2_incidents_update_incident_todo.rs @@ -1,6 +1,6 @@ // Update an incident todo returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_incidents::IncidentsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_incidents::IncidentsAPI; use datadog_api_client::datadogV2::model::IncidentTodoAssignee; use datadog_api_client::datadogV2::model::IncidentTodoAttributes; use datadog_api_client::datadogV2::model::IncidentTodoPatchData; @@ -25,7 +25,7 @@ async fn main() { .due_date(Some("2023-07-10T05:00:00.000000+00:00".to_string())), IncidentTodoType::INCIDENT_TODOS, )); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.UpdateIncidentTodo", true); let api = IncidentsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_ip-allowlist_get_ip_allowlist.rs b/examples/v2_ip-allowlist_get_ip_allowlist.rs index 67160d21f..bcf2f5dee 100644 --- a/examples/v2_ip-allowlist_get_ip_allowlist.rs +++ b/examples/v2_ip-allowlist_get_ip_allowlist.rs @@ -1,10 +1,10 @@ // Get IP Allowlist returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_ip_allowlist::IPAllowlistAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_ip_allowlist::IPAllowlistAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = IPAllowlistAPI::with_config(configuration); let resp = api.get_ip_allowlist().await; if let Ok(value) = resp { diff --git a/examples/v2_ip-allowlist_update_ip_allowlist.rs b/examples/v2_ip-allowlist_update_ip_allowlist.rs index 8c6ffee78..05755927c 100644 --- a/examples/v2_ip-allowlist_update_ip_allowlist.rs +++ b/examples/v2_ip-allowlist_update_ip_allowlist.rs @@ -1,6 +1,6 @@ // Update IP Allowlist returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_ip_allowlist::IPAllowlistAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_ip_allowlist::IPAllowlistAPI; use datadog_api_client::datadogV2::model::IPAllowlistAttributes; use datadog_api_client::datadogV2::model::IPAllowlistData; use datadog_api_client::datadogV2::model::IPAllowlistEntry; @@ -25,7 +25,7 @@ async fn main() { )]), ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = IPAllowlistAPI::with_config(configuration); let resp = api.update_ip_allowlist(body).await; if let Ok(value) = resp { diff --git a/examples/v2_key-management_create_api_key.rs b/examples/v2_key-management_create_api_key.rs index 439f415b2..16759b5ff 100644 --- a/examples/v2_key-management_create_api_key.rs +++ b/examples/v2_key-management_create_api_key.rs @@ -1,6 +1,6 @@ // Create an API key returns "Created" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_key_management::KeyManagementAPI; use datadog_api_client::datadogV2::model::APIKeyCreateAttributes; use datadog_api_client::datadogV2::model::APIKeyCreateData; use datadog_api_client::datadogV2::model::APIKeyCreateRequest; @@ -12,7 +12,7 @@ async fn main() { APIKeyCreateAttributes::new("Example-Key-Management".to_string()), APIKeysType::API_KEYS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api.create_api_key(body).await; if let Ok(value) = resp { diff --git a/examples/v2_key-management_create_current_user_application_key.rs b/examples/v2_key-management_create_current_user_application_key.rs index 33d09555d..dbcd7ab27 100644 --- a/examples/v2_key-management_create_current_user_application_key.rs +++ b/examples/v2_key-management_create_current_user_application_key.rs @@ -1,6 +1,6 @@ // Create an application key for current user returns "Created" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_key_management::KeyManagementAPI; use datadog_api_client::datadogV2::model::ApplicationKeyCreateAttributes; use datadog_api_client::datadogV2::model::ApplicationKeyCreateData; use datadog_api_client::datadogV2::model::ApplicationKeyCreateRequest; @@ -12,7 +12,7 @@ async fn main() { ApplicationKeyCreateAttributes::new("Example-Key-Management".to_string()), ApplicationKeysType::APPLICATION_KEYS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api.create_current_user_application_key(body).await; if let Ok(value) = resp { diff --git a/examples/v2_key-management_create_current_user_application_key_3383369233.rs b/examples/v2_key-management_create_current_user_application_key_3383369233.rs index 7d6add666..915b9a2a6 100644 --- a/examples/v2_key-management_create_current_user_application_key_3383369233.rs +++ b/examples/v2_key-management_create_current_user_application_key_3383369233.rs @@ -1,7 +1,7 @@ // Create an Application key with scopes for current user returns "Created" // response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_key_management::KeyManagementAPI; use datadog_api_client::datadogV2::model::ApplicationKeyCreateAttributes; use datadog_api_client::datadogV2::model::ApplicationKeyCreateData; use datadog_api_client::datadogV2::model::ApplicationKeyCreateRequest; @@ -19,7 +19,7 @@ async fn main() { )), ApplicationKeysType::APPLICATION_KEYS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api.create_current_user_application_key(body).await; if let Ok(value) = resp { diff --git a/examples/v2_key-management_delete_api_key.rs b/examples/v2_key-management_delete_api_key.rs index 3a7d559f3..3dc8fd0cd 100644 --- a/examples/v2_key-management_delete_api_key.rs +++ b/examples/v2_key-management_delete_api_key.rs @@ -1,12 +1,12 @@ // Delete an API key returns "No Content" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_key_management::KeyManagementAPI; #[tokio::main] async fn main() { // there is a valid "api_key" in the system let api_key_data_id = std::env::var("API_KEY_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api.delete_api_key(api_key_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_key-management_delete_application_key.rs b/examples/v2_key-management_delete_application_key.rs index cd9ef04d3..48b72b124 100644 --- a/examples/v2_key-management_delete_application_key.rs +++ b/examples/v2_key-management_delete_application_key.rs @@ -1,12 +1,12 @@ // Delete an application key returns "No Content" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_key_management::KeyManagementAPI; #[tokio::main] async fn main() { // there is a valid "application_key" in the system let application_key_data_id = std::env::var("APPLICATION_KEY_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api .delete_application_key(application_key_data_id.clone()) diff --git a/examples/v2_key-management_delete_current_user_application_key.rs b/examples/v2_key-management_delete_current_user_application_key.rs index 88dfc842e..96ff1fa3c 100644 --- a/examples/v2_key-management_delete_current_user_application_key.rs +++ b/examples/v2_key-management_delete_current_user_application_key.rs @@ -1,12 +1,12 @@ // Delete an application key owned by current user returns "No Content" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_key_management::KeyManagementAPI; #[tokio::main] async fn main() { // there is a valid "application_key" in the system let application_key_data_id = std::env::var("APPLICATION_KEY_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api .delete_current_user_application_key(application_key_data_id.clone()) diff --git a/examples/v2_key-management_get_api_key.rs b/examples/v2_key-management_get_api_key.rs index 10aa8ab78..56a4b4e43 100644 --- a/examples/v2_key-management_get_api_key.rs +++ b/examples/v2_key-management_get_api_key.rs @@ -1,13 +1,13 @@ // Get API key returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_key_management::GetAPIKeyOptionalParams; -use datadog_api_client::datadogV2::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_key_management::GetAPIKeyOptionalParams; +use datadog_api_client::datadogV2::api_key_management::KeyManagementAPI; #[tokio::main] async fn main() { // there is a valid "api_key" in the system let api_key_data_id = std::env::var("API_KEY_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api .get_api_key(api_key_data_id.clone(), GetAPIKeyOptionalParams::default()) diff --git a/examples/v2_key-management_get_application_key.rs b/examples/v2_key-management_get_application_key.rs index 932ec5192..b9bf1a8fd 100644 --- a/examples/v2_key-management_get_application_key.rs +++ b/examples/v2_key-management_get_application_key.rs @@ -1,13 +1,13 @@ // Get an application key returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_key_management::GetApplicationKeyOptionalParams; -use datadog_api_client::datadogV2::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_key_management::GetApplicationKeyOptionalParams; +use datadog_api_client::datadogV2::api_key_management::KeyManagementAPI; #[tokio::main] async fn main() { // there is a valid "application_key" in the system let application_key_data_id = std::env::var("APPLICATION_KEY_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api .get_application_key( diff --git a/examples/v2_key-management_get_current_user_application_key.rs b/examples/v2_key-management_get_current_user_application_key.rs index 2883cdfaa..16385cd89 100644 --- a/examples/v2_key-management_get_current_user_application_key.rs +++ b/examples/v2_key-management_get_current_user_application_key.rs @@ -1,10 +1,10 @@ // Get one application key owned by current user returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_key_management::KeyManagementAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api .get_current_user_application_key("app_key_id".to_string()) diff --git a/examples/v2_key-management_list_api_keys.rs b/examples/v2_key-management_list_api_keys.rs index 29aabe261..3e4729567 100644 --- a/examples/v2_key-management_list_api_keys.rs +++ b/examples/v2_key-management_list_api_keys.rs @@ -1,13 +1,13 @@ // Get all API keys returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_key_management::KeyManagementAPI; -use datadog_api_client::datadogV2::api::api_key_management::ListAPIKeysOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_key_management::KeyManagementAPI; +use datadog_api_client::datadogV2::api_key_management::ListAPIKeysOptionalParams; #[tokio::main] async fn main() { // there is a valid "api_key" in the system let api_key_data_attributes_name = std::env::var("API_KEY_DATA_ATTRIBUTES_NAME").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api .list_api_keys( diff --git a/examples/v2_key-management_list_application_keys.rs b/examples/v2_key-management_list_application_keys.rs index 532193b2f..863e63dfe 100644 --- a/examples/v2_key-management_list_application_keys.rs +++ b/examples/v2_key-management_list_application_keys.rs @@ -1,11 +1,11 @@ // Get all application keys returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_key_management::KeyManagementAPI; -use datadog_api_client::datadogV2::api::api_key_management::ListApplicationKeysOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_key_management::KeyManagementAPI; +use datadog_api_client::datadogV2::api_key_management::ListApplicationKeysOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api .list_application_keys(ListApplicationKeysOptionalParams::default()) diff --git a/examples/v2_key-management_list_current_user_application_keys.rs b/examples/v2_key-management_list_current_user_application_keys.rs index 23f37cba6..de5fbd23b 100644 --- a/examples/v2_key-management_list_current_user_application_keys.rs +++ b/examples/v2_key-management_list_current_user_application_keys.rs @@ -1,11 +1,11 @@ // Get all application keys owned by current user returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_key_management::KeyManagementAPI; -use datadog_api_client::datadogV2::api::api_key_management::ListCurrentUserApplicationKeysOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_key_management::KeyManagementAPI; +use datadog_api_client::datadogV2::api_key_management::ListCurrentUserApplicationKeysOptionalParams; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api .list_current_user_application_keys(ListCurrentUserApplicationKeysOptionalParams::default()) diff --git a/examples/v2_key-management_update_api_key.rs b/examples/v2_key-management_update_api_key.rs index 8e020a247..047b93cc2 100644 --- a/examples/v2_key-management_update_api_key.rs +++ b/examples/v2_key-management_update_api_key.rs @@ -1,6 +1,6 @@ // Edit an API key returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_key_management::KeyManagementAPI; use datadog_api_client::datadogV2::model::APIKeyUpdateAttributes; use datadog_api_client::datadogV2::model::APIKeyUpdateData; use datadog_api_client::datadogV2::model::APIKeyUpdateRequest; @@ -15,7 +15,7 @@ async fn main() { api_key_data_id.clone(), APIKeysType::API_KEYS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api.update_api_key(api_key_data_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_key-management_update_application_key.rs b/examples/v2_key-management_update_application_key.rs index 3169a7f91..7a81834a5 100644 --- a/examples/v2_key-management_update_application_key.rs +++ b/examples/v2_key-management_update_application_key.rs @@ -1,6 +1,6 @@ // Edit an application key returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_key_management::KeyManagementAPI; use datadog_api_client::datadogV2::model::ApplicationKeyUpdateAttributes; use datadog_api_client::datadogV2::model::ApplicationKeyUpdateData; use datadog_api_client::datadogV2::model::ApplicationKeyUpdateRequest; @@ -16,7 +16,7 @@ async fn main() { application_key_data_id.clone(), ApplicationKeysType::APPLICATION_KEYS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api .update_application_key(application_key_data_id.clone(), body) diff --git a/examples/v2_key-management_update_current_user_application_key.rs b/examples/v2_key-management_update_current_user_application_key.rs index 211da870a..4e0c3e274 100644 --- a/examples/v2_key-management_update_current_user_application_key.rs +++ b/examples/v2_key-management_update_current_user_application_key.rs @@ -1,6 +1,6 @@ // Edit an application key owned by current user returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_key_management::KeyManagementAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_key_management::KeyManagementAPI; use datadog_api_client::datadogV2::model::ApplicationKeyUpdateAttributes; use datadog_api_client::datadogV2::model::ApplicationKeyUpdateData; use datadog_api_client::datadogV2::model::ApplicationKeyUpdateRequest; @@ -16,7 +16,7 @@ async fn main() { application_key_data_id.clone(), ApplicationKeysType::APPLICATION_KEYS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = KeyManagementAPI::with_config(configuration); let resp = api .update_current_user_application_key(application_key_data_id.clone(), body) diff --git a/examples/v2_logs-archives_add_read_role_to_archive.rs b/examples/v2_logs-archives_add_read_role_to_archive.rs index 678353876..0ac5b4a11 100644 --- a/examples/v2_logs-archives_add_read_role_to_archive.rs +++ b/examples/v2_logs-archives_add_read_role_to_archive.rs @@ -1,6 +1,6 @@ // Grant role to an archive returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_archives::LogsArchivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_archives::LogsArchivesAPI; use datadog_api_client::datadogV2::model::RelationshipToRole; use datadog_api_client::datadogV2::model::RelationshipToRoleData; use datadog_api_client::datadogV2::model::RolesType; @@ -12,7 +12,7 @@ async fn main() { .id("3653d3c6-0c75-11ea-ad28-fb5701eabc7d".to_string()) .type_(RolesType::ROLES), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsArchivesAPI::with_config(configuration); let resp = api .add_read_role_to_archive("archive_id".to_string(), body) diff --git a/examples/v2_logs-archives_create_logs_archive.rs b/examples/v2_logs-archives_create_logs_archive.rs index c3642cd0f..05403bffe 100644 --- a/examples/v2_logs-archives_create_logs_archive.rs +++ b/examples/v2_logs-archives_create_logs_archive.rs @@ -1,6 +1,6 @@ // Create an archive returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_archives::LogsArchivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_archives::LogsArchivesAPI; use datadog_api_client::datadogV2::model::LogsArchiveCreateRequest; use datadog_api_client::datadogV2::model::LogsArchiveCreateRequestAttributes; use datadog_api_client::datadogV2::model::LogsArchiveCreateRequestDefinition; @@ -33,7 +33,7 @@ async fn main() { .rehydration_tags(vec!["team:intake".to_string(), "team:app".to_string()]), ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsArchivesAPI::with_config(configuration); let resp = api.create_logs_archive(body).await; if let Ok(value) = resp { diff --git a/examples/v2_logs-archives_delete_logs_archive.rs b/examples/v2_logs-archives_delete_logs_archive.rs index ec7435d91..b05aa1bcc 100644 --- a/examples/v2_logs-archives_delete_logs_archive.rs +++ b/examples/v2_logs-archives_delete_logs_archive.rs @@ -1,10 +1,10 @@ // Delete an archive returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_archives::LogsArchivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_archives::LogsArchivesAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsArchivesAPI::with_config(configuration); let resp = api.delete_logs_archive("archive_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v2_logs-archives_get_logs_archive.rs b/examples/v2_logs-archives_get_logs_archive.rs index 9372fb290..8cdf4c471 100644 --- a/examples/v2_logs-archives_get_logs_archive.rs +++ b/examples/v2_logs-archives_get_logs_archive.rs @@ -1,10 +1,10 @@ // Get an archive returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_archives::LogsArchivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_archives::LogsArchivesAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsArchivesAPI::with_config(configuration); let resp = api.get_logs_archive("archive_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v2_logs-archives_get_logs_archive_order.rs b/examples/v2_logs-archives_get_logs_archive_order.rs index 462d7d051..53fc462c1 100644 --- a/examples/v2_logs-archives_get_logs_archive_order.rs +++ b/examples/v2_logs-archives_get_logs_archive_order.rs @@ -1,10 +1,10 @@ // Get archive order returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_archives::LogsArchivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_archives::LogsArchivesAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsArchivesAPI::with_config(configuration); let resp = api.get_logs_archive_order().await; if let Ok(value) = resp { diff --git a/examples/v2_logs-archives_list_archive_read_roles.rs b/examples/v2_logs-archives_list_archive_read_roles.rs index 98ce711b4..404f00d76 100644 --- a/examples/v2_logs-archives_list_archive_read_roles.rs +++ b/examples/v2_logs-archives_list_archive_read_roles.rs @@ -1,10 +1,10 @@ // List read roles for an archive returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_archives::LogsArchivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_archives::LogsArchivesAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsArchivesAPI::with_config(configuration); let resp = api.list_archive_read_roles("archive_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v2_logs-archives_list_logs_archives.rs b/examples/v2_logs-archives_list_logs_archives.rs index 36f8fe7f1..7d9d35482 100644 --- a/examples/v2_logs-archives_list_logs_archives.rs +++ b/examples/v2_logs-archives_list_logs_archives.rs @@ -1,10 +1,10 @@ // Get all archives returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_archives::LogsArchivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_archives::LogsArchivesAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsArchivesAPI::with_config(configuration); let resp = api.list_logs_archives().await; if let Ok(value) = resp { diff --git a/examples/v2_logs-archives_remove_role_from_archive.rs b/examples/v2_logs-archives_remove_role_from_archive.rs index 989fdabe6..bad685a23 100644 --- a/examples/v2_logs-archives_remove_role_from_archive.rs +++ b/examples/v2_logs-archives_remove_role_from_archive.rs @@ -1,6 +1,6 @@ // Revoke role from an archive returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_archives::LogsArchivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_archives::LogsArchivesAPI; use datadog_api_client::datadogV2::model::RelationshipToRole; use datadog_api_client::datadogV2::model::RelationshipToRoleData; use datadog_api_client::datadogV2::model::RolesType; @@ -12,7 +12,7 @@ async fn main() { .id("3653d3c6-0c75-11ea-ad28-fb5701eabc7d".to_string()) .type_(RolesType::ROLES), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsArchivesAPI::with_config(configuration); let resp = api .remove_role_from_archive("archive_id".to_string(), body) diff --git a/examples/v2_logs-archives_update_logs_archive.rs b/examples/v2_logs-archives_update_logs_archive.rs index 63c175fa1..d988d45be 100644 --- a/examples/v2_logs-archives_update_logs_archive.rs +++ b/examples/v2_logs-archives_update_logs_archive.rs @@ -1,6 +1,6 @@ // Update an archive returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_archives::LogsArchivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_archives::LogsArchivesAPI; use datadog_api_client::datadogV2::model::LogsArchiveCreateRequest; use datadog_api_client::datadogV2::model::LogsArchiveCreateRequestAttributes; use datadog_api_client::datadogV2::model::LogsArchiveCreateRequestDefinition; @@ -33,7 +33,7 @@ async fn main() { .rehydration_tags(vec!["team:intake".to_string(), "team:app".to_string()]), ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsArchivesAPI::with_config(configuration); let resp = api .update_logs_archive("archive_id".to_string(), body) diff --git a/examples/v2_logs-archives_update_logs_archive_order.rs b/examples/v2_logs-archives_update_logs_archive_order.rs index 209017f82..1ab993796 100644 --- a/examples/v2_logs-archives_update_logs_archive_order.rs +++ b/examples/v2_logs-archives_update_logs_archive_order.rs @@ -1,6 +1,6 @@ // Update archive order returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_archives::LogsArchivesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_archives::LogsArchivesAPI; use datadog_api_client::datadogV2::model::LogsArchiveOrder; use datadog_api_client::datadogV2::model::LogsArchiveOrderAttributes; use datadog_api_client::datadogV2::model::LogsArchiveOrderDefinition; @@ -16,7 +16,7 @@ async fn main() { ]), LogsArchiveOrderDefinitionType::ARCHIVE_ORDER, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsArchivesAPI::with_config(configuration); let resp = api.update_logs_archive_order(body).await; if let Ok(value) = resp { diff --git a/examples/v2_logs-custom-destinations_create_logs_custom_destination.rs b/examples/v2_logs-custom-destinations_create_logs_custom_destination.rs index d30c1f357..df41999eb 100644 --- a/examples/v2_logs-custom-destinations_create_logs_custom_destination.rs +++ b/examples/v2_logs-custom-destinations_create_logs_custom_destination.rs @@ -1,6 +1,6 @@ // Create a custom destination returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_custom_destinations::LogsCustomDestinationsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI; use datadog_api_client::datadogV2::model::CustomDestinationAttributeTagsRestrictionListType; use datadog_api_client::datadogV2::model::CustomDestinationCreateRequest; use datadog_api_client::datadogV2::model::CustomDestinationCreateRequestAttributes; @@ -42,7 +42,7 @@ async fn main() { .query("source:nginx".to_string()), CustomDestinationType::CUSTOM_DESTINATION, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsCustomDestinationsAPI::with_config(configuration); let resp = api.create_logs_custom_destination(body).await; if let Ok(value) = resp { diff --git a/examples/v2_logs-custom-destinations_create_logs_custom_destination_1091442807.rs b/examples/v2_logs-custom-destinations_create_logs_custom_destination_1091442807.rs index 36cd873f7..4eeb840f4 100644 --- a/examples/v2_logs-custom-destinations_create_logs_custom_destination_1091442807.rs +++ b/examples/v2_logs-custom-destinations_create_logs_custom_destination_1091442807.rs @@ -1,6 +1,6 @@ // Create a Custom Header HTTP custom destination returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_custom_destinations::LogsCustomDestinationsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI; use datadog_api_client::datadogV2::model::CustomDestinationAttributeTagsRestrictionListType; use datadog_api_client::datadogV2::model::CustomDestinationCreateRequest; use datadog_api_client::datadogV2::model::CustomDestinationCreateRequestAttributes; @@ -47,7 +47,7 @@ async fn main() { CustomDestinationType::CUSTOM_DESTINATION, ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsCustomDestinationsAPI::with_config(configuration); let resp = api.create_logs_custom_destination(body).await; if let Ok(value) = resp { diff --git a/examples/v2_logs-custom-destinations_create_logs_custom_destination_1288180912.rs b/examples/v2_logs-custom-destinations_create_logs_custom_destination_1288180912.rs index 828205472..cdf0b2598 100644 --- a/examples/v2_logs-custom-destinations_create_logs_custom_destination_1288180912.rs +++ b/examples/v2_logs-custom-destinations_create_logs_custom_destination_1288180912.rs @@ -1,6 +1,6 @@ // Create a Splunk custom destination returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_custom_destinations::LogsCustomDestinationsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI; use datadog_api_client::datadogV2::model::CustomDestinationAttributeTagsRestrictionListType; use datadog_api_client::datadogV2::model::CustomDestinationCreateRequest; use datadog_api_client::datadogV2::model::CustomDestinationCreateRequestAttributes; @@ -33,7 +33,7 @@ async fn main() { .query("source:nginx".to_string()), CustomDestinationType::CUSTOM_DESTINATION, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsCustomDestinationsAPI::with_config(configuration); let resp = api.create_logs_custom_destination(body).await; if let Ok(value) = resp { diff --git a/examples/v2_logs-custom-destinations_create_logs_custom_destination_141236188.rs b/examples/v2_logs-custom-destinations_create_logs_custom_destination_141236188.rs index 8640b1a11..0d1941fb6 100644 --- a/examples/v2_logs-custom-destinations_create_logs_custom_destination_141236188.rs +++ b/examples/v2_logs-custom-destinations_create_logs_custom_destination_141236188.rs @@ -1,6 +1,6 @@ // Create an Elasticsearch custom destination returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_custom_destinations::LogsCustomDestinationsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI; use datadog_api_client::datadogV2::model::CustomDestinationAttributeTagsRestrictionListType; use datadog_api_client::datadogV2::model::CustomDestinationCreateRequest; use datadog_api_client::datadogV2::model::CustomDestinationCreateRequestAttributes; @@ -41,7 +41,7 @@ async fn main() { .query("source:nginx".to_string()), CustomDestinationType::CUSTOM_DESTINATION, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsCustomDestinationsAPI::with_config(configuration); let resp = api.create_logs_custom_destination(body).await; if let Ok(value) = resp { diff --git a/examples/v2_logs-custom-destinations_create_logs_custom_destination_2184123765.rs b/examples/v2_logs-custom-destinations_create_logs_custom_destination_2184123765.rs index dcc1ae79d..65ae9daac 100644 --- a/examples/v2_logs-custom-destinations_create_logs_custom_destination_2184123765.rs +++ b/examples/v2_logs-custom-destinations_create_logs_custom_destination_2184123765.rs @@ -1,6 +1,6 @@ // Create a Basic HTTP custom destination returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_custom_destinations::LogsCustomDestinationsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI; use datadog_api_client::datadogV2::model::CustomDestinationAttributeTagsRestrictionListType; use datadog_api_client::datadogV2::model::CustomDestinationCreateRequest; use datadog_api_client::datadogV2::model::CustomDestinationCreateRequestAttributes; @@ -42,7 +42,7 @@ async fn main() { .query("source:nginx".to_string()), CustomDestinationType::CUSTOM_DESTINATION, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsCustomDestinationsAPI::with_config(configuration); let resp = api.create_logs_custom_destination(body).await; if let Ok(value) = resp { diff --git a/examples/v2_logs-custom-destinations_delete_logs_custom_destination.rs b/examples/v2_logs-custom-destinations_delete_logs_custom_destination.rs index 95656363f..18f691256 100644 --- a/examples/v2_logs-custom-destinations_delete_logs_custom_destination.rs +++ b/examples/v2_logs-custom-destinations_delete_logs_custom_destination.rs @@ -1,12 +1,12 @@ // Delete a custom destination returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_custom_destinations::LogsCustomDestinationsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI; #[tokio::main] async fn main() { // there is a valid "custom_destination" in the system let custom_destination_data_id = std::env::var("CUSTOM_DESTINATION_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsCustomDestinationsAPI::with_config(configuration); let resp = api .delete_logs_custom_destination(custom_destination_data_id.clone()) diff --git a/examples/v2_logs-custom-destinations_get_logs_custom_destination.rs b/examples/v2_logs-custom-destinations_get_logs_custom_destination.rs index e103735ac..904579215 100644 --- a/examples/v2_logs-custom-destinations_get_logs_custom_destination.rs +++ b/examples/v2_logs-custom-destinations_get_logs_custom_destination.rs @@ -1,12 +1,12 @@ // Get a custom destination returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_custom_destinations::LogsCustomDestinationsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI; #[tokio::main] async fn main() { // there is a valid "custom_destination" in the system let custom_destination_data_id = std::env::var("CUSTOM_DESTINATION_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsCustomDestinationsAPI::with_config(configuration); let resp = api .get_logs_custom_destination(custom_destination_data_id.clone()) diff --git a/examples/v2_logs-custom-destinations_list_logs_custom_destinations.rs b/examples/v2_logs-custom-destinations_list_logs_custom_destinations.rs index e1725c3e5..e6944af21 100644 --- a/examples/v2_logs-custom-destinations_list_logs_custom_destinations.rs +++ b/examples/v2_logs-custom-destinations_list_logs_custom_destinations.rs @@ -1,10 +1,10 @@ // Get all custom destinations returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_custom_destinations::LogsCustomDestinationsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsCustomDestinationsAPI::with_config(configuration); let resp = api.list_logs_custom_destinations().await; if let Ok(value) = resp { diff --git a/examples/v2_logs-custom-destinations_update_logs_custom_destination.rs b/examples/v2_logs-custom-destinations_update_logs_custom_destination.rs index 6c5631f21..dfdccbc9c 100644 --- a/examples/v2_logs-custom-destinations_update_logs_custom_destination.rs +++ b/examples/v2_logs-custom-destinations_update_logs_custom_destination.rs @@ -1,6 +1,6 @@ // Update a custom destination returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_custom_destinations::LogsCustomDestinationsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI; use datadog_api_client::datadogV2::model::CustomDestinationAttributeTagsRestrictionListType; use datadog_api_client::datadogV2::model::CustomDestinationType; use datadog_api_client::datadogV2::model::CustomDestinationUpdateRequest; @@ -27,7 +27,7 @@ async fn main() { .query("source:nginx".to_string()), ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsCustomDestinationsAPI::with_config(configuration); let resp = api .update_logs_custom_destination(custom_destination_data_id.clone(), body) diff --git a/examples/v2_logs-metrics_create_logs_metric.rs b/examples/v2_logs-metrics_create_logs_metric.rs index f3a9e5cfa..a60772d48 100644 --- a/examples/v2_logs-metrics_create_logs_metric.rs +++ b/examples/v2_logs-metrics_create_logs_metric.rs @@ -1,6 +1,6 @@ // Create a log-based metric returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_metrics::LogsMetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_metrics::LogsMetricsAPI; use datadog_api_client::datadogV2::model::LogsMetricCompute; use datadog_api_client::datadogV2::model::LogsMetricComputeAggregationType; use datadog_api_client::datadogV2::model::LogsMetricCreateAttributes; @@ -19,7 +19,7 @@ async fn main() { "ExampleLogsMetric".to_string(), LogsMetricType::LOGS_METRICS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsMetricsAPI::with_config(configuration); let resp = api.create_logs_metric(body).await; if let Ok(value) = resp { diff --git a/examples/v2_logs-metrics_delete_logs_metric.rs b/examples/v2_logs-metrics_delete_logs_metric.rs index 75a2ce142..cd38231a0 100644 --- a/examples/v2_logs-metrics_delete_logs_metric.rs +++ b/examples/v2_logs-metrics_delete_logs_metric.rs @@ -1,12 +1,12 @@ // Delete a log-based metric returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_metrics::LogsMetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_metrics::LogsMetricsAPI; #[tokio::main] async fn main() { // there is a valid "logs_metric" in the system let logs_metric_data_id = std::env::var("LOGS_METRIC_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsMetricsAPI::with_config(configuration); let resp = api.delete_logs_metric(logs_metric_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_logs-metrics_get_logs_metric.rs b/examples/v2_logs-metrics_get_logs_metric.rs index f9d848e5e..dcc349591 100644 --- a/examples/v2_logs-metrics_get_logs_metric.rs +++ b/examples/v2_logs-metrics_get_logs_metric.rs @@ -1,12 +1,12 @@ // Get a log-based metric returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_metrics::LogsMetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_metrics::LogsMetricsAPI; #[tokio::main] async fn main() { // there is a valid "logs_metric" in the system let logs_metric_data_id = std::env::var("LOGS_METRIC_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsMetricsAPI::with_config(configuration); let resp = api.get_logs_metric(logs_metric_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_logs-metrics_list_logs_metrics.rs b/examples/v2_logs-metrics_list_logs_metrics.rs index 47a04d8db..a758cf45e 100644 --- a/examples/v2_logs-metrics_list_logs_metrics.rs +++ b/examples/v2_logs-metrics_list_logs_metrics.rs @@ -1,10 +1,10 @@ // Get all log-based metrics returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_metrics::LogsMetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_metrics::LogsMetricsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsMetricsAPI::with_config(configuration); let resp = api.list_logs_metrics().await; if let Ok(value) = resp { diff --git a/examples/v2_logs-metrics_update_logs_metric.rs b/examples/v2_logs-metrics_update_logs_metric.rs index e1d8776a6..7249ce5f8 100644 --- a/examples/v2_logs-metrics_update_logs_metric.rs +++ b/examples/v2_logs-metrics_update_logs_metric.rs @@ -1,6 +1,6 @@ // Update a log-based metric returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_metrics::LogsMetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_metrics::LogsMetricsAPI; use datadog_api_client::datadogV2::model::LogsMetricFilter; use datadog_api_client::datadogV2::model::LogsMetricType; use datadog_api_client::datadogV2::model::LogsMetricUpdateAttributes; @@ -18,7 +18,7 @@ async fn main() { ), LogsMetricType::LOGS_METRICS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsMetricsAPI::with_config(configuration); let resp = api .update_logs_metric(logs_metric_data_id.clone(), body) diff --git a/examples/v2_logs-metrics_update_logs_metric_1901534424.rs b/examples/v2_logs-metrics_update_logs_metric_1901534424.rs index 21efbcb22..f973e6123 100644 --- a/examples/v2_logs-metrics_update_logs_metric_1901534424.rs +++ b/examples/v2_logs-metrics_update_logs_metric_1901534424.rs @@ -1,6 +1,6 @@ // Update a log-based metric with include_percentiles field returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs_metrics::LogsMetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs_metrics::LogsMetricsAPI; use datadog_api_client::datadogV2::model::LogsMetricType; use datadog_api_client::datadogV2::model::LogsMetricUpdateAttributes; use datadog_api_client::datadogV2::model::LogsMetricUpdateCompute; @@ -16,7 +16,7 @@ async fn main() { .compute(LogsMetricUpdateCompute::new().include_percentiles(false)), LogsMetricType::LOGS_METRICS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsMetricsAPI::with_config(configuration); let resp = api .update_logs_metric(logs_metric_percentile_data_id.clone(), body) diff --git a/examples/v2_logs_aggregate_logs.rs b/examples/v2_logs_aggregate_logs.rs index 9f056249a..0d237b1e9 100644 --- a/examples/v2_logs_aggregate_logs.rs +++ b/examples/v2_logs_aggregate_logs.rs @@ -1,6 +1,6 @@ // Aggregate events returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs::LogsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs::LogsAPI; use datadog_api_client::datadogV2::model::LogsAggregateRequest; use datadog_api_client::datadogV2::model::LogsQueryFilter; @@ -13,7 +13,7 @@ async fn main() { .query("*".to_string()) .to("now".to_string()), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsAPI::with_config(configuration); let resp = api.aggregate_logs(body).await; if let Ok(value) = resp { diff --git a/examples/v2_logs_aggregate_logs_2527007002.rs b/examples/v2_logs_aggregate_logs_2527007002.rs index 95176aa99..97cf7ade8 100644 --- a/examples/v2_logs_aggregate_logs_2527007002.rs +++ b/examples/v2_logs_aggregate_logs_2527007002.rs @@ -1,6 +1,6 @@ // Aggregate compute events returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs::LogsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs::LogsAPI; use datadog_api_client::datadogV2::model::LogsAggregateRequest; use datadog_api_client::datadogV2::model::LogsAggregationFunction; use datadog_api_client::datadogV2::model::LogsCompute; @@ -20,7 +20,7 @@ async fn main() { .query("*".to_string()) .to("now".to_string()), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsAPI::with_config(configuration); let resp = api.aggregate_logs(body).await; if let Ok(value) = resp { diff --git a/examples/v2_logs_aggregate_logs_2955613758.rs b/examples/v2_logs_aggregate_logs_2955613758.rs index 68c3d589c..07f739aec 100644 --- a/examples/v2_logs_aggregate_logs_2955613758.rs +++ b/examples/v2_logs_aggregate_logs_2955613758.rs @@ -1,6 +1,6 @@ // Aggregate compute events with group by returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs::LogsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs::LogsAPI; use datadog_api_client::datadogV2::model::LogsAggregateRequest; use datadog_api_client::datadogV2::model::LogsAggregateSort; use datadog_api_client::datadogV2::model::LogsAggregateSortType; @@ -40,7 +40,7 @@ async fn main() { .total(LogsGroupByTotal::LogsGroupByTotalString( "recall".to_string(), ))]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsAPI::with_config(configuration); let resp = api.aggregate_logs(body).await; if let Ok(value) = resp { diff --git a/examples/v2_logs_list_logs.rs b/examples/v2_logs_list_logs.rs index a2c58d391..06c8ee10b 100644 --- a/examples/v2_logs_list_logs.rs +++ b/examples/v2_logs_list_logs.rs @@ -1,7 +1,7 @@ // Search logs returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs::ListLogsOptionalParams; -use datadog_api_client::datadogV2::api::api_logs::LogsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs::ListLogsOptionalParams; +use datadog_api_client::datadogV2::api_logs::LogsAPI; use datadog_api_client::datadogV2::model::LogsListRequest; use datadog_api_client::datadogV2::model::LogsListRequestPage; use datadog_api_client::datadogV2::model::LogsQueryFilter; @@ -19,7 +19,7 @@ async fn main() { ) .page(LogsListRequestPage::new().limit(5)) .sort(LogsSort::TIMESTAMP_ASCENDING); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsAPI::with_config(configuration); let resp = api .list_logs(ListLogsOptionalParams::default().body(body)) diff --git a/examples/v2_logs_list_logs_3138392594.rs b/examples/v2_logs_list_logs_3138392594.rs index 910ca9a06..b57f9223b 100644 --- a/examples/v2_logs_list_logs_3138392594.rs +++ b/examples/v2_logs_list_logs_3138392594.rs @@ -1,7 +1,7 @@ // Search logs returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs::ListLogsOptionalParams; -use datadog_api_client::datadogV2::api::api_logs::LogsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs::ListLogsOptionalParams; +use datadog_api_client::datadogV2::api_logs::LogsAPI; use datadog_api_client::datadogV2::model::LogsListRequest; use datadog_api_client::datadogV2::model::LogsListRequestPage; use datadog_api_client::datadogV2::model::LogsQueryFilter; @@ -22,7 +22,7 @@ async fn main() { .options(LogsQueryOptions::new().timezone("GMT".to_string())) .page(LogsListRequestPage::new().limit(2)) .sort(LogsSort::TIMESTAMP_ASCENDING); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsAPI::with_config(configuration); let response = api.list_logs_with_pagination(ListLogsOptionalParams::default().body(body)); pin_mut!(response); diff --git a/examples/v2_logs_list_logs_get.rs b/examples/v2_logs_list_logs_get.rs index 01aab6130..1535c405a 100644 --- a/examples/v2_logs_list_logs_get.rs +++ b/examples/v2_logs_list_logs_get.rs @@ -1,11 +1,11 @@ // Get a list of logs returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs::ListLogsGetOptionalParams; -use datadog_api_client::datadogV2::api::api_logs::LogsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs::ListLogsGetOptionalParams; +use datadog_api_client::datadogV2::api_logs::LogsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsAPI::with_config(configuration); let resp = api .list_logs_get(ListLogsGetOptionalParams::default()) diff --git a/examples/v2_logs_list_logs_get_2034110533.rs b/examples/v2_logs_list_logs_get_2034110533.rs index 62c09c8ed..ea0df188e 100644 --- a/examples/v2_logs_list_logs_get_2034110533.rs +++ b/examples/v2_logs_list_logs_get_2034110533.rs @@ -1,11 +1,11 @@ // Get a quick list of logs returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs::ListLogsGetOptionalParams; -use datadog_api_client::datadogV2::api::api_logs::LogsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs::ListLogsGetOptionalParams; +use datadog_api_client::datadogV2::api_logs::LogsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsAPI::with_config(configuration); let resp = api .list_logs_get( diff --git a/examples/v2_logs_list_logs_get_738202670.rs b/examples/v2_logs_list_logs_get_738202670.rs index b6b577040..a7a40604d 100644 --- a/examples/v2_logs_list_logs_get_738202670.rs +++ b/examples/v2_logs_list_logs_get_738202670.rs @@ -1,13 +1,13 @@ // Get a list of logs returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs::ListLogsGetOptionalParams; -use datadog_api_client::datadogV2::api::api_logs::LogsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs::ListLogsGetOptionalParams; +use datadog_api_client::datadogV2::api_logs::LogsAPI; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsAPI::with_config(configuration); let response = api.list_logs_get_with_pagination(ListLogsGetOptionalParams::default().page_limit(2)); diff --git a/examples/v2_logs_submit_log.rs b/examples/v2_logs_submit_log.rs index c393efbe5..8ce6fe059 100644 --- a/examples/v2_logs_submit_log.rs +++ b/examples/v2_logs_submit_log.rs @@ -1,8 +1,8 @@ // Send logs returns "Request accepted for processing (always 202 empty JSON)." // response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs::LogsAPI; -use datadog_api_client::datadogV2::api::api_logs::SubmitLogOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs::LogsAPI; +use datadog_api_client::datadogV2::api_logs::SubmitLogOptionalParams; use datadog_api_client::datadogV2::model::HTTPLogItem; use std::collections::BTreeMap; @@ -16,7 +16,7 @@ async fn main() { .hostname("i-012345678".to_string()) .service("payment".to_string()) .additional_properties(BTreeMap::from([("status".to_string(), "info".to_string())]))]; - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsAPI::with_config(configuration); let resp = api .submit_log(body, SubmitLogOptionalParams::default()) diff --git a/examples/v2_logs_submit_log_3496222707.rs b/examples/v2_logs_submit_log_3496222707.rs index cf77b21c7..7e9bcced4 100644 --- a/examples/v2_logs_submit_log_3496222707.rs +++ b/examples/v2_logs_submit_log_3496222707.rs @@ -1,8 +1,8 @@ // Send gzip logs returns "Request accepted for processing (always 202 empty // JSON)." response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs::LogsAPI; -use datadog_api_client::datadogV2::api::api_logs::SubmitLogOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs::LogsAPI; +use datadog_api_client::datadogV2::api_logs::SubmitLogOptionalParams; use datadog_api_client::datadogV2::model::ContentEncoding; use datadog_api_client::datadogV2::model::HTTPLogItem; use std::collections::BTreeMap; @@ -17,7 +17,7 @@ async fn main() { .hostname("i-012345678".to_string()) .service("payment".to_string()) .additional_properties(BTreeMap::from([]))]; - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsAPI::with_config(configuration); let resp = api .submit_log( diff --git a/examples/v2_logs_submit_log_904601870.rs b/examples/v2_logs_submit_log_904601870.rs index a6f0d7cbb..6bb579ddf 100644 --- a/examples/v2_logs_submit_log_904601870.rs +++ b/examples/v2_logs_submit_log_904601870.rs @@ -1,8 +1,8 @@ // Send deflate logs returns "Request accepted for processing (always 202 empty // JSON)." response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_logs::LogsAPI; -use datadog_api_client::datadogV2::api::api_logs::SubmitLogOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_logs::LogsAPI; +use datadog_api_client::datadogV2::api_logs::SubmitLogOptionalParams; use datadog_api_client::datadogV2::model::ContentEncoding; use datadog_api_client::datadogV2::model::HTTPLogItem; use std::collections::BTreeMap; @@ -17,7 +17,7 @@ async fn main() { .hostname("i-012345678".to_string()) .service("payment".to_string()) .additional_properties(BTreeMap::from([]))]; - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = LogsAPI::with_config(configuration); let resp = api .submit_log( diff --git a/examples/v2_metrics_create_bulk_tags_metrics_configuration.rs b/examples/v2_metrics_create_bulk_tags_metrics_configuration.rs index 469b5237e..ed752b5ee 100644 --- a/examples/v2_metrics_create_bulk_tags_metrics_configuration.rs +++ b/examples/v2_metrics_create_bulk_tags_metrics_configuration.rs @@ -1,6 +1,6 @@ // Configure tags for multiple metrics returns "Accepted" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_metrics::MetricsAPI; use datadog_api_client::datadogV2::model::MetricBulkConfigureTagsType; use datadog_api_client::datadogV2::model::MetricBulkTagConfigCreate; use datadog_api_client::datadogV2::model::MetricBulkTagConfigCreateAttributes; @@ -21,7 +21,7 @@ async fn main() { .tags(vec!["test".to_string(), "examplemetric".to_string()]), ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api.create_bulk_tags_metrics_configuration(body).await; if let Ok(value) = resp { diff --git a/examples/v2_metrics_create_tag_configuration.rs b/examples/v2_metrics_create_tag_configuration.rs index f0b26fb2e..27f08158d 100644 --- a/examples/v2_metrics_create_tag_configuration.rs +++ b/examples/v2_metrics_create_tag_configuration.rs @@ -1,6 +1,6 @@ // Create a tag configuration returns "Created" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_metrics::MetricsAPI; use datadog_api_client::datadogV2::model::MetricTagConfigurationCreateAttributes; use datadog_api_client::datadogV2::model::MetricTagConfigurationCreateData; use datadog_api_client::datadogV2::model::MetricTagConfigurationCreateRequest; @@ -19,7 +19,7 @@ async fn main() { vec!["app".to_string(), "datacenter".to_string()], )), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api .create_tag_configuration("ExampleMetric".to_string(), body) diff --git a/examples/v2_metrics_delete_bulk_tags_metrics_configuration.rs b/examples/v2_metrics_delete_bulk_tags_metrics_configuration.rs index 2ac90c58f..6bd3fc0c7 100644 --- a/examples/v2_metrics_delete_bulk_tags_metrics_configuration.rs +++ b/examples/v2_metrics_delete_bulk_tags_metrics_configuration.rs @@ -1,6 +1,6 @@ // Delete tags for multiple metrics returns "Accepted" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_metrics::MetricsAPI; use datadog_api_client::datadogV2::model::MetricBulkConfigureTagsType; use datadog_api_client::datadogV2::model::MetricBulkTagConfigDelete; use datadog_api_client::datadogV2::model::MetricBulkTagConfigDeleteAttributes; @@ -18,7 +18,7 @@ async fn main() { "bob@example.com".to_string(), ])), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api.delete_bulk_tags_metrics_configuration(body).await; if let Ok(value) = resp { diff --git a/examples/v2_metrics_delete_tag_configuration.rs b/examples/v2_metrics_delete_tag_configuration.rs index d64c8bd2d..4bf050845 100644 --- a/examples/v2_metrics_delete_tag_configuration.rs +++ b/examples/v2_metrics_delete_tag_configuration.rs @@ -1,10 +1,10 @@ // Delete a tag configuration returns "No Content" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_metrics::MetricsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api .delete_tag_configuration("ExampleMetric".to_string()) diff --git a/examples/v2_metrics_estimate_metrics_output_series.rs b/examples/v2_metrics_estimate_metrics_output_series.rs index 71f1d8d44..43b96c8cb 100644 --- a/examples/v2_metrics_estimate_metrics_output_series.rs +++ b/examples/v2_metrics_estimate_metrics_output_series.rs @@ -1,11 +1,11 @@ // Tag Configuration Cardinality Estimator returns "Success" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_metrics::EstimateMetricsOutputSeriesOptionalParams; -use datadog_api_client::datadogV2::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_metrics::EstimateMetricsOutputSeriesOptionalParams; +use datadog_api_client::datadogV2::api_metrics::MetricsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api .estimate_metrics_output_series( diff --git a/examples/v2_metrics_list_active_metric_configurations.rs b/examples/v2_metrics_list_active_metric_configurations.rs index 15bf8d6fc..115b8f028 100644 --- a/examples/v2_metrics_list_active_metric_configurations.rs +++ b/examples/v2_metrics_list_active_metric_configurations.rs @@ -1,11 +1,11 @@ // List active tags and aggregations returns "Success" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_metrics::ListActiveMetricConfigurationsOptionalParams; -use datadog_api_client::datadogV2::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_metrics::ListActiveMetricConfigurationsOptionalParams; +use datadog_api_client::datadogV2::api_metrics::MetricsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api .list_active_metric_configurations( diff --git a/examples/v2_metrics_list_metric_assets.rs b/examples/v2_metrics_list_metric_assets.rs index ce9f0663c..fbad2ac51 100644 --- a/examples/v2_metrics_list_metric_assets.rs +++ b/examples/v2_metrics_list_metric_assets.rs @@ -1,10 +1,10 @@ // Related Assets to a Metric returns "Success" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_metrics::MetricsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api.list_metric_assets("system.cpu.user".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v2_metrics_list_tag_configuration_by_name.rs b/examples/v2_metrics_list_tag_configuration_by_name.rs index 233ccf440..a0eb8bda8 100644 --- a/examples/v2_metrics_list_tag_configuration_by_name.rs +++ b/examples/v2_metrics_list_tag_configuration_by_name.rs @@ -1,13 +1,13 @@ // List tag configuration by name returns "Success" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_metrics::MetricsAPI; #[tokio::main] async fn main() { // there is a valid "metric_tag_configuration" in the system let metric_tag_configuration_data_id = std::env::var("METRIC_TAG_CONFIGURATION_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api .list_tag_configuration_by_name(metric_tag_configuration_data_id.clone()) diff --git a/examples/v2_metrics_list_tag_configurations.rs b/examples/v2_metrics_list_tag_configurations.rs index a14308044..781f11195 100644 --- a/examples/v2_metrics_list_tag_configurations.rs +++ b/examples/v2_metrics_list_tag_configurations.rs @@ -1,11 +1,11 @@ // Get a list of metrics returns "Success" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_metrics::ListTagConfigurationsOptionalParams; -use datadog_api_client::datadogV2::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_metrics::ListTagConfigurationsOptionalParams; +use datadog_api_client::datadogV2::api_metrics::MetricsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api .list_tag_configurations(ListTagConfigurationsOptionalParams::default()) diff --git a/examples/v2_metrics_list_tag_configurations_265033704.rs b/examples/v2_metrics_list_tag_configurations_265033704.rs index bd43d5365..ad4d307c7 100644 --- a/examples/v2_metrics_list_tag_configurations_265033704.rs +++ b/examples/v2_metrics_list_tag_configurations_265033704.rs @@ -1,11 +1,11 @@ // Get a list of metrics with a tag filter returns "Success" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_metrics::ListTagConfigurationsOptionalParams; -use datadog_api_client::datadogV2::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_metrics::ListTagConfigurationsOptionalParams; +use datadog_api_client::datadogV2::api_metrics::MetricsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api .list_tag_configurations( diff --git a/examples/v2_metrics_list_tag_configurations_2739018321.rs b/examples/v2_metrics_list_tag_configurations_2739018321.rs index 5b15b6294..6aea3773e 100644 --- a/examples/v2_metrics_list_tag_configurations_2739018321.rs +++ b/examples/v2_metrics_list_tag_configurations_2739018321.rs @@ -1,11 +1,11 @@ // Get a list of metrics with configured filter returns "Success" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_metrics::ListTagConfigurationsOptionalParams; -use datadog_api_client::datadogV2::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_metrics::ListTagConfigurationsOptionalParams; +use datadog_api_client::datadogV2::api_metrics::MetricsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api .list_tag_configurations( diff --git a/examples/v2_metrics_list_tags_by_metric_name.rs b/examples/v2_metrics_list_tags_by_metric_name.rs index 15df32d43..f197474f3 100644 --- a/examples/v2_metrics_list_tags_by_metric_name.rs +++ b/examples/v2_metrics_list_tags_by_metric_name.rs @@ -1,13 +1,13 @@ // List tags by metric name returns "Success" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_metrics::MetricsAPI; #[tokio::main] async fn main() { // there is a valid "metric_tag_configuration" in the system let metric_tag_configuration_data_id = std::env::var("METRIC_TAG_CONFIGURATION_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api .list_tags_by_metric_name(metric_tag_configuration_data_id.clone()) diff --git a/examples/v2_metrics_list_volumes_by_metric_name.rs b/examples/v2_metrics_list_volumes_by_metric_name.rs index 65b02a529..b03c7128c 100644 --- a/examples/v2_metrics_list_volumes_by_metric_name.rs +++ b/examples/v2_metrics_list_volumes_by_metric_name.rs @@ -1,10 +1,10 @@ // List distinct metric volumes by metric name returns "Success" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_metrics::MetricsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api .list_volumes_by_metric_name("static_test_metric_donotdelete".to_string()) diff --git a/examples/v2_metrics_query_scalar_data.rs b/examples/v2_metrics_query_scalar_data.rs index 0ccbad950..3a3ebfeee 100644 --- a/examples/v2_metrics_query_scalar_data.rs +++ b/examples/v2_metrics_query_scalar_data.rs @@ -1,6 +1,6 @@ // Query scalar data across multiple products returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_metrics::MetricsAPI; use datadog_api_client::datadogV2::model::FormulaLimit; use datadog_api_client::datadogV2::model::MetricsAggregator; use datadog_api_client::datadogV2::model::MetricsDataSource; @@ -31,7 +31,7 @@ async fn main() { .limit(FormulaLimit::new().count(10).order(QuerySortOrder::DESC))]), ScalarFormulaRequestType::SCALAR_REQUEST, )); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.QueryScalarData", true); let api = MetricsAPI::with_config(configuration); let resp = api.query_scalar_data(body).await; diff --git a/examples/v2_metrics_query_scalar_data_3112571352.rs b/examples/v2_metrics_query_scalar_data_3112571352.rs index 97282a9cf..24e97dbd6 100644 --- a/examples/v2_metrics_query_scalar_data_3112571352.rs +++ b/examples/v2_metrics_query_scalar_data_3112571352.rs @@ -1,6 +1,6 @@ // Scalar cross product query returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_metrics::MetricsAPI; use datadog_api_client::datadogV2::model::FormulaLimit; use datadog_api_client::datadogV2::model::MetricsAggregator; use datadog_api_client::datadogV2::model::MetricsDataSource; @@ -32,7 +32,7 @@ async fn main() { .limit(FormulaLimit::new().count(10).order(QuerySortOrder::DESC))]), ScalarFormulaRequestType::SCALAR_REQUEST, )); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.QueryScalarData", true); let api = MetricsAPI::with_config(configuration); let resp = api.query_scalar_data(body).await; diff --git a/examples/v2_metrics_query_timeseries_data.rs b/examples/v2_metrics_query_timeseries_data.rs index 2dfef0308..346c9451f 100644 --- a/examples/v2_metrics_query_timeseries_data.rs +++ b/examples/v2_metrics_query_timeseries_data.rs @@ -1,6 +1,6 @@ // Query timeseries data across multiple products returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_metrics::MetricsAPI; use datadog_api_client::datadogV2::model::FormulaLimit; use datadog_api_client::datadogV2::model::MetricsDataSource; use datadog_api_client::datadogV2::model::MetricsTimeseriesQuery; @@ -30,7 +30,7 @@ async fn main() { .interval(5000), TimeseriesFormulaRequestType::TIMESERIES_REQUEST, )); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.QueryTimeseriesData", true); let api = MetricsAPI::with_config(configuration); let resp = api.query_timeseries_data(body).await; diff --git a/examples/v2_metrics_query_timeseries_data_301142940.rs b/examples/v2_metrics_query_timeseries_data_301142940.rs index 0edb15bba..3d5f6fddf 100644 --- a/examples/v2_metrics_query_timeseries_data_301142940.rs +++ b/examples/v2_metrics_query_timeseries_data_301142940.rs @@ -1,6 +1,6 @@ // Timeseries cross product query returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_metrics::MetricsAPI; use datadog_api_client::datadogV2::model::FormulaLimit; use datadog_api_client::datadogV2::model::MetricsDataSource; use datadog_api_client::datadogV2::model::MetricsTimeseriesQuery; @@ -31,7 +31,7 @@ async fn main() { .interval(5000), TimeseriesFormulaRequestType::TIMESERIES_REQUEST, )); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.QueryTimeseriesData", true); let api = MetricsAPI::with_config(configuration); let resp = api.query_timeseries_data(body).await; diff --git a/examples/v2_metrics_submit_metrics.rs b/examples/v2_metrics_submit_metrics.rs index d7fed0c45..d169cb144 100644 --- a/examples/v2_metrics_submit_metrics.rs +++ b/examples/v2_metrics_submit_metrics.rs @@ -1,7 +1,7 @@ // Submit metrics returns "Payload accepted" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_metrics::MetricsAPI; -use datadog_api_client::datadogV2::api::api_metrics::SubmitMetricsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_metrics::MetricsAPI; +use datadog_api_client::datadogV2::api_metrics::SubmitMetricsOptionalParams; use datadog_api_client::datadogV2::model::MetricIntakeType; use datadog_api_client::datadogV2::model::MetricPayload; use datadog_api_client::datadogV2::model::MetricPoint; @@ -18,7 +18,7 @@ async fn main() { .name("dummyhost".to_string()) .type_("host".to_string())]) .type_(MetricIntakeType::UNSPECIFIED)]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api .submit_metrics(body, SubmitMetricsOptionalParams::default()) diff --git a/examples/v2_metrics_submit_metrics_1762007427.rs b/examples/v2_metrics_submit_metrics_1762007427.rs index e2ed0d8c1..4d8b08809 100644 --- a/examples/v2_metrics_submit_metrics_1762007427.rs +++ b/examples/v2_metrics_submit_metrics_1762007427.rs @@ -1,7 +1,7 @@ // Submit metrics with compression returns "Payload accepted" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_metrics::MetricsAPI; -use datadog_api_client::datadogV2::api::api_metrics::SubmitMetricsOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_metrics::MetricsAPI; +use datadog_api_client::datadogV2::api_metrics::SubmitMetricsOptionalParams; use datadog_api_client::datadogV2::model::MetricContentEncoding; use datadog_api_client::datadogV2::model::MetricIntakeType; use datadog_api_client::datadogV2::model::MetricPayload; @@ -15,7 +15,7 @@ async fn main() { vec![MetricPoint::new().timestamp(1636629071).value(0.7 as f64)], ) .type_(MetricIntakeType::UNSPECIFIED)]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api .submit_metrics( diff --git a/examples/v2_metrics_update_tag_configuration.rs b/examples/v2_metrics_update_tag_configuration.rs index 5d0e5a2f0..db28acb86 100644 --- a/examples/v2_metrics_update_tag_configuration.rs +++ b/examples/v2_metrics_update_tag_configuration.rs @@ -1,6 +1,6 @@ // Update a tag configuration returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_metrics::MetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_metrics::MetricsAPI; use datadog_api_client::datadogV2::model::MetricTagConfigurationType; use datadog_api_client::datadogV2::model::MetricTagConfigurationUpdateAttributes; use datadog_api_client::datadogV2::model::MetricTagConfigurationUpdateData; @@ -18,7 +18,7 @@ async fn main() { ) .attributes(MetricTagConfigurationUpdateAttributes::new().tags(vec!["app".to_string()])), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MetricsAPI::with_config(configuration); let resp = api .update_tag_configuration(metric_tag_configuration_data_id.clone(), body) diff --git a/examples/v2_monitors_create_monitor_config_policy.rs b/examples/v2_monitors_create_monitor_config_policy.rs index 85869a329..69223e371 100644 --- a/examples/v2_monitors_create_monitor_config_policy.rs +++ b/examples/v2_monitors_create_monitor_config_policy.rs @@ -1,6 +1,6 @@ // Create a monitor configuration policy returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_monitors::MonitorsAPI; use datadog_api_client::datadogV2::model::MonitorConfigPolicyAttributeCreateRequest; use datadog_api_client::datadogV2::model::MonitorConfigPolicyCreateData; use datadog_api_client::datadogV2::model::MonitorConfigPolicyCreateRequest; @@ -24,7 +24,7 @@ async fn main() { ), MonitorConfigPolicyResourceType::MONITOR_CONFIG_POLICY, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api.create_monitor_config_policy(body).await; if let Ok(value) = resp { diff --git a/examples/v2_monitors_delete_monitor_config_policy.rs b/examples/v2_monitors_delete_monitor_config_policy.rs index 7de6d7a74..4665afa1d 100644 --- a/examples/v2_monitors_delete_monitor_config_policy.rs +++ b/examples/v2_monitors_delete_monitor_config_policy.rs @@ -1,13 +1,13 @@ // Delete a monitor configuration policy returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_monitors::MonitorsAPI; #[tokio::main] async fn main() { // there is a valid "monitor_configuration_policy" in the system let monitor_configuration_policy_data_id = std::env::var("MONITOR_CONFIGURATION_POLICY_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api .delete_monitor_config_policy(monitor_configuration_policy_data_id.clone()) diff --git a/examples/v2_monitors_get_monitor_config_policy.rs b/examples/v2_monitors_get_monitor_config_policy.rs index 583760320..c691102b8 100644 --- a/examples/v2_monitors_get_monitor_config_policy.rs +++ b/examples/v2_monitors_get_monitor_config_policy.rs @@ -1,13 +1,13 @@ // Get a monitor configuration policy returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_monitors::MonitorsAPI; #[tokio::main] async fn main() { // there is a valid "monitor_configuration_policy" in the system let monitor_configuration_policy_data_id = std::env::var("MONITOR_CONFIGURATION_POLICY_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api .get_monitor_config_policy(monitor_configuration_policy_data_id.clone()) diff --git a/examples/v2_monitors_list_monitor_config_policies.rs b/examples/v2_monitors_list_monitor_config_policies.rs index 5018fa198..ef462b085 100644 --- a/examples/v2_monitors_list_monitor_config_policies.rs +++ b/examples/v2_monitors_list_monitor_config_policies.rs @@ -1,10 +1,10 @@ // Get all monitor configuration policies returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_monitors::MonitorsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api.list_monitor_config_policies().await; if let Ok(value) = resp { diff --git a/examples/v2_monitors_update_monitor_config_policy.rs b/examples/v2_monitors_update_monitor_config_policy.rs index 3d7f38d63..39dbe5b64 100644 --- a/examples/v2_monitors_update_monitor_config_policy.rs +++ b/examples/v2_monitors_update_monitor_config_policy.rs @@ -1,6 +1,6 @@ // Edit a monitor configuration policy returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_monitors::MonitorsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_monitors::MonitorsAPI; use datadog_api_client::datadogV2::model::MonitorConfigPolicyAttributeEditRequest; use datadog_api_client::datadogV2::model::MonitorConfigPolicyEditData; use datadog_api_client::datadogV2::model::MonitorConfigPolicyEditRequest; @@ -27,7 +27,7 @@ async fn main() { monitor_configuration_policy_data_id.clone(), MonitorConfigPolicyResourceType::MONITOR_CONFIG_POLICY, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = MonitorsAPI::with_config(configuration); let resp = api .update_monitor_config_policy(monitor_configuration_policy_data_id.clone(), body) diff --git a/examples/v2_okta-integration_create_okta_account.rs b/examples/v2_okta-integration_create_okta_account.rs index 989b3a745..6d40cb9ab 100644 --- a/examples/v2_okta-integration_create_okta_account.rs +++ b/examples/v2_okta-integration_create_okta_account.rs @@ -1,6 +1,6 @@ // Add Okta account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_okta_integration::OktaIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_okta_integration::OktaIntegrationAPI; use datadog_api_client::datadogV2::model::OktaAccount; use datadog_api_client::datadogV2::model::OktaAccountAttributes; use datadog_api_client::datadogV2::model::OktaAccountRequest; @@ -21,7 +21,7 @@ async fn main() { ) .id("f749daaf-682e-4208-a38d-c9b43162c609".to_string()), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = OktaIntegrationAPI::with_config(configuration); let resp = api.create_okta_account(body).await; if let Ok(value) = resp { diff --git a/examples/v2_okta-integration_delete_okta_account.rs b/examples/v2_okta-integration_delete_okta_account.rs index a81288a5b..ed16fcbd9 100644 --- a/examples/v2_okta-integration_delete_okta_account.rs +++ b/examples/v2_okta-integration_delete_okta_account.rs @@ -1,10 +1,10 @@ // Delete Okta account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_okta_integration::OktaIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_okta_integration::OktaIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = OktaIntegrationAPI::with_config(configuration); let resp = api.delete_okta_account("account_id".to_string()).await; if let Ok(value) = resp { diff --git a/examples/v2_okta-integration_get_okta_account.rs b/examples/v2_okta-integration_get_okta_account.rs index a379acb55..13dc09cd5 100644 --- a/examples/v2_okta-integration_get_okta_account.rs +++ b/examples/v2_okta-integration_get_okta_account.rs @@ -1,12 +1,12 @@ // Get Okta account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_okta_integration::OktaIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_okta_integration::OktaIntegrationAPI; #[tokio::main] async fn main() { // there is a valid "okta_account" in the system let okta_account_data_id = std::env::var("OKTA_ACCOUNT_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = OktaIntegrationAPI::with_config(configuration); let resp = api.get_okta_account(okta_account_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_okta-integration_list_okta_accounts.rs b/examples/v2_okta-integration_list_okta_accounts.rs index 53b23b105..1e3c26fe4 100644 --- a/examples/v2_okta-integration_list_okta_accounts.rs +++ b/examples/v2_okta-integration_list_okta_accounts.rs @@ -1,10 +1,10 @@ // List Okta accounts returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_okta_integration::OktaIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_okta_integration::OktaIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = OktaIntegrationAPI::with_config(configuration); let resp = api.list_okta_accounts().await; if let Ok(value) = resp { diff --git a/examples/v2_okta-integration_update_okta_account.rs b/examples/v2_okta-integration_update_okta_account.rs index 903822fed..3e7c82060 100644 --- a/examples/v2_okta-integration_update_okta_account.rs +++ b/examples/v2_okta-integration_update_okta_account.rs @@ -1,6 +1,6 @@ // Update Okta account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_okta_integration::OktaIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_okta_integration::OktaIntegrationAPI; use datadog_api_client::datadogV2::model::OktaAccountType; use datadog_api_client::datadogV2::model::OktaAccountUpdateRequest; use datadog_api_client::datadogV2::model::OktaAccountUpdateRequestAttributes; @@ -22,7 +22,7 @@ async fn main() { ) .type_(OktaAccountType::OKTA_ACCOUNTS), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = OktaIntegrationAPI::with_config(configuration); let resp = api .update_okta_account(okta_account_data_id.clone(), body) diff --git a/examples/v2_opsgenie-integration_create_opsgenie_service.rs b/examples/v2_opsgenie-integration_create_opsgenie_service.rs index 826bcfd97..2edd91811 100644 --- a/examples/v2_opsgenie-integration_create_opsgenie_service.rs +++ b/examples/v2_opsgenie-integration_create_opsgenie_service.rs @@ -1,6 +1,6 @@ // Create a new service object returns "CREATED" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_opsgenie_integration::OpsgenieIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_opsgenie_integration::OpsgenieIntegrationAPI; use datadog_api_client::datadogV2::model::OpsgenieServiceCreateAttributes; use datadog_api_client::datadogV2::model::OpsgenieServiceCreateData; use datadog_api_client::datadogV2::model::OpsgenieServiceCreateRequest; @@ -17,7 +17,7 @@ async fn main() { ), OpsgenieServiceType::OPSGENIE_SERVICE, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = OpsgenieIntegrationAPI::with_config(configuration); let resp = api.create_opsgenie_service(body).await; if let Ok(value) = resp { diff --git a/examples/v2_opsgenie-integration_delete_opsgenie_service.rs b/examples/v2_opsgenie-integration_delete_opsgenie_service.rs index a5318730e..98565f0dd 100644 --- a/examples/v2_opsgenie-integration_delete_opsgenie_service.rs +++ b/examples/v2_opsgenie-integration_delete_opsgenie_service.rs @@ -1,12 +1,12 @@ // Delete a single service object returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_opsgenie_integration::OpsgenieIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_opsgenie_integration::OpsgenieIntegrationAPI; #[tokio::main] async fn main() { // there is a valid "opsgenie_service" in the system let opsgenie_service_data_id = std::env::var("OPSGENIE_SERVICE_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = OpsgenieIntegrationAPI::with_config(configuration); let resp = api .delete_opsgenie_service(opsgenie_service_data_id.clone()) diff --git a/examples/v2_opsgenie-integration_get_opsgenie_service.rs b/examples/v2_opsgenie-integration_get_opsgenie_service.rs index 316b52357..d14d5c669 100644 --- a/examples/v2_opsgenie-integration_get_opsgenie_service.rs +++ b/examples/v2_opsgenie-integration_get_opsgenie_service.rs @@ -1,12 +1,12 @@ // Get a single service object returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_opsgenie_integration::OpsgenieIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_opsgenie_integration::OpsgenieIntegrationAPI; #[tokio::main] async fn main() { // there is a valid "opsgenie_service" in the system let opsgenie_service_data_id = std::env::var("OPSGENIE_SERVICE_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = OpsgenieIntegrationAPI::with_config(configuration); let resp = api .get_opsgenie_service(opsgenie_service_data_id.clone()) diff --git a/examples/v2_opsgenie-integration_list_opsgenie_services.rs b/examples/v2_opsgenie-integration_list_opsgenie_services.rs index 0d85f4a54..0abbfda79 100644 --- a/examples/v2_opsgenie-integration_list_opsgenie_services.rs +++ b/examples/v2_opsgenie-integration_list_opsgenie_services.rs @@ -1,10 +1,10 @@ // Get all service objects returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_opsgenie_integration::OpsgenieIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_opsgenie_integration::OpsgenieIntegrationAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = OpsgenieIntegrationAPI::with_config(configuration); let resp = api.list_opsgenie_services().await; if let Ok(value) = resp { diff --git a/examples/v2_opsgenie-integration_update_opsgenie_service.rs b/examples/v2_opsgenie-integration_update_opsgenie_service.rs index c3e83c5da..62c47397f 100644 --- a/examples/v2_opsgenie-integration_update_opsgenie_service.rs +++ b/examples/v2_opsgenie-integration_update_opsgenie_service.rs @@ -1,6 +1,6 @@ // Update a single service object returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_opsgenie_integration::OpsgenieIntegrationAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_opsgenie_integration::OpsgenieIntegrationAPI; use datadog_api_client::datadogV2::model::OpsgenieServiceRegionType; use datadog_api_client::datadogV2::model::OpsgenieServiceType; use datadog_api_client::datadogV2::model::OpsgenieServiceUpdateAttributes; @@ -19,7 +19,7 @@ async fn main() { opsgenie_service_data_id.clone(), OpsgenieServiceType::OPSGENIE_SERVICE, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = OpsgenieIntegrationAPI::with_config(configuration); let resp = api .update_opsgenie_service(opsgenie_service_data_id.clone(), body) diff --git a/examples/v2_organizations_upload_idp_metadata.rs b/examples/v2_organizations_upload_idp_metadata.rs index beb059eb0..db36dcb98 100644 --- a/examples/v2_organizations_upload_idp_metadata.rs +++ b/examples/v2_organizations_upload_idp_metadata.rs @@ -1,12 +1,12 @@ // Upload IdP metadata returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_organizations::OrganizationsAPI; -use datadog_api_client::datadogV2::api::api_organizations::UploadIdPMetadataOptionalParams; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_organizations::OrganizationsAPI; +use datadog_api_client::datadogV2::api_organizations::UploadIdPMetadataOptionalParams; use std::fs; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = OrganizationsAPI::with_config(configuration); let resp = api .upload_idp_metadata(UploadIdPMetadataOptionalParams::default().idp_file( diff --git a/examples/v2_powerpack_create_powerpack.rs b/examples/v2_powerpack_create_powerpack.rs index e2e7a4870..a9e65df8a 100644 --- a/examples/v2_powerpack_create_powerpack.rs +++ b/examples/v2_powerpack_create_powerpack.rs @@ -1,6 +1,6 @@ // Create a new powerpack returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_powerpack::PowerpackAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_powerpack::PowerpackAPI; use datadog_api_client::datadogV2::model::Powerpack; use datadog_api_client::datadogV2::model::PowerpackAttributes; use datadog_api_client::datadogV2::model::PowerpackData; @@ -42,7 +42,7 @@ async fn main() { ) .type_("powerpack".to_string()), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = PowerpackAPI::with_config(configuration); let resp = api.create_powerpack(body).await; if let Ok(value) = resp { diff --git a/examples/v2_powerpack_delete_powerpack.rs b/examples/v2_powerpack_delete_powerpack.rs index a54d42b4b..cf4e3859a 100644 --- a/examples/v2_powerpack_delete_powerpack.rs +++ b/examples/v2_powerpack_delete_powerpack.rs @@ -1,12 +1,12 @@ // Delete a powerpack returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_powerpack::PowerpackAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_powerpack::PowerpackAPI; #[tokio::main] async fn main() { // there is a valid "powerpack" in the system let powerpack_data_id = std::env::var("POWERPACK_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = PowerpackAPI::with_config(configuration); let resp = api.delete_powerpack(powerpack_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_powerpack_get_powerpack.rs b/examples/v2_powerpack_get_powerpack.rs index 94bcae168..d407e5c35 100644 --- a/examples/v2_powerpack_get_powerpack.rs +++ b/examples/v2_powerpack_get_powerpack.rs @@ -1,12 +1,12 @@ // Get a Powerpack returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_powerpack::PowerpackAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_powerpack::PowerpackAPI; #[tokio::main] async fn main() { // there is a valid "powerpack" in the system let powerpack_data_id = std::env::var("POWERPACK_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = PowerpackAPI::with_config(configuration); let resp = api.get_powerpack(powerpack_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_powerpack_list_powerpacks.rs b/examples/v2_powerpack_list_powerpacks.rs index d1ba91170..125134168 100644 --- a/examples/v2_powerpack_list_powerpacks.rs +++ b/examples/v2_powerpack_list_powerpacks.rs @@ -1,11 +1,11 @@ // Get all powerpacks returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_powerpack::ListPowerpacksOptionalParams; -use datadog_api_client::datadogV2::api::api_powerpack::PowerpackAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_powerpack::ListPowerpacksOptionalParams; +use datadog_api_client::datadogV2::api_powerpack::PowerpackAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = PowerpackAPI::with_config(configuration); let resp = api .list_powerpacks(ListPowerpacksOptionalParams::default().page_limit(1000)) diff --git a/examples/v2_powerpack_list_powerpacks_1173755071.rs b/examples/v2_powerpack_list_powerpacks_1173755071.rs index 36a2526a4..f2003136f 100644 --- a/examples/v2_powerpack_list_powerpacks_1173755071.rs +++ b/examples/v2_powerpack_list_powerpacks_1173755071.rs @@ -1,13 +1,13 @@ // Get all powerpacks returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_powerpack::ListPowerpacksOptionalParams; -use datadog_api_client::datadogV2::api::api_powerpack::PowerpackAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_powerpack::ListPowerpacksOptionalParams; +use datadog_api_client::datadogV2::api_powerpack::PowerpackAPI; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = PowerpackAPI::with_config(configuration); let response = api.list_powerpacks_with_pagination(ListPowerpacksOptionalParams::default().page_limit(2)); diff --git a/examples/v2_powerpack_update_powerpack.rs b/examples/v2_powerpack_update_powerpack.rs index 44ec6c420..da1196908 100644 --- a/examples/v2_powerpack_update_powerpack.rs +++ b/examples/v2_powerpack_update_powerpack.rs @@ -1,6 +1,6 @@ // Update a powerpack returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_powerpack::PowerpackAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_powerpack::PowerpackAPI; use datadog_api_client::datadogV2::model::Powerpack; use datadog_api_client::datadogV2::model::PowerpackAttributes; use datadog_api_client::datadogV2::model::PowerpackData; @@ -44,7 +44,7 @@ async fn main() { ) .type_("powerpack".to_string()), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = PowerpackAPI::with_config(configuration); let resp = api.update_powerpack(powerpack_data_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_processes_list_processes.rs b/examples/v2_processes_list_processes.rs index 0e966a748..093970cc3 100644 --- a/examples/v2_processes_list_processes.rs +++ b/examples/v2_processes_list_processes.rs @@ -1,11 +1,11 @@ // Get all processes returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_processes::ListProcessesOptionalParams; -use datadog_api_client::datadogV2::api::api_processes::ProcessesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_processes::ListProcessesOptionalParams; +use datadog_api_client::datadogV2::api_processes::ProcessesAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ProcessesAPI::with_config(configuration); let resp = api .list_processes( diff --git a/examples/v2_processes_list_processes_797840471.rs b/examples/v2_processes_list_processes_797840471.rs index 99866be7e..ff12464ef 100644 --- a/examples/v2_processes_list_processes_797840471.rs +++ b/examples/v2_processes_list_processes_797840471.rs @@ -1,13 +1,13 @@ // Get all processes returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_processes::ListProcessesOptionalParams; -use datadog_api_client::datadogV2::api::api_processes::ProcessesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_processes::ListProcessesOptionalParams; +use datadog_api_client::datadogV2::api_processes::ProcessesAPI; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ProcessesAPI::with_config(configuration); let response = api.list_processes_with_pagination(ListProcessesOptionalParams::default().page_limit(2)); diff --git a/examples/v2_restriction-policies_delete_restriction_policy.rs b/examples/v2_restriction-policies_delete_restriction_policy.rs index bad437830..f728e5edd 100644 --- a/examples/v2_restriction-policies_delete_restriction_policy.rs +++ b/examples/v2_restriction-policies_delete_restriction_policy.rs @@ -1,10 +1,10 @@ // Delete a restriction policy returns "No Content" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_restriction_policies::RestrictionPoliciesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_restriction_policies::RestrictionPoliciesAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RestrictionPoliciesAPI::with_config(configuration); let resp = api .delete_restriction_policy("dashboard:test-delete".to_string()) diff --git a/examples/v2_restriction-policies_get_restriction_policy.rs b/examples/v2_restriction-policies_get_restriction_policy.rs index 345b9784d..bd5a14505 100644 --- a/examples/v2_restriction-policies_get_restriction_policy.rs +++ b/examples/v2_restriction-policies_get_restriction_policy.rs @@ -1,10 +1,10 @@ // Get a restriction policy returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_restriction_policies::RestrictionPoliciesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_restriction_policies::RestrictionPoliciesAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RestrictionPoliciesAPI::with_config(configuration); let resp = api .get_restriction_policy("dashboard:test-get".to_string()) diff --git a/examples/v2_restriction-policies_update_restriction_policy.rs b/examples/v2_restriction-policies_update_restriction_policy.rs index babcb17d1..a2a5270a9 100644 --- a/examples/v2_restriction-policies_update_restriction_policy.rs +++ b/examples/v2_restriction-policies_update_restriction_policy.rs @@ -1,6 +1,6 @@ // Update a restriction policy returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_restriction_policies::RestrictionPoliciesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_restriction_policies::RestrictionPoliciesAPI; use datadog_api_client::datadogV2::model::RestrictionPolicy; use datadog_api_client::datadogV2::model::RestrictionPolicyAttributes; use datadog_api_client::datadogV2::model::RestrictionPolicyBinding; @@ -18,7 +18,7 @@ async fn main() { "dashboard:test-update".to_string(), RestrictionPolicyType::RESTRICTION_POLICY, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RestrictionPoliciesAPI::with_config(configuration); let resp = api .update_restriction_policy("dashboard:test-update".to_string(), body) diff --git a/examples/v2_roles_add_permission_to_role.rs b/examples/v2_roles_add_permission_to_role.rs index 02a7c941c..913262bd0 100644 --- a/examples/v2_roles_add_permission_to_role.rs +++ b/examples/v2_roles_add_permission_to_role.rs @@ -1,6 +1,6 @@ // Grant permission to a role returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_roles::RolesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_roles::RolesAPI; use datadog_api_client::datadogV2::model::PermissionsType; use datadog_api_client::datadogV2::model::RelationshipToPermission; use datadog_api_client::datadogV2::model::RelationshipToPermissionData; @@ -17,7 +17,7 @@ async fn main() { .id(permission_id.clone()) .type_(PermissionsType::PERMISSIONS), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RolesAPI::with_config(configuration); let resp = api.add_permission_to_role(role_data_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_roles_add_user_to_role.rs b/examples/v2_roles_add_user_to_role.rs index c70502e97..8095d60bb 100644 --- a/examples/v2_roles_add_user_to_role.rs +++ b/examples/v2_roles_add_user_to_role.rs @@ -1,6 +1,6 @@ // Add a user to a role returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_roles::RolesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_roles::RolesAPI; use datadog_api_client::datadogV2::model::RelationshipToUser; use datadog_api_client::datadogV2::model::RelationshipToUserData; use datadog_api_client::datadogV2::model::UsersType; @@ -16,7 +16,7 @@ async fn main() { user_data_id.clone(), UsersType::USERS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RolesAPI::with_config(configuration); let resp = api.add_user_to_role(role_data_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_roles_clone_role.rs b/examples/v2_roles_clone_role.rs index 9b79dfc96..c3cac64c5 100644 --- a/examples/v2_roles_clone_role.rs +++ b/examples/v2_roles_clone_role.rs @@ -1,6 +1,6 @@ // Create a new role by cloning an existing role returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_roles::RolesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_roles::RolesAPI; use datadog_api_client::datadogV2::model::RoleClone; use datadog_api_client::datadogV2::model::RoleCloneAttributes; use datadog_api_client::datadogV2::model::RoleCloneRequest; @@ -14,7 +14,7 @@ async fn main() { RoleCloneAttributes::new("Example-Role clone".to_string()), RolesType::ROLES, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RolesAPI::with_config(configuration); let resp = api.clone_role(role_data_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_roles_create_role.rs b/examples/v2_roles_create_role.rs index 3b201d976..9149137a2 100644 --- a/examples/v2_roles_create_role.rs +++ b/examples/v2_roles_create_role.rs @@ -1,6 +1,6 @@ // Create role returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_roles::RolesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_roles::RolesAPI; use datadog_api_client::datadogV2::model::RoleCreateAttributes; use datadog_api_client::datadogV2::model::RoleCreateData; use datadog_api_client::datadogV2::model::RoleCreateRequest; @@ -12,7 +12,7 @@ async fn main() { RoleCreateData::new(RoleCreateAttributes::new("Example-Role".to_string())) .type_(RolesType::ROLES), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RolesAPI::with_config(configuration); let resp = api.create_role(body).await; if let Ok(value) = resp { diff --git a/examples/v2_roles_delete_role.rs b/examples/v2_roles_delete_role.rs index 1f5746d76..2243a2aeb 100644 --- a/examples/v2_roles_delete_role.rs +++ b/examples/v2_roles_delete_role.rs @@ -1,12 +1,12 @@ // Delete role returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_roles::RolesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_roles::RolesAPI; #[tokio::main] async fn main() { // there is a valid "role" in the system let role_data_id = std::env::var("ROLE_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RolesAPI::with_config(configuration); let resp = api.delete_role(role_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_roles_get_role.rs b/examples/v2_roles_get_role.rs index efc51117b..2185cd597 100644 --- a/examples/v2_roles_get_role.rs +++ b/examples/v2_roles_get_role.rs @@ -1,12 +1,12 @@ // Get a role returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_roles::RolesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_roles::RolesAPI; #[tokio::main] async fn main() { // there is a valid "role" in the system let role_data_id = std::env::var("ROLE_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RolesAPI::with_config(configuration); let resp = api.get_role(role_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_roles_list_permissions.rs b/examples/v2_roles_list_permissions.rs index 70d5e7008..c440a9ac0 100644 --- a/examples/v2_roles_list_permissions.rs +++ b/examples/v2_roles_list_permissions.rs @@ -1,10 +1,10 @@ // List permissions returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_roles::RolesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_roles::RolesAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RolesAPI::with_config(configuration); let resp = api.list_permissions().await; if let Ok(value) = resp { diff --git a/examples/v2_roles_list_role_permissions.rs b/examples/v2_roles_list_role_permissions.rs index ac93a5f2c..b965c5ca5 100644 --- a/examples/v2_roles_list_role_permissions.rs +++ b/examples/v2_roles_list_role_permissions.rs @@ -1,12 +1,12 @@ // List permissions for a role returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_roles::RolesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_roles::RolesAPI; #[tokio::main] async fn main() { // there is a valid "role" in the system let role_data_id = std::env::var("ROLE_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RolesAPI::with_config(configuration); let resp = api.list_role_permissions(role_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_roles_list_role_users.rs b/examples/v2_roles_list_role_users.rs index 450e01c97..682e687d9 100644 --- a/examples/v2_roles_list_role_users.rs +++ b/examples/v2_roles_list_role_users.rs @@ -1,13 +1,13 @@ // Get all users of a role returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_roles::ListRoleUsersOptionalParams; -use datadog_api_client::datadogV2::api::api_roles::RolesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_roles::ListRoleUsersOptionalParams; +use datadog_api_client::datadogV2::api_roles::RolesAPI; #[tokio::main] async fn main() { // there is a valid "role" in the system let role_data_id = std::env::var("ROLE_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RolesAPI::with_config(configuration); let resp = api .list_role_users(role_data_id.clone(), ListRoleUsersOptionalParams::default()) diff --git a/examples/v2_roles_list_roles.rs b/examples/v2_roles_list_roles.rs index 469584f7e..1726b23f5 100644 --- a/examples/v2_roles_list_roles.rs +++ b/examples/v2_roles_list_roles.rs @@ -1,13 +1,13 @@ // List roles returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_roles::ListRolesOptionalParams; -use datadog_api_client::datadogV2::api::api_roles::RolesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_roles::ListRolesOptionalParams; +use datadog_api_client::datadogV2::api_roles::RolesAPI; #[tokio::main] async fn main() { // there is a valid "role" in the system let role_data_attributes_name = std::env::var("ROLE_DATA_ATTRIBUTES_NAME").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RolesAPI::with_config(configuration); let resp = api .list_roles(ListRolesOptionalParams::default().filter(role_data_attributes_name.clone())) diff --git a/examples/v2_roles_remove_permission_from_role.rs b/examples/v2_roles_remove_permission_from_role.rs index cac52004c..b0a155b19 100644 --- a/examples/v2_roles_remove_permission_from_role.rs +++ b/examples/v2_roles_remove_permission_from_role.rs @@ -1,6 +1,6 @@ // Revoke permission returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_roles::RolesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_roles::RolesAPI; use datadog_api_client::datadogV2::model::PermissionsType; use datadog_api_client::datadogV2::model::RelationshipToPermission; use datadog_api_client::datadogV2::model::RelationshipToPermissionData; @@ -17,7 +17,7 @@ async fn main() { .id(permission_id.clone()) .type_(PermissionsType::PERMISSIONS), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RolesAPI::with_config(configuration); let resp = api .remove_permission_from_role(role_data_id.clone(), body) diff --git a/examples/v2_roles_remove_user_from_role.rs b/examples/v2_roles_remove_user_from_role.rs index dabe2cc08..101ed87ed 100644 --- a/examples/v2_roles_remove_user_from_role.rs +++ b/examples/v2_roles_remove_user_from_role.rs @@ -1,6 +1,6 @@ // Remove a user from a role returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_roles::RolesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_roles::RolesAPI; use datadog_api_client::datadogV2::model::RelationshipToUser; use datadog_api_client::datadogV2::model::RelationshipToUserData; use datadog_api_client::datadogV2::model::UsersType; @@ -16,7 +16,7 @@ async fn main() { user_data_id.clone(), UsersType::USERS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RolesAPI::with_config(configuration); let resp = api.remove_user_from_role(role_data_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_roles_update_role.rs b/examples/v2_roles_update_role.rs index f092ac1be..2e36c16d1 100644 --- a/examples/v2_roles_update_role.rs +++ b/examples/v2_roles_update_role.rs @@ -1,6 +1,6 @@ // Update a role returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_roles::RolesAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_roles::RolesAPI; use datadog_api_client::datadogV2::model::PermissionsType; use datadog_api_client::datadogV2::model::RelationshipToPermissionData; use datadog_api_client::datadogV2::model::RelationshipToPermissions; @@ -31,7 +31,7 @@ async fn main() { ]), )), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RolesAPI::with_config(configuration); let resp = api.update_role(role_data_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_rum_aggregate_rum_events.rs b/examples/v2_rum_aggregate_rum_events.rs index b17bbfd04..f7d2a5c6e 100644 --- a/examples/v2_rum_aggregate_rum_events.rs +++ b/examples/v2_rum_aggregate_rum_events.rs @@ -1,6 +1,6 @@ // Aggregate RUM events returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_rum::RUMAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_rum::RUMAPI; use datadog_api_client::datadogV2::model::RUMAggregateRequest; use datadog_api_client::datadogV2::model::RUMAggregationFunction; use datadog_api_client::datadogV2::model::RUMCompute; @@ -28,7 +28,7 @@ async fn main() { .total(RUMGroupByTotal::RUMGroupByTotalBoolean(false))]) .options(RUMQueryOptions::new().timezone("GMT".to_string())) .page(RUMQueryPageOptions::new().limit(25)); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RUMAPI::with_config(configuration); let resp = api.aggregate_rum_events(body).await; if let Ok(value) = resp { diff --git a/examples/v2_rum_create_rum_application.rs b/examples/v2_rum_create_rum_application.rs index 6bdb6c2b6..d434fb961 100644 --- a/examples/v2_rum_create_rum_application.rs +++ b/examples/v2_rum_create_rum_application.rs @@ -1,6 +1,6 @@ // Create a new RUM application returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_rum::RUMAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_rum::RUMAPI; use datadog_api_client::datadogV2::model::RUMApplicationCreate; use datadog_api_client::datadogV2::model::RUMApplicationCreateAttributes; use datadog_api_client::datadogV2::model::RUMApplicationCreateRequest; @@ -13,7 +13,7 @@ async fn main() { .type_("ios".to_string()), RUMApplicationCreateType::RUM_APPLICATION_CREATE, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RUMAPI::with_config(configuration); let resp = api.create_rum_application(body).await; if let Ok(value) = resp { diff --git a/examples/v2_rum_delete_rum_application.rs b/examples/v2_rum_delete_rum_application.rs index 082c9f5f4..cef598496 100644 --- a/examples/v2_rum_delete_rum_application.rs +++ b/examples/v2_rum_delete_rum_application.rs @@ -1,12 +1,12 @@ // Delete a RUM application returns "No Content" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_rum::RUMAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_rum::RUMAPI; #[tokio::main] async fn main() { // there is a valid "rum_application" in the system let rum_application_data_id = std::env::var("RUM_APPLICATION_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RUMAPI::with_config(configuration); let resp = api .delete_rum_application(rum_application_data_id.clone()) diff --git a/examples/v2_rum_get_rum_application.rs b/examples/v2_rum_get_rum_application.rs index 2dd074a62..0c102d8be 100644 --- a/examples/v2_rum_get_rum_application.rs +++ b/examples/v2_rum_get_rum_application.rs @@ -1,12 +1,12 @@ // Get a RUM application returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_rum::RUMAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_rum::RUMAPI; #[tokio::main] async fn main() { // there is a valid "rum_application" in the system let rum_application_data_id = std::env::var("RUM_APPLICATION_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RUMAPI::with_config(configuration); let resp = api .get_rum_application(rum_application_data_id.clone()) diff --git a/examples/v2_rum_get_rum_applications.rs b/examples/v2_rum_get_rum_applications.rs index 08d945f1f..a4633982c 100644 --- a/examples/v2_rum_get_rum_applications.rs +++ b/examples/v2_rum_get_rum_applications.rs @@ -1,10 +1,10 @@ // List all the RUM applications returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_rum::RUMAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_rum::RUMAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RUMAPI::with_config(configuration); let resp = api.get_rum_applications().await; if let Ok(value) = resp { diff --git a/examples/v2_rum_list_rum_events.rs b/examples/v2_rum_list_rum_events.rs index 5bc2550a7..894f12566 100644 --- a/examples/v2_rum_list_rum_events.rs +++ b/examples/v2_rum_list_rum_events.rs @@ -1,11 +1,11 @@ // Get a list of RUM events returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_rum::ListRUMEventsOptionalParams; -use datadog_api_client::datadogV2::api::api_rum::RUMAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_rum::ListRUMEventsOptionalParams; +use datadog_api_client::datadogV2::api_rum::RUMAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RUMAPI::with_config(configuration); let resp = api .list_rum_events(ListRUMEventsOptionalParams::default()) diff --git a/examples/v2_rum_list_rum_events_2680821282.rs b/examples/v2_rum_list_rum_events_2680821282.rs index eb79d8b95..99923ebe4 100644 --- a/examples/v2_rum_list_rum_events_2680821282.rs +++ b/examples/v2_rum_list_rum_events_2680821282.rs @@ -1,13 +1,13 @@ // Get a list of RUM events returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_rum::ListRUMEventsOptionalParams; -use datadog_api_client::datadogV2::api::api_rum::RUMAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_rum::ListRUMEventsOptionalParams; +use datadog_api_client::datadogV2::api_rum::RUMAPI; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RUMAPI::with_config(configuration); let response = api.list_rum_events_with_pagination(ListRUMEventsOptionalParams::default().page_limit(2)); diff --git a/examples/v2_rum_search_rum_events.rs b/examples/v2_rum_search_rum_events.rs index d56dc07a8..bd39df13f 100644 --- a/examples/v2_rum_search_rum_events.rs +++ b/examples/v2_rum_search_rum_events.rs @@ -1,6 +1,6 @@ // Search RUM events returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_rum::RUMAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_rum::RUMAPI; use datadog_api_client::datadogV2::model::RUMQueryFilter; use datadog_api_client::datadogV2::model::RUMQueryOptions; use datadog_api_client::datadogV2::model::RUMQueryPageOptions; @@ -23,7 +23,7 @@ async fn main() { ) .page(RUMQueryPageOptions::new().limit(25)) .sort(RUMSort::TIMESTAMP_ASCENDING); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RUMAPI::with_config(configuration); let resp = api.search_rum_events(body).await; if let Ok(value) = resp { diff --git a/examples/v2_rum_search_rum_events_574690310.rs b/examples/v2_rum_search_rum_events_574690310.rs index 2f6798eed..882aa8881 100644 --- a/examples/v2_rum_search_rum_events_574690310.rs +++ b/examples/v2_rum_search_rum_events_574690310.rs @@ -1,6 +1,6 @@ // Search RUM events returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_rum::RUMAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_rum::RUMAPI; use datadog_api_client::datadogV2::model::RUMQueryFilter; use datadog_api_client::datadogV2::model::RUMQueryOptions; use datadog_api_client::datadogV2::model::RUMQueryPageOptions; @@ -25,7 +25,7 @@ async fn main() { ) .page(RUMQueryPageOptions::new().limit(2)) .sort(RUMSort::TIMESTAMP_ASCENDING); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RUMAPI::with_config(configuration); let response = api.search_rum_events_with_pagination(body); pin_mut!(response); diff --git a/examples/v2_rum_update_rum_application.rs b/examples/v2_rum_update_rum_application.rs index 1ad96d337..cadf66953 100644 --- a/examples/v2_rum_update_rum_application.rs +++ b/examples/v2_rum_update_rum_application.rs @@ -1,6 +1,6 @@ // Update a RUM application returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_rum::RUMAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_rum::RUMAPI; use datadog_api_client::datadogV2::model::RUMApplicationUpdate; use datadog_api_client::datadogV2::model::RUMApplicationUpdateAttributes; use datadog_api_client::datadogV2::model::RUMApplicationUpdateRequest; @@ -21,7 +21,7 @@ async fn main() { .type_("browser".to_string()), ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = RUMAPI::with_config(configuration); let resp = api .update_rum_application(rum_application_data_id.clone(), body) diff --git a/examples/v2_security-monitoring_create_security_filter.rs b/examples/v2_security-monitoring_create_security_filter.rs index 1ce9e9ffd..b7044b5aa 100644 --- a/examples/v2_security-monitoring_create_security_filter.rs +++ b/examples/v2_security-monitoring_create_security_filter.rs @@ -1,6 +1,6 @@ // Create a security filter returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV2::model::SecurityFilterCreateAttributes; use datadog_api_client::datadogV2::model::SecurityFilterCreateData; use datadog_api_client::datadogV2::model::SecurityFilterCreateRequest; @@ -23,7 +23,7 @@ async fn main() { ), SecurityFilterType::SECURITY_FILTERS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api.create_security_filter(body).await; if let Ok(value) = resp { diff --git a/examples/v2_security-monitoring_create_security_monitoring_rule.rs b/examples/v2_security-monitoring_create_security_monitoring_rule.rs index 3af252943..9df4f3cea 100644 --- a/examples/v2_security-monitoring_create_security_monitoring_rule.rs +++ b/examples/v2_security-monitoring_create_security_monitoring_rule.rs @@ -1,6 +1,6 @@ // Create a detection rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleCaseCreate; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleCreatePayload; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleEvaluationWindow; @@ -42,7 +42,7 @@ async fn main() { .tags(vec![]) .type_(SecurityMonitoringRuleTypeCreate::LOG_DETECTION), )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api.create_security_monitoring_rule(body).await; if let Ok(value) = resp { diff --git a/examples/v2_security-monitoring_create_security_monitoring_rule_1092490364.rs b/examples/v2_security-monitoring_create_security_monitoring_rule_1092490364.rs index b4f981b6a..027e30b89 100644 --- a/examples/v2_security-monitoring_create_security_monitoring_rule_1092490364.rs +++ b/examples/v2_security-monitoring_create_security_monitoring_rule_1092490364.rs @@ -1,6 +1,6 @@ // Create a cloud_configuration rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV2::model::CloudConfigurationComplianceRuleOptions; use datadog_api_client::datadogV2::model::CloudConfigurationRegoRule; use datadog_api_client::datadogV2::model::CloudConfigurationRuleCaseCreate; @@ -77,7 +77,7 @@ results contains result if { .type_(CloudConfigurationRuleType::CLOUD_CONFIGURATION), ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api.create_security_monitoring_rule(body).await; if let Ok(value) = resp { diff --git a/examples/v2_security-monitoring_create_security_monitoring_rule_3367706049.rs b/examples/v2_security-monitoring_create_security_monitoring_rule_3367706049.rs index 3114cba67..84b028bf1 100644 --- a/examples/v2_security-monitoring_create_security_monitoring_rule_3367706049.rs +++ b/examples/v2_security-monitoring_create_security_monitoring_rule_3367706049.rs @@ -1,7 +1,7 @@ // Create a detection rule with detection method 'third_party' returns "OK" // response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleCreatePayload; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleDetectionMethod; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleKeepAlive; @@ -55,7 +55,7 @@ async fn main() { ]) .type_(SecurityMonitoringRuleTypeCreate::LOG_DETECTION), )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api.create_security_monitoring_rule(body).await; if let Ok(value) = resp { diff --git a/examples/v2_security-monitoring_create_security_monitoring_rule_461183901.rs b/examples/v2_security-monitoring_create_security_monitoring_rule_461183901.rs index be14f2764..1290dd3ce 100644 --- a/examples/v2_security-monitoring_create_security_monitoring_rule_461183901.rs +++ b/examples/v2_security-monitoring_create_security_monitoring_rule_461183901.rs @@ -1,6 +1,6 @@ // Create a detection rule with type 'impossible_travel' returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleCaseCreate; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleCreatePayload; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleDetectionMethod; @@ -49,7 +49,7 @@ async fn main() { .tags(vec![]) .type_(SecurityMonitoringRuleTypeCreate::LOG_DETECTION), )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api.create_security_monitoring_rule(body).await; if let Ok(value) = resp { diff --git a/examples/v2_security-monitoring_create_security_monitoring_rule_498211763.rs b/examples/v2_security-monitoring_create_security_monitoring_rule_498211763.rs index 04fe990d1..a6c35ad20 100644 --- a/examples/v2_security-monitoring_create_security_monitoring_rule_498211763.rs +++ b/examples/v2_security-monitoring_create_security_monitoring_rule_498211763.rs @@ -1,6 +1,6 @@ // Create a detection rule with type 'workload_security' returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleCaseCreate; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleCreatePayload; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleEvaluationWindow; @@ -42,7 +42,7 @@ async fn main() { .tags(vec![]) .type_(SecurityMonitoringRuleTypeCreate::WORKLOAD_SECURITY), )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api.create_security_monitoring_rule(body).await; if let Ok(value) = resp { diff --git a/examples/v2_security-monitoring_create_security_monitoring_rule_914562040.rs b/examples/v2_security-monitoring_create_security_monitoring_rule_914562040.rs index 22e3dbf36..579a5fdfe 100644 --- a/examples/v2_security-monitoring_create_security_monitoring_rule_914562040.rs +++ b/examples/v2_security-monitoring_create_security_monitoring_rule_914562040.rs @@ -1,6 +1,6 @@ // Create a detection rule with type 'signal_correlation' returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleCaseCreate; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleCreatePayload; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleEvaluationWindow; @@ -50,7 +50,7 @@ async fn main() { .tags(vec![]) .type_(SecurityMonitoringSignalRuleType::SIGNAL_CORRELATION), )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api.create_security_monitoring_rule(body).await; if let Ok(value) = resp { diff --git a/examples/v2_security-monitoring_create_security_monitoring_suppression.rs b/examples/v2_security-monitoring_create_security_monitoring_suppression.rs index 4e4de2036..5ac6e6d32 100644 --- a/examples/v2_security-monitoring_create_security_monitoring_suppression.rs +++ b/examples/v2_security-monitoring_create_security_monitoring_suppression.rs @@ -1,6 +1,6 @@ // Create a suppression rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV2::model::SecurityMonitoringSuppressionCreateAttributes; use datadog_api_client::datadogV2::model::SecurityMonitoringSuppressionCreateData; use datadog_api_client::datadogV2::model::SecurityMonitoringSuppressionCreateRequest; @@ -23,7 +23,7 @@ async fn main() { SecurityMonitoringSuppressionType::SUPPRESSIONS, ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api.create_security_monitoring_suppression(body).await; if let Ok(value) = resp { diff --git a/examples/v2_security-monitoring_delete_security_filter.rs b/examples/v2_security-monitoring_delete_security_filter.rs index d9b7dfa09..888e183f0 100644 --- a/examples/v2_security-monitoring_delete_security_filter.rs +++ b/examples/v2_security-monitoring_delete_security_filter.rs @@ -1,10 +1,10 @@ // Delete a security filter returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .delete_security_filter("security_filter_id".to_string()) diff --git a/examples/v2_security-monitoring_delete_security_filter_555029489.rs b/examples/v2_security-monitoring_delete_security_filter_555029489.rs index da73ecb00..83249a6fd 100644 --- a/examples/v2_security-monitoring_delete_security_filter_555029489.rs +++ b/examples/v2_security-monitoring_delete_security_filter_555029489.rs @@ -1,12 +1,12 @@ // Delete a security filter returns "No Content" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; #[tokio::main] async fn main() { // there is a valid "security_filter" in the system let security_filter_data_id = std::env::var("SECURITY_FILTER_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .delete_security_filter(security_filter_data_id.clone()) diff --git a/examples/v2_security-monitoring_delete_security_monitoring_rule.rs b/examples/v2_security-monitoring_delete_security_monitoring_rule.rs index 3a9d71078..ba238fc76 100644 --- a/examples/v2_security-monitoring_delete_security_monitoring_rule.rs +++ b/examples/v2_security-monitoring_delete_security_monitoring_rule.rs @@ -1,12 +1,12 @@ // Delete an existing rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; #[tokio::main] async fn main() { // there is a valid "security_rule" in the system let security_rule_id = std::env::var("SECURITY_RULE_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .delete_security_monitoring_rule(security_rule_id.clone()) diff --git a/examples/v2_security-monitoring_delete_security_monitoring_suppression.rs b/examples/v2_security-monitoring_delete_security_monitoring_suppression.rs index 0cbab276f..50c8feb36 100644 --- a/examples/v2_security-monitoring_delete_security_monitoring_suppression.rs +++ b/examples/v2_security-monitoring_delete_security_monitoring_suppression.rs @@ -1,12 +1,12 @@ // Delete a suppression rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; #[tokio::main] async fn main() { // there is a valid "suppression" in the system let suppression_data_id = std::env::var("SUPPRESSION_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .delete_security_monitoring_suppression(suppression_data_id.clone()) diff --git a/examples/v2_security-monitoring_edit_security_monitoring_signal_assignee.rs b/examples/v2_security-monitoring_edit_security_monitoring_signal_assignee.rs index 25f493c70..496e108c9 100644 --- a/examples/v2_security-monitoring_edit_security_monitoring_signal_assignee.rs +++ b/examples/v2_security-monitoring_edit_security_monitoring_signal_assignee.rs @@ -1,6 +1,6 @@ // Modify the triage assignee of a security signal returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV2::model::SecurityMonitoringSignalAssigneeUpdateAttributes; use datadog_api_client::datadogV2::model::SecurityMonitoringSignalAssigneeUpdateData; use datadog_api_client::datadogV2::model::SecurityMonitoringSignalAssigneeUpdateRequest; @@ -15,7 +15,7 @@ async fn main() { ), ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .edit_security_monitoring_signal_assignee( diff --git a/examples/v2_security-monitoring_edit_security_monitoring_signal_incidents.rs b/examples/v2_security-monitoring_edit_security_monitoring_signal_incidents.rs index c98060308..04aaaa28d 100644 --- a/examples/v2_security-monitoring_edit_security_monitoring_signal_incidents.rs +++ b/examples/v2_security-monitoring_edit_security_monitoring_signal_incidents.rs @@ -1,6 +1,6 @@ // Change the related incidents of a security signal returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV2::model::SecurityMonitoringSignalIncidentsUpdateAttributes; use datadog_api_client::datadogV2::model::SecurityMonitoringSignalIncidentsUpdateData; use datadog_api_client::datadogV2::model::SecurityMonitoringSignalIncidentsUpdateRequest; @@ -12,7 +12,7 @@ async fn main() { SecurityMonitoringSignalIncidentsUpdateAttributes::new(vec![2066]), ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .edit_security_monitoring_signal_incidents( diff --git a/examples/v2_security-monitoring_edit_security_monitoring_signal_state.rs b/examples/v2_security-monitoring_edit_security_monitoring_signal_state.rs index 4e155ae6a..62e8d7ab2 100644 --- a/examples/v2_security-monitoring_edit_security_monitoring_signal_state.rs +++ b/examples/v2_security-monitoring_edit_security_monitoring_signal_state.rs @@ -1,6 +1,6 @@ // Change the triage state of a security signal returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV2::model::SecurityMonitoringSignalArchiveReason; use datadog_api_client::datadogV2::model::SecurityMonitoringSignalState; use datadog_api_client::datadogV2::model::SecurityMonitoringSignalStateUpdateAttributes; @@ -15,7 +15,7 @@ async fn main() { .archive_reason(SecurityMonitoringSignalArchiveReason::NONE), ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .edit_security_monitoring_signal_state( diff --git a/examples/v2_security-monitoring_get_finding.rs b/examples/v2_security-monitoring_get_finding.rs index 643d43b51..b21f1c1d7 100644 --- a/examples/v2_security-monitoring_get_finding.rs +++ b/examples/v2_security-monitoring_get_finding.rs @@ -1,11 +1,11 @@ // Get a finding returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::GetFindingOptionalParams; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::GetFindingOptionalParams; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; #[tokio::main] async fn main() { - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.GetFinding", true); let api = SecurityMonitoringAPI::with_config(configuration); let resp = diff --git a/examples/v2_security-monitoring_get_security_filter.rs b/examples/v2_security-monitoring_get_security_filter.rs index f9e0d4996..19ac44f5c 100644 --- a/examples/v2_security-monitoring_get_security_filter.rs +++ b/examples/v2_security-monitoring_get_security_filter.rs @@ -1,12 +1,12 @@ // Get a security filter returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; #[tokio::main] async fn main() { // there is a valid "security_filter" in the system let security_filter_data_id = std::env::var("SECURITY_FILTER_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .get_security_filter(security_filter_data_id.clone()) diff --git a/examples/v2_security-monitoring_get_security_monitoring_rule.rs b/examples/v2_security-monitoring_get_security_monitoring_rule.rs index e1ecd3ddf..b81a90e4c 100644 --- a/examples/v2_security-monitoring_get_security_monitoring_rule.rs +++ b/examples/v2_security-monitoring_get_security_monitoring_rule.rs @@ -1,12 +1,12 @@ // Get a rule's details returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; #[tokio::main] async fn main() { // there is a valid "security_rule" in the system let security_rule_id = std::env::var("SECURITY_RULE_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .get_security_monitoring_rule(security_rule_id.clone()) diff --git a/examples/v2_security-monitoring_get_security_monitoring_rule_3370522281.rs b/examples/v2_security-monitoring_get_security_monitoring_rule_3370522281.rs index e66995cd1..b2de42b43 100644 --- a/examples/v2_security-monitoring_get_security_monitoring_rule_3370522281.rs +++ b/examples/v2_security-monitoring_get_security_monitoring_rule_3370522281.rs @@ -1,12 +1,12 @@ // Get a cloud configuration rule's details returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; #[tokio::main] async fn main() { // there is a valid "cloud_configuration_rule" in the system let cloud_configuration_rule_id = std::env::var("CLOUD_CONFIGURATION_RULE_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .get_security_monitoring_rule(cloud_configuration_rule_id.clone()) diff --git a/examples/v2_security-monitoring_get_security_monitoring_signal.rs b/examples/v2_security-monitoring_get_security_monitoring_signal.rs index 797cdffb9..992822143 100644 --- a/examples/v2_security-monitoring_get_security_monitoring_signal.rs +++ b/examples/v2_security-monitoring_get_security_monitoring_signal.rs @@ -1,10 +1,10 @@ // Get a signal's details returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .get_security_monitoring_signal( diff --git a/examples/v2_security-monitoring_get_security_monitoring_suppression.rs b/examples/v2_security-monitoring_get_security_monitoring_suppression.rs index c7ea76f74..4f583d591 100644 --- a/examples/v2_security-monitoring_get_security_monitoring_suppression.rs +++ b/examples/v2_security-monitoring_get_security_monitoring_suppression.rs @@ -1,12 +1,12 @@ // Get a suppression rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; #[tokio::main] async fn main() { // there is a valid "suppression" in the system let suppression_data_id = std::env::var("SUPPRESSION_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .get_security_monitoring_suppression(suppression_data_id.clone()) diff --git a/examples/v2_security-monitoring_list_findings.rs b/examples/v2_security-monitoring_list_findings.rs index f88ee4cbe..f4da7bca5 100644 --- a/examples/v2_security-monitoring_list_findings.rs +++ b/examples/v2_security-monitoring_list_findings.rs @@ -1,11 +1,11 @@ // List findings returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::ListFindingsOptionalParams; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::ListFindingsOptionalParams; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; #[tokio::main] async fn main() { - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.ListFindings", true); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api diff --git a/examples/v2_security-monitoring_list_findings_3865842421.rs b/examples/v2_security-monitoring_list_findings_3865842421.rs index 79f4ae9fd..3716c50c0 100644 --- a/examples/v2_security-monitoring_list_findings_3865842421.rs +++ b/examples/v2_security-monitoring_list_findings_3865842421.rs @@ -1,13 +1,13 @@ // List findings returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::ListFindingsOptionalParams; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::ListFindingsOptionalParams; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.ListFindings", true); let api = SecurityMonitoringAPI::with_config(configuration); let response = api.list_findings_with_pagination(ListFindingsOptionalParams::default()); diff --git a/examples/v2_security-monitoring_list_security_filters.rs b/examples/v2_security-monitoring_list_security_filters.rs index 3831f436d..846bc3ed9 100644 --- a/examples/v2_security-monitoring_list_security_filters.rs +++ b/examples/v2_security-monitoring_list_security_filters.rs @@ -1,10 +1,10 @@ // Get all security filters returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api.list_security_filters().await; if let Ok(value) = resp { diff --git a/examples/v2_security-monitoring_list_security_monitoring_rules.rs b/examples/v2_security-monitoring_list_security_monitoring_rules.rs index d57d9d1a3..6d4281c05 100644 --- a/examples/v2_security-monitoring_list_security_monitoring_rules.rs +++ b/examples/v2_security-monitoring_list_security_monitoring_rules.rs @@ -1,11 +1,11 @@ // List rules returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::ListSecurityMonitoringRulesOptionalParams; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::ListSecurityMonitoringRulesOptionalParams; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .list_security_monitoring_rules(ListSecurityMonitoringRulesOptionalParams::default()) diff --git a/examples/v2_security-monitoring_list_security_monitoring_signals.rs b/examples/v2_security-monitoring_list_security_monitoring_signals.rs index 119a61503..b06dd9e61 100644 --- a/examples/v2_security-monitoring_list_security_monitoring_signals.rs +++ b/examples/v2_security-monitoring_list_security_monitoring_signals.rs @@ -1,11 +1,11 @@ // Get a quick list of security signals returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::ListSecurityMonitoringSignalsOptionalParams; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::ListSecurityMonitoringSignalsOptionalParams; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .list_security_monitoring_signals(ListSecurityMonitoringSignalsOptionalParams::default()) diff --git a/examples/v2_security-monitoring_list_security_monitoring_signals_3960412991.rs b/examples/v2_security-monitoring_list_security_monitoring_signals_3960412991.rs index a6f4edb97..a0d135cd6 100644 --- a/examples/v2_security-monitoring_list_security_monitoring_signals_3960412991.rs +++ b/examples/v2_security-monitoring_list_security_monitoring_signals_3960412991.rs @@ -1,13 +1,13 @@ // Get a quick list of security signals returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::ListSecurityMonitoringSignalsOptionalParams; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::ListSecurityMonitoringSignalsOptionalParams; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let response = api.list_security_monitoring_signals_with_pagination( ListSecurityMonitoringSignalsOptionalParams::default().page_limit(2), diff --git a/examples/v2_security-monitoring_list_security_monitoring_suppressions.rs b/examples/v2_security-monitoring_list_security_monitoring_suppressions.rs index 7f8f21dc6..85745b6f2 100644 --- a/examples/v2_security-monitoring_list_security_monitoring_suppressions.rs +++ b/examples/v2_security-monitoring_list_security_monitoring_suppressions.rs @@ -1,10 +1,10 @@ // Get all suppression rules returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api.list_security_monitoring_suppressions().await; if let Ok(value) = resp { diff --git a/examples/v2_security-monitoring_mute_findings.rs b/examples/v2_security-monitoring_mute_findings.rs index b134b242d..5e977006b 100644 --- a/examples/v2_security-monitoring_mute_findings.rs +++ b/examples/v2_security-monitoring_mute_findings.rs @@ -1,6 +1,6 @@ // Mute or unmute a batch of findings returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV2::model::BulkMuteFindingsRequest; use datadog_api_client::datadogV2::model::BulkMuteFindingsRequestAttributes; use datadog_api_client::datadogV2::model::BulkMuteFindingsRequestData; @@ -24,7 +24,7 @@ async fn main() { )]), FindingType::FINDING, )); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.MuteFindings", true); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api.mute_findings(body).await; diff --git a/examples/v2_security-monitoring_search_security_monitoring_signals.rs b/examples/v2_security-monitoring_search_security_monitoring_signals.rs index 08f4f5259..651ccdf75 100644 --- a/examples/v2_security-monitoring_search_security_monitoring_signals.rs +++ b/examples/v2_security-monitoring_search_security_monitoring_signals.rs @@ -1,7 +1,7 @@ // Get a list of security signals returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SearchSecurityMonitoringSignalsOptionalParams; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SearchSecurityMonitoringSignalsOptionalParams; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV2::model::SecurityMonitoringSignalListRequest; use datadog_api_client::datadogV2::model::SecurityMonitoringSignalListRequestFilter; use datadog_api_client::datadogV2::model::SecurityMonitoringSignalListRequestPage; @@ -25,7 +25,7 @@ async fn main() { .limit(25), ) .sort(SecurityMonitoringSignalsSort::TIMESTAMP_ASCENDING); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .search_security_monitoring_signals( diff --git a/examples/v2_security-monitoring_search_security_monitoring_signals_1309350146.rs b/examples/v2_security-monitoring_search_security_monitoring_signals_1309350146.rs index 5df2bb662..138b72789 100644 --- a/examples/v2_security-monitoring_search_security_monitoring_signals_1309350146.rs +++ b/examples/v2_security-monitoring_search_security_monitoring_signals_1309350146.rs @@ -1,7 +1,7 @@ // Get a list of security signals returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SearchSecurityMonitoringSignalsOptionalParams; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SearchSecurityMonitoringSignalsOptionalParams; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV2::model::SecurityMonitoringSignalListRequest; use datadog_api_client::datadogV2::model::SecurityMonitoringSignalListRequestFilter; use datadog_api_client::datadogV2::model::SecurityMonitoringSignalListRequestPage; @@ -20,7 +20,7 @@ async fn main() { ) .page(SecurityMonitoringSignalListRequestPage::new().limit(2)) .sort(SecurityMonitoringSignalsSort::TIMESTAMP_ASCENDING); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let response = api.search_security_monitoring_signals_with_pagination( SearchSecurityMonitoringSignalsOptionalParams::default().body(body), diff --git a/examples/v2_security-monitoring_update_security_filter.rs b/examples/v2_security-monitoring_update_security_filter.rs index e80b6b86a..692604f61 100644 --- a/examples/v2_security-monitoring_update_security_filter.rs +++ b/examples/v2_security-monitoring_update_security_filter.rs @@ -1,6 +1,6 @@ // Update a security filter returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV2::model::SecurityFilterFilteredDataType; use datadog_api_client::datadogV2::model::SecurityFilterType; use datadog_api_client::datadogV2::model::SecurityFilterUpdateAttributes; @@ -21,7 +21,7 @@ async fn main() { .version(1), SecurityFilterType::SECURITY_FILTERS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .update_security_filter(security_filter_data_id.clone(), body) diff --git a/examples/v2_security-monitoring_update_security_monitoring_rule.rs b/examples/v2_security-monitoring_update_security_monitoring_rule.rs index c188530b9..b4a6a6403 100644 --- a/examples/v2_security-monitoring_update_security_monitoring_rule.rs +++ b/examples/v2_security-monitoring_update_security_monitoring_rule.rs @@ -1,6 +1,6 @@ // Update an existing rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleCase; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleEvaluationWindow; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleKeepAlive; @@ -43,7 +43,7 @@ async fn main() { )), ]) .tags(vec![]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .update_security_monitoring_rule(security_rule_id.clone(), body) diff --git a/examples/v2_security-monitoring_update_security_monitoring_rule_428087276.rs b/examples/v2_security-monitoring_update_security_monitoring_rule_428087276.rs index 2c321c7ed..c2e3000f6 100644 --- a/examples/v2_security-monitoring_update_security_monitoring_rule_428087276.rs +++ b/examples/v2_security-monitoring_update_security_monitoring_rule_428087276.rs @@ -1,6 +1,6 @@ // Update a cloud configuration rule's details returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV2::model::CloudConfigurationComplianceRuleOptions; use datadog_api_client::datadogV2::model::CloudConfigurationRegoRule; use datadog_api_client::datadogV2::model::CloudConfigurationRuleComplianceSignalOptions; @@ -65,7 +65,7 @@ results contains result if { ), ) .tags(vec![]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .update_security_monitoring_rule(cloud_configuration_rule_id.clone(), body) diff --git a/examples/v2_security-monitoring_update_security_monitoring_suppression.rs b/examples/v2_security-monitoring_update_security_monitoring_suppression.rs index 2e3a8c4a9..d13b2e5ae 100644 --- a/examples/v2_security-monitoring_update_security_monitoring_suppression.rs +++ b/examples/v2_security-monitoring_update_security_monitoring_suppression.rs @@ -1,6 +1,6 @@ // Update a suppression rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV2::model::SecurityMonitoringSuppressionType; use datadog_api_client::datadogV2::model::SecurityMonitoringSuppressionUpdateAttributes; use datadog_api_client::datadogV2::model::SecurityMonitoringSuppressionUpdateData; @@ -17,7 +17,7 @@ async fn main() { SecurityMonitoringSuppressionType::SUPPRESSIONS, ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api .update_security_monitoring_suppression(suppression_data_id.clone(), body) diff --git a/examples/v2_security-monitoring_validate_security_monitoring_rule.rs b/examples/v2_security-monitoring_validate_security_monitoring_rule.rs index f90b2f57f..47aeb6691 100644 --- a/examples/v2_security-monitoring_validate_security_monitoring_rule.rs +++ b/examples/v2_security-monitoring_validate_security_monitoring_rule.rs @@ -1,6 +1,6 @@ // Validate a detection rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_security_monitoring::SecurityMonitoringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleCaseCreate; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleCreatePayload; use datadog_api_client::datadogV2::model::SecurityMonitoringRuleDetectionMethod; @@ -44,7 +44,7 @@ async fn main() { .tags(vec!["env:prod".to_string(), "team:security".to_string()]) .type_(SecurityMonitoringRuleTypeCreate::LOG_DETECTION), )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SecurityMonitoringAPI::with_config(configuration); let resp = api.validate_security_monitoring_rule(body).await; if let Ok(value) = resp { diff --git a/examples/v2_sensitive-data-scanner_create_scanning_group.rs b/examples/v2_sensitive-data-scanner_create_scanning_group.rs index 789e17d4e..f7b924d54 100644 --- a/examples/v2_sensitive-data-scanner_create_scanning_group.rs +++ b/examples/v2_sensitive-data-scanner_create_scanning_group.rs @@ -1,6 +1,6 @@ // Create Scanning Group returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_sensitive_data_scanner::SensitiveDataScannerAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_sensitive_data_scanner::SensitiveDataScannerAPI; use datadog_api_client::datadogV2::model::SensitiveDataScannerConfiguration; use datadog_api_client::datadogV2::model::SensitiveDataScannerConfigurationData; use datadog_api_client::datadogV2::model::SensitiveDataScannerConfigurationType; @@ -44,7 +44,7 @@ async fn main() { ), ) .meta(SensitiveDataScannerMetaVersionOnly::new()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SensitiveDataScannerAPI::with_config(configuration); let resp = api.create_scanning_group(body).await; if let Ok(value) = resp { diff --git a/examples/v2_sensitive-data-scanner_create_scanning_rule.rs b/examples/v2_sensitive-data-scanner_create_scanning_rule.rs index b40bdc718..e41f1a8b6 100644 --- a/examples/v2_sensitive-data-scanner_create_scanning_rule.rs +++ b/examples/v2_sensitive-data-scanner_create_scanning_rule.rs @@ -1,6 +1,6 @@ // Create Scanning Rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_sensitive_data_scanner::SensitiveDataScannerAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_sensitive_data_scanner::SensitiveDataScannerAPI; use datadog_api_client::datadogV2::model::SensitiveDataScannerGroup; use datadog_api_client::datadogV2::model::SensitiveDataScannerGroupData; use datadog_api_client::datadogV2::model::SensitiveDataScannerGroupType; @@ -49,7 +49,7 @@ async fn main() { ), SensitiveDataScannerMetaVersionOnly::new(), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SensitiveDataScannerAPI::with_config(configuration); let resp = api.create_scanning_rule(body).await; if let Ok(value) = resp { diff --git a/examples/v2_sensitive-data-scanner_delete_scanning_group.rs b/examples/v2_sensitive-data-scanner_delete_scanning_group.rs index 7e58362a7..8fab573a3 100644 --- a/examples/v2_sensitive-data-scanner_delete_scanning_group.rs +++ b/examples/v2_sensitive-data-scanner_delete_scanning_group.rs @@ -1,6 +1,6 @@ // Delete Scanning Group returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_sensitive_data_scanner::SensitiveDataScannerAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_sensitive_data_scanner::SensitiveDataScannerAPI; use datadog_api_client::datadogV2::model::SensitiveDataScannerGroupDeleteRequest; use datadog_api_client::datadogV2::model::SensitiveDataScannerMetaVersionOnly; @@ -10,7 +10,7 @@ async fn main() { let group_data_id = std::env::var("GROUP_DATA_ID").unwrap(); let body = SensitiveDataScannerGroupDeleteRequest::new(SensitiveDataScannerMetaVersionOnly::new()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SensitiveDataScannerAPI::with_config(configuration); let resp = api.delete_scanning_group(group_data_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_sensitive-data-scanner_delete_scanning_rule.rs b/examples/v2_sensitive-data-scanner_delete_scanning_rule.rs index a5c621043..ba91397d7 100644 --- a/examples/v2_sensitive-data-scanner_delete_scanning_rule.rs +++ b/examples/v2_sensitive-data-scanner_delete_scanning_rule.rs @@ -1,6 +1,6 @@ // Delete Scanning Rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_sensitive_data_scanner::SensitiveDataScannerAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_sensitive_data_scanner::SensitiveDataScannerAPI; use datadog_api_client::datadogV2::model::SensitiveDataScannerMetaVersionOnly; use datadog_api_client::datadogV2::model::SensitiveDataScannerRuleDeleteRequest; @@ -10,7 +10,7 @@ async fn main() { let rule_data_id = std::env::var("RULE_DATA_ID").unwrap(); let body = SensitiveDataScannerRuleDeleteRequest::new(SensitiveDataScannerMetaVersionOnly::new()); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SensitiveDataScannerAPI::with_config(configuration); let resp = api.delete_scanning_rule(rule_data_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_sensitive-data-scanner_list_scanning_groups.rs b/examples/v2_sensitive-data-scanner_list_scanning_groups.rs index 7a11dd5d8..dda4de973 100644 --- a/examples/v2_sensitive-data-scanner_list_scanning_groups.rs +++ b/examples/v2_sensitive-data-scanner_list_scanning_groups.rs @@ -1,10 +1,10 @@ // List Scanning Groups returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_sensitive_data_scanner::SensitiveDataScannerAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_sensitive_data_scanner::SensitiveDataScannerAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SensitiveDataScannerAPI::with_config(configuration); let resp = api.list_scanning_groups().await; if let Ok(value) = resp { diff --git a/examples/v2_sensitive-data-scanner_list_standard_patterns.rs b/examples/v2_sensitive-data-scanner_list_standard_patterns.rs index 51089b2f4..0d77d20f2 100644 --- a/examples/v2_sensitive-data-scanner_list_standard_patterns.rs +++ b/examples/v2_sensitive-data-scanner_list_standard_patterns.rs @@ -1,10 +1,10 @@ // List standard patterns returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_sensitive_data_scanner::SensitiveDataScannerAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_sensitive_data_scanner::SensitiveDataScannerAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SensitiveDataScannerAPI::with_config(configuration); let resp = api.list_standard_patterns().await; if let Ok(value) = resp { diff --git a/examples/v2_sensitive-data-scanner_reorder_scanning_groups.rs b/examples/v2_sensitive-data-scanner_reorder_scanning_groups.rs index 97d207277..f2ac3b2d7 100644 --- a/examples/v2_sensitive-data-scanner_reorder_scanning_groups.rs +++ b/examples/v2_sensitive-data-scanner_reorder_scanning_groups.rs @@ -1,6 +1,6 @@ // Reorder Groups returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_sensitive_data_scanner::SensitiveDataScannerAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_sensitive_data_scanner::SensitiveDataScannerAPI; use datadog_api_client::datadogV2::model::SensitiveDataScannerConfigRequest; use datadog_api_client::datadogV2::model::SensitiveDataScannerConfigurationRelationships; use datadog_api_client::datadogV2::model::SensitiveDataScannerConfigurationType; @@ -32,7 +32,7 @@ async fn main() { .type_(SensitiveDataScannerConfigurationType::SENSITIVE_DATA_SCANNER_CONFIGURATIONS), SensitiveDataScannerMetaVersionOnly::new(), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SensitiveDataScannerAPI::with_config(configuration); let resp = api.reorder_scanning_groups(body).await; if let Ok(value) = resp { diff --git a/examples/v2_sensitive-data-scanner_update_scanning_group.rs b/examples/v2_sensitive-data-scanner_update_scanning_group.rs index 500171f83..7d6bc94cb 100644 --- a/examples/v2_sensitive-data-scanner_update_scanning_group.rs +++ b/examples/v2_sensitive-data-scanner_update_scanning_group.rs @@ -1,6 +1,6 @@ // Update Scanning Group returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_sensitive_data_scanner::SensitiveDataScannerAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_sensitive_data_scanner::SensitiveDataScannerAPI; use datadog_api_client::datadogV2::model::SensitiveDataScannerConfiguration; use datadog_api_client::datadogV2::model::SensitiveDataScannerConfigurationData; use datadog_api_client::datadogV2::model::SensitiveDataScannerConfigurationType; @@ -49,7 +49,7 @@ async fn main() { .type_(SensitiveDataScannerGroupType::SENSITIVE_DATA_SCANNER_GROUP), SensitiveDataScannerMetaVersionOnly::new(), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SensitiveDataScannerAPI::with_config(configuration); let resp = api.update_scanning_group(group_data_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_sensitive-data-scanner_update_scanning_rule.rs b/examples/v2_sensitive-data-scanner_update_scanning_rule.rs index b15b632a0..764805ec6 100644 --- a/examples/v2_sensitive-data-scanner_update_scanning_rule.rs +++ b/examples/v2_sensitive-data-scanner_update_scanning_rule.rs @@ -1,6 +1,6 @@ // Update Scanning Rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_sensitive_data_scanner::SensitiveDataScannerAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_sensitive_data_scanner::SensitiveDataScannerAPI; use datadog_api_client::datadogV2::model::SensitiveDataScannerIncludedKeywordConfiguration; use datadog_api_client::datadogV2::model::SensitiveDataScannerMetaVersionOnly; use datadog_api_client::datadogV2::model::SensitiveDataScannerRuleAttributes; @@ -38,7 +38,7 @@ async fn main() { .type_(SensitiveDataScannerRuleType::SENSITIVE_DATA_SCANNER_RULE), SensitiveDataScannerMetaVersionOnly::new(), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SensitiveDataScannerAPI::with_config(configuration); let resp = api.update_scanning_rule(rule_data_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_service-accounts_create_service_account.rs b/examples/v2_service-accounts_create_service_account.rs index a6cc64c87..89692c756 100644 --- a/examples/v2_service-accounts_create_service_account.rs +++ b/examples/v2_service-accounts_create_service_account.rs @@ -1,6 +1,6 @@ // Create a service account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_accounts::ServiceAccountsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_accounts::ServiceAccountsAPI; use datadog_api_client::datadogV2::model::RelationshipToRoleData; use datadog_api_client::datadogV2::model::RelationshipToRoles; use datadog_api_client::datadogV2::model::RolesType; @@ -30,7 +30,7 @@ async fn main() { .type_(RolesType::ROLES)]), )), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceAccountsAPI::with_config(configuration); let resp = api.create_service_account(body).await; if let Ok(value) = resp { diff --git a/examples/v2_service-accounts_create_service_account_application_key.rs b/examples/v2_service-accounts_create_service_account_application_key.rs index efd3ef4c5..d8e740d80 100644 --- a/examples/v2_service-accounts_create_service_account_application_key.rs +++ b/examples/v2_service-accounts_create_service_account_application_key.rs @@ -1,6 +1,6 @@ // Create an application key for this service account returns "Created" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_accounts::ServiceAccountsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_accounts::ServiceAccountsAPI; use datadog_api_client::datadogV2::model::ApplicationKeyCreateAttributes; use datadog_api_client::datadogV2::model::ApplicationKeyCreateData; use datadog_api_client::datadogV2::model::ApplicationKeyCreateRequest; @@ -14,7 +14,7 @@ async fn main() { ApplicationKeyCreateAttributes::new("Example-Service-Account".to_string()), ApplicationKeysType::APPLICATION_KEYS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceAccountsAPI::with_config(configuration); let resp = api .create_service_account_application_key(service_account_user_data_id.clone(), body) diff --git a/examples/v2_service-accounts_create_service_account_application_key_3480494373.rs b/examples/v2_service-accounts_create_service_account_application_key_3480494373.rs index 13cc108bd..f4671ca7b 100644 --- a/examples/v2_service-accounts_create_service_account_application_key_3480494373.rs +++ b/examples/v2_service-accounts_create_service_account_application_key_3480494373.rs @@ -1,7 +1,7 @@ // Create an application key with scopes for this service account returns // "Created" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_accounts::ServiceAccountsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_accounts::ServiceAccountsAPI; use datadog_api_client::datadogV2::model::ApplicationKeyCreateAttributes; use datadog_api_client::datadogV2::model::ApplicationKeyCreateData; use datadog_api_client::datadogV2::model::ApplicationKeyCreateRequest; @@ -21,7 +21,7 @@ async fn main() { )), ApplicationKeysType::APPLICATION_KEYS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceAccountsAPI::with_config(configuration); let resp = api .create_service_account_application_key(service_account_user_data_id.clone(), body) diff --git a/examples/v2_service-accounts_delete_service_account_application_key.rs b/examples/v2_service-accounts_delete_service_account_application_key.rs index 6859eafe1..9ccf288d4 100644 --- a/examples/v2_service-accounts_delete_service_account_application_key.rs +++ b/examples/v2_service-accounts_delete_service_account_application_key.rs @@ -1,6 +1,6 @@ // Delete an application key for this service account returns "No Content" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_accounts::ServiceAccountsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_accounts::ServiceAccountsAPI; #[tokio::main] async fn main() { @@ -10,7 +10,7 @@ async fn main() { // there is a valid "service_account_application_key" for "service_account_user" let service_account_application_key_data_id = std::env::var("SERVICE_ACCOUNT_APPLICATION_KEY_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceAccountsAPI::with_config(configuration); let resp = api .delete_service_account_application_key( diff --git a/examples/v2_service-accounts_get_service_account_application_key.rs b/examples/v2_service-accounts_get_service_account_application_key.rs index 6dc391c9c..007565a83 100644 --- a/examples/v2_service-accounts_get_service_account_application_key.rs +++ b/examples/v2_service-accounts_get_service_account_application_key.rs @@ -1,6 +1,6 @@ // Get one application key for this service account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_accounts::ServiceAccountsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_accounts::ServiceAccountsAPI; #[tokio::main] async fn main() { @@ -10,7 +10,7 @@ async fn main() { // there is a valid "service_account_application_key" for "service_account_user" let service_account_application_key_data_id = std::env::var("SERVICE_ACCOUNT_APPLICATION_KEY_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceAccountsAPI::with_config(configuration); let resp = api .get_service_account_application_key( diff --git a/examples/v2_service-accounts_list_service_account_application_keys.rs b/examples/v2_service-accounts_list_service_account_application_keys.rs index 26f41b55d..8dd1a23eb 100644 --- a/examples/v2_service-accounts_list_service_account_application_keys.rs +++ b/examples/v2_service-accounts_list_service_account_application_keys.rs @@ -1,13 +1,13 @@ // List application keys for this service account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_accounts::ListServiceAccountApplicationKeysOptionalParams; -use datadog_api_client::datadogV2::api::api_service_accounts::ServiceAccountsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_accounts::ListServiceAccountApplicationKeysOptionalParams; +use datadog_api_client::datadogV2::api_service_accounts::ServiceAccountsAPI; #[tokio::main] async fn main() { // there is a valid "service_account_user" in the system let service_account_user_data_id = std::env::var("SERVICE_ACCOUNT_USER_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceAccountsAPI::with_config(configuration); let resp = api .list_service_account_application_keys( diff --git a/examples/v2_service-accounts_update_service_account_application_key.rs b/examples/v2_service-accounts_update_service_account_application_key.rs index bfcd737ef..a8e294dfa 100644 --- a/examples/v2_service-accounts_update_service_account_application_key.rs +++ b/examples/v2_service-accounts_update_service_account_application_key.rs @@ -1,6 +1,6 @@ // Edit an application key for this service account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_accounts::ServiceAccountsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_accounts::ServiceAccountsAPI; use datadog_api_client::datadogV2::model::ApplicationKeyUpdateAttributes; use datadog_api_client::datadogV2::model::ApplicationKeyUpdateData; use datadog_api_client::datadogV2::model::ApplicationKeyUpdateRequest; @@ -20,7 +20,7 @@ async fn main() { service_account_application_key_data_id.clone(), ApplicationKeysType::APPLICATION_KEYS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceAccountsAPI::with_config(configuration); let resp = api .update_service_account_application_key( diff --git a/examples/v2_service-definition_create_or_update_service_definitions.rs b/examples/v2_service-definition_create_or_update_service_definitions.rs index a526f87c7..4746142dc 100644 --- a/examples/v2_service-definition_create_or_update_service_definitions.rs +++ b/examples/v2_service-definition_create_or_update_service_definitions.rs @@ -1,6 +1,6 @@ // Create or update service definition returns "CREATED" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_definition::ServiceDefinitionAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_definition::ServiceDefinitionAPI; use datadog_api_client::datadogV2::model::ServiceDefinitionV2Dot2; use datadog_api_client::datadogV2::model::ServiceDefinitionV2Dot2Contact; use datadog_api_client::datadogV2::model::ServiceDefinitionV2Dot2Integrations; @@ -68,7 +68,7 @@ async fn main() { .tier("High".to_string()) .type_(ServiceDefinitionV2Dot2Type::WEB), )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceDefinitionAPI::with_config(configuration); let resp = api.create_or_update_service_definitions(body).await; if let Ok(value) = resp { diff --git a/examples/v2_service-definition_create_or_update_service_definitions_1808735248.rs b/examples/v2_service-definition_create_or_update_service_definitions_1808735248.rs index b10750b1c..24dd6ea5a 100644 --- a/examples/v2_service-definition_create_or_update_service_definitions_1808735248.rs +++ b/examples/v2_service-definition_create_or_update_service_definitions_1808735248.rs @@ -1,6 +1,6 @@ // Create or update service definition using schema v2 returns "CREATED" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_definition::ServiceDefinitionAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_definition::ServiceDefinitionAPI; use datadog_api_client::datadogV2::model::ServiceDefinitionV2; use datadog_api_client::datadogV2::model::ServiceDefinitionV2Contact; use datadog_api_client::datadogV2::model::ServiceDefinitionV2Doc; @@ -67,7 +67,7 @@ async fn main() { .tags(vec!["my:tag".to_string(), "service:tag".to_string()]) .team("my-team".to_string()), )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceDefinitionAPI::with_config(configuration); let resp = api.create_or_update_service_definitions(body).await; if let Ok(value) = resp { diff --git a/examples/v2_service-definition_create_or_update_service_definitions_2619874414.rs b/examples/v2_service-definition_create_or_update_service_definitions_2619874414.rs index e1ce3ee27..66474a111 100644 --- a/examples/v2_service-definition_create_or_update_service_definitions_2619874414.rs +++ b/examples/v2_service-definition_create_or_update_service_definitions_2619874414.rs @@ -1,6 +1,6 @@ // Create or update service definition using schema v2-1 returns "CREATED" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_definition::ServiceDefinitionAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_definition::ServiceDefinitionAPI; use datadog_api_client::datadogV2::model::ServiceDefinitionV2Dot1; use datadog_api_client::datadogV2::model::ServiceDefinitionV2Dot1Contact; use datadog_api_client::datadogV2::model::ServiceDefinitionV2Dot1Email; @@ -71,7 +71,7 @@ async fn main() { .tags(vec!["my:tag".to_string(), "service:tag".to_string()]) .team("my-team".to_string()), )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceDefinitionAPI::with_config(configuration); let resp = api.create_or_update_service_definitions(body).await; if let Ok(value) = resp { diff --git a/examples/v2_service-definition_create_or_update_service_definitions_2621709423.rs b/examples/v2_service-definition_create_or_update_service_definitions_2621709423.rs index f2fa3ab1f..b083b4b14 100644 --- a/examples/v2_service-definition_create_or_update_service_definitions_2621709423.rs +++ b/examples/v2_service-definition_create_or_update_service_definitions_2621709423.rs @@ -1,6 +1,6 @@ // Create or update service definition using schema v2-2 returns "CREATED" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_definition::ServiceDefinitionAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_definition::ServiceDefinitionAPI; use datadog_api_client::datadogV2::model::ServiceDefinitionV2Dot2; use datadog_api_client::datadogV2::model::ServiceDefinitionV2Dot2Contact; use datadog_api_client::datadogV2::model::ServiceDefinitionV2Dot2Integrations; @@ -64,7 +64,7 @@ async fn main() { .tags(vec!["my:tag".to_string(), "service:tag".to_string()]) .team("my-team".to_string()), )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceDefinitionAPI::with_config(configuration); let resp = api.create_or_update_service_definitions(body).await; if let Ok(value) = resp { diff --git a/examples/v2_service-definition_delete_service_definition.rs b/examples/v2_service-definition_delete_service_definition.rs index 20e9efec9..ed33980d0 100644 --- a/examples/v2_service-definition_delete_service_definition.rs +++ b/examples/v2_service-definition_delete_service_definition.rs @@ -1,10 +1,10 @@ // Delete a single service definition returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_definition::ServiceDefinitionAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_definition::ServiceDefinitionAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceDefinitionAPI::with_config(configuration); let resp = api .delete_service_definition("service-definition-test".to_string()) diff --git a/examples/v2_service-definition_get_service_definition.rs b/examples/v2_service-definition_get_service_definition.rs index 38765bcdd..bca5b35ad 100644 --- a/examples/v2_service-definition_get_service_definition.rs +++ b/examples/v2_service-definition_get_service_definition.rs @@ -1,12 +1,12 @@ // Get a single service definition returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_definition::GetServiceDefinitionOptionalParams; -use datadog_api_client::datadogV2::api::api_service_definition::ServiceDefinitionAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_definition::GetServiceDefinitionOptionalParams; +use datadog_api_client::datadogV2::api_service_definition::ServiceDefinitionAPI; use datadog_api_client::datadogV2::model::ServiceDefinitionSchemaVersions; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceDefinitionAPI::with_config(configuration); let resp = api .get_service_definition( diff --git a/examples/v2_service-definition_list_service_definitions.rs b/examples/v2_service-definition_list_service_definitions.rs index 72c34b999..26a352de9 100644 --- a/examples/v2_service-definition_list_service_definitions.rs +++ b/examples/v2_service-definition_list_service_definitions.rs @@ -1,12 +1,12 @@ // Get all service definitions returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_definition::ListServiceDefinitionsOptionalParams; -use datadog_api_client::datadogV2::api::api_service_definition::ServiceDefinitionAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_definition::ListServiceDefinitionsOptionalParams; +use datadog_api_client::datadogV2::api_service_definition::ServiceDefinitionAPI; use datadog_api_client::datadogV2::model::ServiceDefinitionSchemaVersions; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceDefinitionAPI::with_config(configuration); let resp = api .list_service_definitions( diff --git a/examples/v2_service-definition_list_service_definitions_336468013.rs b/examples/v2_service-definition_list_service_definitions_336468013.rs index b9b35e8a4..b2e67753b 100644 --- a/examples/v2_service-definition_list_service_definitions_336468013.rs +++ b/examples/v2_service-definition_list_service_definitions_336468013.rs @@ -1,13 +1,13 @@ // Get all service definitions returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_definition::ListServiceDefinitionsOptionalParams; -use datadog_api_client::datadogV2::api::api_service_definition::ServiceDefinitionAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_definition::ListServiceDefinitionsOptionalParams; +use datadog_api_client::datadogV2::api_service_definition::ServiceDefinitionAPI; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = ServiceDefinitionAPI::with_config(configuration); let response = api.list_service_definitions_with_pagination( ListServiceDefinitionsOptionalParams::default().page_size(2), diff --git a/examples/v2_service-scorecards_create_scorecard_outcomes_batch.rs b/examples/v2_service-scorecards_create_scorecard_outcomes_batch.rs index 813f5b7ac..388d9c6af 100644 --- a/examples/v2_service-scorecards_create_scorecard_outcomes_batch.rs +++ b/examples/v2_service-scorecards_create_scorecard_outcomes_batch.rs @@ -1,6 +1,6 @@ // Create outcomes batch returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_scorecards::ServiceScorecardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_scorecards::ServiceScorecardsAPI; use datadog_api_client::datadogV2::model::OutcomesBatchAttributes; use datadog_api_client::datadogV2::model::OutcomesBatchRequest; use datadog_api_client::datadogV2::model::OutcomesBatchRequestData; @@ -26,7 +26,7 @@ async fn main() { ) .type_(OutcomesBatchType::BATCHED_OUTCOME), ); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.CreateScorecardOutcomesBatch", true); let api = ServiceScorecardsAPI::with_config(configuration); let resp = api.create_scorecard_outcomes_batch(body).await; diff --git a/examples/v2_service-scorecards_create_scorecard_rule.rs b/examples/v2_service-scorecards_create_scorecard_rule.rs index 658c20fb7..5462f40a9 100644 --- a/examples/v2_service-scorecards_create_scorecard_rule.rs +++ b/examples/v2_service-scorecards_create_scorecard_rule.rs @@ -1,6 +1,6 @@ // Create a new rule returns "Created" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_scorecards::ServiceScorecardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_scorecards::ServiceScorecardsAPI; use datadog_api_client::datadogV2::model::CreateRuleRequest; use datadog_api_client::datadogV2::model::CreateRuleRequestData; use datadog_api_client::datadogV2::model::RuleAttributes; @@ -18,7 +18,7 @@ async fn main() { ) .type_(RuleType::RULE), ); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.CreateScorecardRule", true); let api = ServiceScorecardsAPI::with_config(configuration); let resp = api.create_scorecard_rule(body).await; diff --git a/examples/v2_service-scorecards_delete_scorecard_rule.rs b/examples/v2_service-scorecards_delete_scorecard_rule.rs index 8b6063abc..14684437f 100644 --- a/examples/v2_service-scorecards_delete_scorecard_rule.rs +++ b/examples/v2_service-scorecards_delete_scorecard_rule.rs @@ -1,12 +1,12 @@ // Delete a rule returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_scorecards::ServiceScorecardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_scorecards::ServiceScorecardsAPI; #[tokio::main] async fn main() { // there is a valid "create_scorecard_rule" in the system let create_scorecard_rule_data_id = std::env::var("CREATE_SCORECARD_RULE_DATA_ID").unwrap(); - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.DeleteScorecardRule", true); let api = ServiceScorecardsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_service-scorecards_list_scorecard_outcomes.rs b/examples/v2_service-scorecards_list_scorecard_outcomes.rs index 66691654e..fd77cd529 100644 --- a/examples/v2_service-scorecards_list_scorecard_outcomes.rs +++ b/examples/v2_service-scorecards_list_scorecard_outcomes.rs @@ -1,11 +1,11 @@ // List all rule outcomes returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_scorecards::ListScorecardOutcomesOptionalParams; -use datadog_api_client::datadogV2::api::api_service_scorecards::ServiceScorecardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_scorecards::ListScorecardOutcomesOptionalParams; +use datadog_api_client::datadogV2::api_service_scorecards::ServiceScorecardsAPI; #[tokio::main] async fn main() { - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.ListScorecardOutcomes", true); let api = ServiceScorecardsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_service-scorecards_list_scorecard_outcomes_2663454275.rs b/examples/v2_service-scorecards_list_scorecard_outcomes_2663454275.rs index c2cb5e717..10b402ce7 100644 --- a/examples/v2_service-scorecards_list_scorecard_outcomes_2663454275.rs +++ b/examples/v2_service-scorecards_list_scorecard_outcomes_2663454275.rs @@ -1,13 +1,13 @@ // List all rule outcomes returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_scorecards::ListScorecardOutcomesOptionalParams; -use datadog_api_client::datadogV2::api::api_service_scorecards::ServiceScorecardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_scorecards::ListScorecardOutcomesOptionalParams; +use datadog_api_client::datadogV2::api_service_scorecards::ServiceScorecardsAPI; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.ListScorecardOutcomes", true); let api = ServiceScorecardsAPI::with_config(configuration); let response = api.list_scorecard_outcomes_with_pagination( diff --git a/examples/v2_service-scorecards_list_scorecard_rules.rs b/examples/v2_service-scorecards_list_scorecard_rules.rs index 92eb5a98b..d7f389a1e 100644 --- a/examples/v2_service-scorecards_list_scorecard_rules.rs +++ b/examples/v2_service-scorecards_list_scorecard_rules.rs @@ -1,11 +1,11 @@ // List all rules returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_scorecards::ListScorecardRulesOptionalParams; -use datadog_api_client::datadogV2::api::api_service_scorecards::ServiceScorecardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_scorecards::ListScorecardRulesOptionalParams; +use datadog_api_client::datadogV2::api_service_scorecards::ServiceScorecardsAPI; #[tokio::main] async fn main() { - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.ListScorecardRules", true); let api = ServiceScorecardsAPI::with_config(configuration); let resp = api diff --git a/examples/v2_service-scorecards_list_scorecard_rules_4057666343.rs b/examples/v2_service-scorecards_list_scorecard_rules_4057666343.rs index 1c88fee66..cf891a310 100644 --- a/examples/v2_service-scorecards_list_scorecard_rules_4057666343.rs +++ b/examples/v2_service-scorecards_list_scorecard_rules_4057666343.rs @@ -1,13 +1,13 @@ // List all rules returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_service_scorecards::ListScorecardRulesOptionalParams; -use datadog_api_client::datadogV2::api::api_service_scorecards::ServiceScorecardsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_service_scorecards::ListScorecardRulesOptionalParams; +use datadog_api_client::datadogV2::api_service_scorecards::ServiceScorecardsAPI; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.ListScorecardRules", true); let api = ServiceScorecardsAPI::with_config(configuration); let response = api.list_scorecard_rules_with_pagination( diff --git a/examples/v2_spans-metrics_create_spans_metric.rs b/examples/v2_spans-metrics_create_spans_metric.rs index 98a728d5a..c4a0d165e 100644 --- a/examples/v2_spans-metrics_create_spans_metric.rs +++ b/examples/v2_spans-metrics_create_spans_metric.rs @@ -1,6 +1,6 @@ // Create a span-based metric returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_spans_metrics::SpansMetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_spans_metrics::SpansMetricsAPI; use datadog_api_client::datadogV2::model::SpansMetricCompute; use datadog_api_client::datadogV2::model::SpansMetricComputeAggregationType; use datadog_api_client::datadogV2::model::SpansMetricCreateAttributes; @@ -26,7 +26,7 @@ async fn main() { "ExampleSpansMetric".to_string(), SpansMetricType::SPANS_METRICS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SpansMetricsAPI::with_config(configuration); let resp = api.create_spans_metric(body).await; if let Ok(value) = resp { diff --git a/examples/v2_spans-metrics_delete_spans_metric.rs b/examples/v2_spans-metrics_delete_spans_metric.rs index 8d9e35ef7..5928c15b2 100644 --- a/examples/v2_spans-metrics_delete_spans_metric.rs +++ b/examples/v2_spans-metrics_delete_spans_metric.rs @@ -1,12 +1,12 @@ // Delete a span-based metric returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_spans_metrics::SpansMetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_spans_metrics::SpansMetricsAPI; #[tokio::main] async fn main() { // there is a valid "spans_metric" in the system let spans_metric_data_id = std::env::var("SPANS_METRIC_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SpansMetricsAPI::with_config(configuration); let resp = api.delete_spans_metric(spans_metric_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_spans-metrics_get_spans_metric.rs b/examples/v2_spans-metrics_get_spans_metric.rs index 0ff4e8ccf..46745aacf 100644 --- a/examples/v2_spans-metrics_get_spans_metric.rs +++ b/examples/v2_spans-metrics_get_spans_metric.rs @@ -1,12 +1,12 @@ // Get a span-based metric returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_spans_metrics::SpansMetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_spans_metrics::SpansMetricsAPI; #[tokio::main] async fn main() { // there is a valid "spans_metric" in the system let spans_metric_data_id = std::env::var("SPANS_METRIC_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SpansMetricsAPI::with_config(configuration); let resp = api.get_spans_metric(spans_metric_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_spans-metrics_list_spans_metrics.rs b/examples/v2_spans-metrics_list_spans_metrics.rs index 3f7306ff7..e23165800 100644 --- a/examples/v2_spans-metrics_list_spans_metrics.rs +++ b/examples/v2_spans-metrics_list_spans_metrics.rs @@ -1,10 +1,10 @@ // Get all span-based metrics returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_spans_metrics::SpansMetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_spans_metrics::SpansMetricsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SpansMetricsAPI::with_config(configuration); let resp = api.list_spans_metrics().await; if let Ok(value) = resp { diff --git a/examples/v2_spans-metrics_update_spans_metric.rs b/examples/v2_spans-metrics_update_spans_metric.rs index 4472eebc9..2392eb5ff 100644 --- a/examples/v2_spans-metrics_update_spans_metric.rs +++ b/examples/v2_spans-metrics_update_spans_metric.rs @@ -1,6 +1,6 @@ // Update a span-based metric returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_spans_metrics::SpansMetricsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_spans_metrics::SpansMetricsAPI; use datadog_api_client::datadogV2::model::SpansMetricFilter; use datadog_api_client::datadogV2::model::SpansMetricGroupBy; use datadog_api_client::datadogV2::model::SpansMetricType; @@ -24,7 +24,7 @@ async fn main() { .tag_name("resource_name".to_string())]), SpansMetricType::SPANS_METRICS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SpansMetricsAPI::with_config(configuration); let resp = api .update_spans_metric(spans_metric_data_id.clone(), body) diff --git a/examples/v2_spans_aggregate_spans.rs b/examples/v2_spans_aggregate_spans.rs index b546313f8..203d6393c 100644 --- a/examples/v2_spans_aggregate_spans.rs +++ b/examples/v2_spans_aggregate_spans.rs @@ -1,6 +1,6 @@ // Aggregate spans returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_spans::SpansAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_spans::SpansAPI; use datadog_api_client::datadogV2::model::SpansAggregateData; use datadog_api_client::datadogV2::model::SpansAggregateRequest; use datadog_api_client::datadogV2::model::SpansAggregateRequestAttributes; @@ -28,7 +28,7 @@ async fn main() { ) .type_(SpansAggregateRequestType::AGGREGATE_REQUEST), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SpansAPI::with_config(configuration); let resp = api.aggregate_spans(body).await; if let Ok(value) = resp { diff --git a/examples/v2_spans_list_spans.rs b/examples/v2_spans_list_spans.rs index 6547af6e4..faba72436 100644 --- a/examples/v2_spans_list_spans.rs +++ b/examples/v2_spans_list_spans.rs @@ -1,6 +1,6 @@ // Search spans returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_spans::SpansAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_spans::SpansAPI; use datadog_api_client::datadogV2::model::SpansListRequest; use datadog_api_client::datadogV2::model::SpansListRequestAttributes; use datadog_api_client::datadogV2::model::SpansListRequestData; @@ -28,7 +28,7 @@ async fn main() { ) .type_(SpansListRequestType::SEARCH_REQUEST), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SpansAPI::with_config(configuration); let resp = api.list_spans(body).await; if let Ok(value) = resp { diff --git a/examples/v2_spans_list_spans_3495563906.rs b/examples/v2_spans_list_spans_3495563906.rs index f2b64c4dd..c8a220244 100644 --- a/examples/v2_spans_list_spans_3495563906.rs +++ b/examples/v2_spans_list_spans_3495563906.rs @@ -1,6 +1,6 @@ // Search spans returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_spans::SpansAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_spans::SpansAPI; use datadog_api_client::datadogV2::model::SpansListRequest; use datadog_api_client::datadogV2::model::SpansListRequestAttributes; use datadog_api_client::datadogV2::model::SpansListRequestData; @@ -30,7 +30,7 @@ async fn main() { ) .type_(SpansListRequestType::SEARCH_REQUEST), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SpansAPI::with_config(configuration); let response = api.list_spans_with_pagination(body); pin_mut!(response); diff --git a/examples/v2_spans_list_spans_get.rs b/examples/v2_spans_list_spans_get.rs index a6685b53f..7cd25664e 100644 --- a/examples/v2_spans_list_spans_get.rs +++ b/examples/v2_spans_list_spans_get.rs @@ -1,11 +1,11 @@ // Get a list of spans returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_spans::ListSpansGetOptionalParams; -use datadog_api_client::datadogV2::api::api_spans::SpansAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_spans::ListSpansGetOptionalParams; +use datadog_api_client::datadogV2::api_spans::SpansAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SpansAPI::with_config(configuration); let resp = api .list_spans_get(ListSpansGetOptionalParams::default()) diff --git a/examples/v2_spans_list_spans_get_1130763422.rs b/examples/v2_spans_list_spans_get_1130763422.rs index d783db85f..6a149d96a 100644 --- a/examples/v2_spans_list_spans_get_1130763422.rs +++ b/examples/v2_spans_list_spans_get_1130763422.rs @@ -1,13 +1,13 @@ // Get a list of spans returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_spans::ListSpansGetOptionalParams; -use datadog_api_client::datadogV2::api::api_spans::SpansAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_spans::ListSpansGetOptionalParams; +use datadog_api_client::datadogV2::api_spans::SpansAPI; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SpansAPI::with_config(configuration); let response = api.list_spans_get_with_pagination(ListSpansGetOptionalParams::default().page_limit(2)); diff --git a/examples/v2_synthetics_get_on_demand_concurrency_cap.rs b/examples/v2_synthetics_get_on_demand_concurrency_cap.rs index fd9e73f36..e22abbe47 100644 --- a/examples/v2_synthetics_get_on_demand_concurrency_cap.rs +++ b/examples/v2_synthetics_get_on_demand_concurrency_cap.rs @@ -1,10 +1,10 @@ // Get the on-demand concurrency cap returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_synthetics::SyntheticsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.get_on_demand_concurrency_cap().await; if let Ok(value) = resp { diff --git a/examples/v2_synthetics_set_on_demand_concurrency_cap.rs b/examples/v2_synthetics_set_on_demand_concurrency_cap.rs index 6f9f4ba2d..417255558 100644 --- a/examples/v2_synthetics_set_on_demand_concurrency_cap.rs +++ b/examples/v2_synthetics_set_on_demand_concurrency_cap.rs @@ -1,12 +1,12 @@ // Save new value for on-demand concurrency cap returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_synthetics::SyntheticsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_synthetics::SyntheticsAPI; use datadog_api_client::datadogV2::model::OnDemandConcurrencyCapAttributes; #[tokio::main] async fn main() { let body = OnDemandConcurrencyCapAttributes::new().on_demand_concurrency_cap(20.0 as f64); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = SyntheticsAPI::with_config(configuration); let resp = api.set_on_demand_concurrency_cap(body).await; if let Ok(value) = resp { diff --git a/examples/v2_teams_create_team.rs b/examples/v2_teams_create_team.rs index 8426ae975..7d6d4ae7a 100644 --- a/examples/v2_teams_create_team.rs +++ b/examples/v2_teams_create_team.rs @@ -1,6 +1,6 @@ // Create a team returns "CREATED" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; use datadog_api_client::datadogV2::model::RelationshipToUsers; use datadog_api_client::datadogV2::model::TeamCreate; use datadog_api_client::datadogV2::model::TeamCreateAttributes; @@ -20,7 +20,7 @@ async fn main() { ) .relationships(TeamCreateRelationships::new().users(RelationshipToUsers::new(vec![]))), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let resp = api.create_team(body).await; if let Ok(value) = resp { diff --git a/examples/v2_teams_create_team_252121814.rs b/examples/v2_teams_create_team_252121814.rs index c1740eb6b..9ae2168fc 100644 --- a/examples/v2_teams_create_team_252121814.rs +++ b/examples/v2_teams_create_team_252121814.rs @@ -1,6 +1,6 @@ // Create a team with V2 fields returns "CREATED" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; use datadog_api_client::datadogV2::model::TeamCreate; use datadog_api_client::datadogV2::model::TeamCreateAttributes; use datadog_api_client::datadogV2::model::TeamCreateRequest; @@ -19,7 +19,7 @@ async fn main() { .visible_modules(vec!["m1".to_string(), "m2".to_string()]), TeamType::TEAM, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let resp = api.create_team(body).await; if let Ok(value) = resp { diff --git a/examples/v2_teams_create_team_link.rs b/examples/v2_teams_create_team_link.rs index 4d3cdfdd7..ce9e1f446 100644 --- a/examples/v2_teams_create_team_link.rs +++ b/examples/v2_teams_create_team_link.rs @@ -1,6 +1,6 @@ // Create a team link returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; use datadog_api_client::datadogV2::model::TeamLinkAttributes; use datadog_api_client::datadogV2::model::TeamLinkCreate; use datadog_api_client::datadogV2::model::TeamLinkCreateRequest; @@ -15,7 +15,7 @@ async fn main() { .position(0), TeamLinkType::TEAM_LINKS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let resp = api.create_team_link(dd_team_data_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_teams_create_team_membership.rs b/examples/v2_teams_create_team_membership.rs index 6f402fa73..f21f33d1b 100644 --- a/examples/v2_teams_create_team_membership.rs +++ b/examples/v2_teams_create_team_membership.rs @@ -1,7 +1,7 @@ // Add a user to a team returns "Represents a user's association to a team" // response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; use datadog_api_client::datadogV2::model::RelationshipToUserTeamTeam; use datadog_api_client::datadogV2::model::RelationshipToUserTeamTeamData; use datadog_api_client::datadogV2::model::RelationshipToUserTeamUser; @@ -36,7 +36,7 @@ async fn main() { )), ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let resp = api .create_team_membership("team_id".to_string(), body) diff --git a/examples/v2_teams_delete_team.rs b/examples/v2_teams_delete_team.rs index c2dcaaae7..20cf49513 100644 --- a/examples/v2_teams_delete_team.rs +++ b/examples/v2_teams_delete_team.rs @@ -1,12 +1,12 @@ // Remove a team returns "No Content" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; #[tokio::main] async fn main() { // there is a valid "dd_team" in the system let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let resp = api.delete_team(dd_team_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_teams_delete_team_link.rs b/examples/v2_teams_delete_team_link.rs index cdeaec404..74c3825d6 100644 --- a/examples/v2_teams_delete_team_link.rs +++ b/examples/v2_teams_delete_team_link.rs @@ -1,6 +1,6 @@ // Remove a team link returns "No Content" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; #[tokio::main] async fn main() { @@ -9,7 +9,7 @@ async fn main() { // there is a valid "team_link" in the system let team_link_data_id = std::env::var("TEAM_LINK_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let resp = api .delete_team_link(dd_team_data_id.clone(), team_link_data_id.clone()) diff --git a/examples/v2_teams_delete_team_membership.rs b/examples/v2_teams_delete_team_membership.rs index e7027fd8a..f7755f6aa 100644 --- a/examples/v2_teams_delete_team_membership.rs +++ b/examples/v2_teams_delete_team_membership.rs @@ -1,12 +1,12 @@ // Remove a user from a team returns "No Content" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; #[tokio::main] async fn main() { // there is a valid "dd_team" in the system let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let resp = api .delete_team_membership(dd_team_data_id.clone(), "user_id".to_string()) diff --git a/examples/v2_teams_get_team.rs b/examples/v2_teams_get_team.rs index 983b9b51f..6221db915 100644 --- a/examples/v2_teams_get_team.rs +++ b/examples/v2_teams_get_team.rs @@ -1,12 +1,12 @@ // Get a team returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; #[tokio::main] async fn main() { // there is a valid "dd_team" in the system let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let resp = api.get_team(dd_team_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_teams_get_team_link.rs b/examples/v2_teams_get_team_link.rs index 0636063a5..6b4c08faa 100644 --- a/examples/v2_teams_get_team_link.rs +++ b/examples/v2_teams_get_team_link.rs @@ -1,6 +1,6 @@ // Get a team link returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; #[tokio::main] async fn main() { @@ -9,7 +9,7 @@ async fn main() { // there is a valid "team_link" in the system let team_link_data_id = std::env::var("TEAM_LINK_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let resp = api .get_team_link(dd_team_data_id.clone(), team_link_data_id.clone()) diff --git a/examples/v2_teams_get_team_links.rs b/examples/v2_teams_get_team_links.rs index c6cf05961..9ce22acae 100644 --- a/examples/v2_teams_get_team_links.rs +++ b/examples/v2_teams_get_team_links.rs @@ -1,12 +1,12 @@ // Get links for a team returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; #[tokio::main] async fn main() { // there is a valid "dd_team" in the system let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let resp = api.get_team_links(dd_team_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_teams_get_team_memberships.rs b/examples/v2_teams_get_team_memberships.rs index 2ff10eb73..62aa07e9a 100644 --- a/examples/v2_teams_get_team_memberships.rs +++ b/examples/v2_teams_get_team_memberships.rs @@ -1,14 +1,14 @@ // Get team memberships returns "Represents a user's association to a team" // response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::GetTeamMembershipsOptionalParams; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::GetTeamMembershipsOptionalParams; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; #[tokio::main] async fn main() { // there is a valid "dd_team" in the system let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let resp = api .get_team_memberships( diff --git a/examples/v2_teams_get_team_memberships_3799131168.rs b/examples/v2_teams_get_team_memberships_3799131168.rs index 6b1d9fd26..201a91607 100644 --- a/examples/v2_teams_get_team_memberships_3799131168.rs +++ b/examples/v2_teams_get_team_memberships_3799131168.rs @@ -1,14 +1,14 @@ // Get team memberships returns "Represents a user's association to a team" // response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::GetTeamMembershipsOptionalParams; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::GetTeamMembershipsOptionalParams; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let response = api.get_team_memberships_with_pagination( "2e06bf2c-193b-41d4-b3c2-afccc080458f".to_string(), diff --git a/examples/v2_teams_get_team_permission_settings.rs b/examples/v2_teams_get_team_permission_settings.rs index ab699caee..9ae28b6eb 100644 --- a/examples/v2_teams_get_team_permission_settings.rs +++ b/examples/v2_teams_get_team_permission_settings.rs @@ -1,12 +1,12 @@ // Get permission settings for a team returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; #[tokio::main] async fn main() { // there is a valid "dd_team" in the system let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let resp = api .get_team_permission_settings(dd_team_data_id.clone()) diff --git a/examples/v2_teams_get_user_memberships.rs b/examples/v2_teams_get_user_memberships.rs index c8d0f4a1b..752cfff75 100644 --- a/examples/v2_teams_get_user_memberships.rs +++ b/examples/v2_teams_get_user_memberships.rs @@ -1,13 +1,13 @@ // Get user memberships returns "Represents a user's association to a team" // response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; #[tokio::main] async fn main() { // there is a valid "user" in the system let user_data_id = std::env::var("USER_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let resp = api.get_user_memberships(user_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_teams_list_teams.rs b/examples/v2_teams_list_teams.rs index f48751b12..67e2804ef 100644 --- a/examples/v2_teams_list_teams.rs +++ b/examples/v2_teams_list_teams.rs @@ -1,11 +1,11 @@ // Get all teams returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::ListTeamsOptionalParams; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::ListTeamsOptionalParams; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let resp = api.list_teams(ListTeamsOptionalParams::default()).await; if let Ok(value) = resp { diff --git a/examples/v2_teams_list_teams_3429963470.rs b/examples/v2_teams_list_teams_3429963470.rs index 2674b255f..423c2e58d 100644 --- a/examples/v2_teams_list_teams_3429963470.rs +++ b/examples/v2_teams_list_teams_3429963470.rs @@ -1,12 +1,12 @@ // Get all teams with fields_team parameter returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::ListTeamsOptionalParams; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::ListTeamsOptionalParams; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; use datadog_api_client::datadogV2::model::TeamsField; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let resp = api .list_teams(ListTeamsOptionalParams::default().fields_team(vec![ diff --git a/examples/v2_teams_list_teams_3592098458.rs b/examples/v2_teams_list_teams_3592098458.rs index 1b708a314..a94da444a 100644 --- a/examples/v2_teams_list_teams_3592098458.rs +++ b/examples/v2_teams_list_teams_3592098458.rs @@ -1,13 +1,13 @@ // Get all teams returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::ListTeamsOptionalParams; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::ListTeamsOptionalParams; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let response = api.list_teams_with_pagination(ListTeamsOptionalParams::default().page_size(2)); pin_mut!(response); diff --git a/examples/v2_teams_update_team.rs b/examples/v2_teams_update_team.rs index f62d3887a..e0190bc23 100644 --- a/examples/v2_teams_update_team.rs +++ b/examples/v2_teams_update_team.rs @@ -1,6 +1,6 @@ // Update a team returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; use datadog_api_client::datadogV2::model::TeamType; use datadog_api_client::datadogV2::model::TeamUpdate; use datadog_api_client::datadogV2::model::TeamUpdateAttributes; @@ -22,7 +22,7 @@ async fn main() { .visible_modules(vec!["m1".to_string(), "m2".to_string()]), TeamType::TEAM, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let resp = api.update_team(dd_team_data_id.clone(), body).await; if let Ok(value) = resp { diff --git a/examples/v2_teams_update_team_link.rs b/examples/v2_teams_update_team_link.rs index a2aa6455e..76faf78df 100644 --- a/examples/v2_teams_update_team_link.rs +++ b/examples/v2_teams_update_team_link.rs @@ -1,6 +1,6 @@ // Update a team link returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; use datadog_api_client::datadogV2::model::TeamLinkAttributes; use datadog_api_client::datadogV2::model::TeamLinkCreate; use datadog_api_client::datadogV2::model::TeamLinkCreateRequest; @@ -17,7 +17,7 @@ async fn main() { TeamLinkAttributes::new("New Label".to_string(), "https://example.com".to_string()), TeamLinkType::TEAM_LINKS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let resp = api .update_team_link(dd_team_data_id.clone(), team_link_data_id.clone(), body) diff --git a/examples/v2_teams_update_team_membership.rs b/examples/v2_teams_update_team_membership.rs index 6eb44df17..9ea41dbd6 100644 --- a/examples/v2_teams_update_team_membership.rs +++ b/examples/v2_teams_update_team_membership.rs @@ -1,7 +1,7 @@ // Update a user's membership attributes on a team returns "Represents a user's // association to a team" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; use datadog_api_client::datadogV2::model::UserTeamAttributes; use datadog_api_client::datadogV2::model::UserTeamRole; use datadog_api_client::datadogV2::model::UserTeamType; @@ -14,7 +14,7 @@ async fn main() { UserTeamUpdate::new(UserTeamType::TEAM_MEMBERSHIPS) .attributes(UserTeamAttributes::new().role(Some(UserTeamRole::ADMIN))), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let resp = api .update_team_membership("team_id".to_string(), "user_id".to_string(), body) diff --git a/examples/v2_teams_update_team_permission_setting.rs b/examples/v2_teams_update_team_permission_setting.rs index 9372144c5..563f4240a 100644 --- a/examples/v2_teams_update_team_permission_setting.rs +++ b/examples/v2_teams_update_team_permission_setting.rs @@ -1,6 +1,6 @@ // Update permission setting for team returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_teams::TeamsAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_teams::TeamsAPI; use datadog_api_client::datadogV2::model::TeamPermissionSettingType; use datadog_api_client::datadogV2::model::TeamPermissionSettingUpdate; use datadog_api_client::datadogV2::model::TeamPermissionSettingUpdateAttributes; @@ -18,7 +18,7 @@ async fn main() { .value(TeamPermissionSettingValue::ADMINS), ), ); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = TeamsAPI::with_config(configuration); let resp = api .update_team_permission_setting( diff --git a/examples/v2_usage-metering_get_active_billing_dimensions.rs b/examples/v2_usage-metering_get_active_billing_dimensions.rs index cc166bc45..4e7003bc3 100644 --- a/examples/v2_usage-metering_get_active_billing_dimensions.rs +++ b/examples/v2_usage-metering_get_active_billing_dimensions.rs @@ -1,10 +1,10 @@ // Get active billing dimensions for cost attribution returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.GetActiveBillingDimensions", true); let api = UsageMeteringAPI::with_config(configuration); let resp = api.get_active_billing_dimensions().await; diff --git a/examples/v2_usage-metering_get_cost_by_org.rs b/examples/v2_usage-metering_get_cost_by_org.rs index b8f0fd789..ba9306e57 100644 --- a/examples/v2_usage-metering_get_cost_by_org.rs +++ b/examples/v2_usage-metering_get_cost_by_org.rs @@ -1,11 +1,11 @@ // Get cost across multi-org account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_usage_metering::GetCostByOrgOptionalParams; -use datadog_api_client::datadogV2::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_usage_metering::GetCostByOrgOptionalParams; +use datadog_api_client::datadogV2::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_cost_by_org( diff --git a/examples/v2_usage-metering_get_estimated_cost_by_org.rs b/examples/v2_usage-metering_get_estimated_cost_by_org.rs index 85c803e3a..4b3166f8b 100644 --- a/examples/v2_usage-metering_get_estimated_cost_by_org.rs +++ b/examples/v2_usage-metering_get_estimated_cost_by_org.rs @@ -1,11 +1,11 @@ // Get estimated cost across your account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_usage_metering::GetEstimatedCostByOrgOptionalParams; -use datadog_api_client::datadogV2::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_usage_metering::GetEstimatedCostByOrgOptionalParams; +use datadog_api_client::datadogV2::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_estimated_cost_by_org(GetEstimatedCostByOrgOptionalParams::default()) diff --git a/examples/v2_usage-metering_get_estimated_cost_by_org_3186693804.rs b/examples/v2_usage-metering_get_estimated_cost_by_org_3186693804.rs index 750beddfe..4f1b9bb3b 100644 --- a/examples/v2_usage-metering_get_estimated_cost_by_org_3186693804.rs +++ b/examples/v2_usage-metering_get_estimated_cost_by_org_3186693804.rs @@ -1,11 +1,11 @@ // GetEstimatedCostByOrg with start_month returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_usage_metering::GetEstimatedCostByOrgOptionalParams; -use datadog_api_client::datadogV2::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_usage_metering::GetEstimatedCostByOrgOptionalParams; +use datadog_api_client::datadogV2::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_estimated_cost_by_org( diff --git a/examples/v2_usage-metering_get_historical_cost_by_org.rs b/examples/v2_usage-metering_get_historical_cost_by_org.rs index 44c419589..077221be8 100644 --- a/examples/v2_usage-metering_get_historical_cost_by_org.rs +++ b/examples/v2_usage-metering_get_historical_cost_by_org.rs @@ -1,11 +1,11 @@ // Get historical cost across your account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_usage_metering::GetHistoricalCostByOrgOptionalParams; -use datadog_api_client::datadogV2::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_usage_metering::GetHistoricalCostByOrgOptionalParams; +use datadog_api_client::datadogV2::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_historical_cost_by_org( diff --git a/examples/v2_usage-metering_get_hourly_usage.rs b/examples/v2_usage-metering_get_hourly_usage.rs index aeb748433..c8968529f 100644 --- a/examples/v2_usage-metering_get_hourly_usage.rs +++ b/examples/v2_usage-metering_get_hourly_usage.rs @@ -1,11 +1,11 @@ // Get hourly usage by product family returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_usage_metering::GetHourlyUsageOptionalParams; -use datadog_api_client::datadogV2::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_usage_metering::GetHourlyUsageOptionalParams; +use datadog_api_client::datadogV2::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_hourly_usage( diff --git a/examples/v2_usage-metering_get_monthly_cost_attribution.rs b/examples/v2_usage-metering_get_monthly_cost_attribution.rs index 0e40a714f..53b79c5c9 100644 --- a/examples/v2_usage-metering_get_monthly_cost_attribution.rs +++ b/examples/v2_usage-metering_get_monthly_cost_attribution.rs @@ -1,11 +1,11 @@ // Get Monthly Cost Attribution returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_usage_metering::GetMonthlyCostAttributionOptionalParams; -use datadog_api_client::datadogV2::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_usage_metering::GetMonthlyCostAttributionOptionalParams; +use datadog_api_client::datadogV2::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let mut configuration = Configuration::new(); + let mut configuration = datadog::Configuration::new(); configuration.set_unstable_operation_enabled("v2.GetMonthlyCostAttribution", true); let api = UsageMeteringAPI::with_config(configuration); let resp = api diff --git a/examples/v2_usage-metering_get_projected_cost.rs b/examples/v2_usage-metering_get_projected_cost.rs index ce9592be5..e8c7e4583 100644 --- a/examples/v2_usage-metering_get_projected_cost.rs +++ b/examples/v2_usage-metering_get_projected_cost.rs @@ -1,11 +1,11 @@ // Get projected cost across your account returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_usage_metering::GetProjectedCostOptionalParams; -use datadog_api_client::datadogV2::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_usage_metering::GetProjectedCostOptionalParams; +use datadog_api_client::datadogV2::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_projected_cost(GetProjectedCostOptionalParams::default().view("sub-org".to_string())) diff --git a/examples/v2_usage-metering_get_usage_application_security_monitoring.rs b/examples/v2_usage-metering_get_usage_application_security_monitoring.rs index 05345043b..7aec6f4a3 100644 --- a/examples/v2_usage-metering_get_usage_application_security_monitoring.rs +++ b/examples/v2_usage-metering_get_usage_application_security_monitoring.rs @@ -1,11 +1,11 @@ // Get hourly usage for application security returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_usage_metering::GetUsageApplicationSecurityMonitoringOptionalParams; -use datadog_api_client::datadogV2::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_usage_metering::GetUsageApplicationSecurityMonitoringOptionalParams; +use datadog_api_client::datadogV2::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_application_security_monitoring( diff --git a/examples/v2_usage-metering_get_usage_lambda_traced_invocations.rs b/examples/v2_usage-metering_get_usage_lambda_traced_invocations.rs index ed288af43..e508e5f3d 100644 --- a/examples/v2_usage-metering_get_usage_lambda_traced_invocations.rs +++ b/examples/v2_usage-metering_get_usage_lambda_traced_invocations.rs @@ -1,11 +1,11 @@ // Get hourly usage for Lambda traced invocations returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_usage_metering::GetUsageLambdaTracedInvocationsOptionalParams; -use datadog_api_client::datadogV2::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_usage_metering::GetUsageLambdaTracedInvocationsOptionalParams; +use datadog_api_client::datadogV2::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_lambda_traced_invocations( diff --git a/examples/v2_usage-metering_get_usage_observability_pipelines.rs b/examples/v2_usage-metering_get_usage_observability_pipelines.rs index 3fe788449..3bb93649a 100644 --- a/examples/v2_usage-metering_get_usage_observability_pipelines.rs +++ b/examples/v2_usage-metering_get_usage_observability_pipelines.rs @@ -1,11 +1,11 @@ // Get hourly usage for observability pipelines returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_usage_metering::GetUsageObservabilityPipelinesOptionalParams; -use datadog_api_client::datadogV2::api::api_usage_metering::UsageMeteringAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_usage_metering::GetUsageObservabilityPipelinesOptionalParams; +use datadog_api_client::datadogV2::api_usage_metering::UsageMeteringAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsageMeteringAPI::with_config(configuration); let resp = api .get_usage_observability_pipelines( diff --git a/examples/v2_users_create_user.rs b/examples/v2_users_create_user.rs index d31df5014..4eac0f343 100644 --- a/examples/v2_users_create_user.rs +++ b/examples/v2_users_create_user.rs @@ -1,6 +1,6 @@ // Create a user returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_users::UsersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_users::UsersAPI; use datadog_api_client::datadogV2::model::UserCreateAttributes; use datadog_api_client::datadogV2::model::UserCreateData; use datadog_api_client::datadogV2::model::UserCreateRequest; @@ -13,7 +13,7 @@ async fn main() { .name("Datadog API Client Python".to_string()), UsersType::USERS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsersAPI::with_config(configuration); let resp = api.create_user(body).await; if let Ok(value) = resp { diff --git a/examples/v2_users_disable_user.rs b/examples/v2_users_disable_user.rs index 143f65c32..22c5c16f5 100644 --- a/examples/v2_users_disable_user.rs +++ b/examples/v2_users_disable_user.rs @@ -1,12 +1,12 @@ // Disable a user returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_users::UsersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_users::UsersAPI; #[tokio::main] async fn main() { // there is a valid "user" in the system let user_data_id = std::env::var("USER_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsersAPI::with_config(configuration); let resp = api.disable_user(user_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_users_get_invitation.rs b/examples/v2_users_get_invitation.rs index f6d76c782..fc78edac9 100644 --- a/examples/v2_users_get_invitation.rs +++ b/examples/v2_users_get_invitation.rs @@ -1,12 +1,12 @@ // Get a user invitation returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_users::UsersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_users::UsersAPI; #[tokio::main] async fn main() { // the "user" has a "user_invitation" let user_invitation_id = std::env::var("USER_INVITATION_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsersAPI::with_config(configuration); let resp = api.get_invitation(user_invitation_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_users_get_user.rs b/examples/v2_users_get_user.rs index 8775b0cef..1961ec699 100644 --- a/examples/v2_users_get_user.rs +++ b/examples/v2_users_get_user.rs @@ -1,12 +1,12 @@ // Get user details returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_users::UsersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_users::UsersAPI; #[tokio::main] async fn main() { // there is a valid "user" in the system let user_data_id = std::env::var("USER_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsersAPI::with_config(configuration); let resp = api.get_user(user_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_users_list_user_organizations.rs b/examples/v2_users_list_user_organizations.rs index 56a065b46..8379d4957 100644 --- a/examples/v2_users_list_user_organizations.rs +++ b/examples/v2_users_list_user_organizations.rs @@ -1,10 +1,10 @@ // Get a user organization returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_users::UsersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_users::UsersAPI; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsersAPI::with_config(configuration); let resp = api .list_user_organizations("00000000-0000-9999-0000-000000000000".to_string()) diff --git a/examples/v2_users_list_user_permissions.rs b/examples/v2_users_list_user_permissions.rs index d8597cc8c..9713cce0d 100644 --- a/examples/v2_users_list_user_permissions.rs +++ b/examples/v2_users_list_user_permissions.rs @@ -1,12 +1,12 @@ // Get a user permissions returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_users::UsersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_users::UsersAPI; #[tokio::main] async fn main() { // there is a valid "user" in the system let user_data_id = std::env::var("USER_DATA_ID").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsersAPI::with_config(configuration); let resp = api.list_user_permissions(user_data_id.clone()).await; if let Ok(value) = resp { diff --git a/examples/v2_users_list_users.rs b/examples/v2_users_list_users.rs index 825457655..9e60c2bf1 100644 --- a/examples/v2_users_list_users.rs +++ b/examples/v2_users_list_users.rs @@ -1,13 +1,13 @@ // List all users returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_users::ListUsersOptionalParams; -use datadog_api_client::datadogV2::api::api_users::UsersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_users::ListUsersOptionalParams; +use datadog_api_client::datadogV2::api_users::UsersAPI; #[tokio::main] async fn main() { // there is a valid "user" in the system let user_data_attributes_email = std::env::var("USER_DATA_ATTRIBUTES_EMAIL").unwrap(); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsersAPI::with_config(configuration); let resp = api .list_users(ListUsersOptionalParams::default().filter(user_data_attributes_email.clone())) diff --git a/examples/v2_users_list_users_4075885358.rs b/examples/v2_users_list_users_4075885358.rs index 7fd9fd121..7508d8189 100644 --- a/examples/v2_users_list_users_4075885358.rs +++ b/examples/v2_users_list_users_4075885358.rs @@ -1,13 +1,13 @@ // List all users returns "OK" response with pagination -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_users::ListUsersOptionalParams; -use datadog_api_client::datadogV2::api::api_users::UsersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_users::ListUsersOptionalParams; +use datadog_api_client::datadogV2::api_users::UsersAPI; use futures_util::pin_mut; use futures_util::stream::StreamExt; #[tokio::main] async fn main() { - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsersAPI::with_config(configuration); let response = api.list_users_with_pagination(ListUsersOptionalParams::default().page_size(2)); pin_mut!(response); diff --git a/examples/v2_users_send_invitations.rs b/examples/v2_users_send_invitations.rs index 1b17a1e3e..a9b035f23 100644 --- a/examples/v2_users_send_invitations.rs +++ b/examples/v2_users_send_invitations.rs @@ -1,6 +1,6 @@ // Send invitation emails returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_users::UsersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_users::UsersAPI; use datadog_api_client::datadogV2::model::RelationshipToUser; use datadog_api_client::datadogV2::model::RelationshipToUserData; use datadog_api_client::datadogV2::model::UserInvitationData; @@ -20,7 +20,7 @@ async fn main() { ))), UserInvitationsType::USER_INVITATIONS, )]); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsersAPI::with_config(configuration); let resp = api.send_invitations(body).await; if let Ok(value) = resp { diff --git a/examples/v2_users_update_user.rs b/examples/v2_users_update_user.rs index 0fa594c9f..2c5198f2b 100644 --- a/examples/v2_users_update_user.rs +++ b/examples/v2_users_update_user.rs @@ -1,6 +1,6 @@ // Update a user returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV2::api::api_users::UsersAPI; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_users::UsersAPI; use datadog_api_client::datadogV2::model::UserUpdateAttributes; use datadog_api_client::datadogV2::model::UserUpdateData; use datadog_api_client::datadogV2::model::UserUpdateRequest; @@ -17,7 +17,7 @@ async fn main() { user_data_id.clone(), UsersType::USERS, )); - let configuration = Configuration::new(); + let configuration = datadog::Configuration::new(); let api = UsersAPI::with_config(configuration); let resp = api.update_user(user_data_id.clone(), body).await; if let Ok(value) = resp { diff --git a/src/datadog/mod.rs b/src/datadog/mod.rs index a7a465771..e70ecb935 100644 --- a/src/datadog/mod.rs +++ b/src/datadog/mod.rs @@ -2,6 +2,9 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer}; use std::error; use std::fmt; +mod configuration; +pub use configuration::{APIKey, Configuration, DEFAULT_USER_AGENT}; + #[derive(Debug, Clone)] pub struct ResponseContent { pub status: reqwest::StatusCode, @@ -77,40 +80,11 @@ impl From for Error { } } -pub fn urlencode>(s: T) -> String { +pub(crate) fn urlencode>(s: T) -> String { ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() } -pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - } - serde_json::Value::String(s) => { - params.push((format!("{}[{}]", prefix, key), s.clone())) - } - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - return params; - } - unimplemented!("Only objects are supported with style=deepObject") -} - -pub struct DDFormatter; +pub(crate) struct DDFormatter; impl serde_json::ser::Formatter for DDFormatter { fn write_f64(&mut self, writer: &mut W, value: f64) -> std::io::Result<()> @@ -121,8 +95,6 @@ impl serde_json::ser::Formatter for DDFormatter { } } -pub mod configuration; - #[derive(Clone, Debug, Eq, PartialEq)] pub struct UnparsedObject { pub value: serde_json::Value, diff --git a/src/datadogV1/api/api_authentication.rs b/src/datadogV1/api/api_authentication.rs index d74bfe331..4a687a123 100644 --- a/src/datadogV1/api/api_authentication.rs +++ b/src/datadogV1/api/api_authentication.rs @@ -1,8 +1,7 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; -use reqwest; +use crate::datadog; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; @@ -17,13 +16,13 @@ pub enum ValidateError { #[derive(Debug, Clone)] pub struct AuthenticationAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for AuthenticationAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -31,7 +30,7 @@ impl AuthenticationAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -73,7 +72,7 @@ impl AuthenticationAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -82,14 +81,16 @@ impl AuthenticationAPI { /// Check if the API key (not the APP key) is valid. If invalid, a 403 is returned. pub async fn validate( &self, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::AuthenticationValidationResponse, + datadog::Error, + > { match self.validate_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -102,8 +103,8 @@ impl AuthenticationAPI { pub async fn validate_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.validate"; @@ -128,7 +129,7 @@ impl AuthenticationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -154,22 +155,22 @@ impl AuthenticationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_aws_integration.rs b/src/datadogV1/api/api_aws_integration.rs index f97ca6e1c..e685c5365 100644 --- a/src/datadogV1/api/api_aws_integration.rs +++ b/src/datadogV1/api/api_aws_integration.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -199,13 +198,13 @@ pub enum UpdateAWSAccountError { #[derive(Debug, Clone)] pub struct AWSIntegrationAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for AWSIntegrationAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -213,7 +212,7 @@ impl AWSIntegrationAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -255,7 +254,7 @@ impl AWSIntegrationAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -268,14 +267,16 @@ impl AWSIntegrationAPI { pub async fn create_aws_account( &self, body: crate::datadogV1::model::AWSAccount, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::AWSAccountCreateResponse, + datadog::Error, + > { match self.create_aws_account_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -292,8 +293,8 @@ impl AWSIntegrationAPI { &self, body: crate::datadogV1::model::AWSAccount, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_aws_account"; @@ -319,7 +320,7 @@ impl AWSIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -342,7 +343,7 @@ impl AWSIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -353,7 +354,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -363,7 +364,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -373,7 +374,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -397,23 +398,23 @@ impl AWSIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -423,7 +424,7 @@ impl AWSIntegrationAPI { body: crate::datadogV1::model::AWSEventBridgeCreateRequest, ) -> Result< crate::datadogV1::model::AWSEventBridgeCreateResponse, - Error, + datadog::Error, > { match self .create_aws_event_bridge_source_with_http_info(body) @@ -433,7 +434,7 @@ impl AWSIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -447,8 +448,8 @@ impl AWSIntegrationAPI { &self, body: crate::datadogV1::model::AWSEventBridgeCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_aws_event_bridge_source"; @@ -474,7 +475,7 @@ impl AWSIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -497,7 +498,7 @@ impl AWSIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -508,7 +509,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -518,7 +519,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -528,7 +529,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -552,23 +553,23 @@ impl AWSIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -576,14 +577,16 @@ impl AWSIntegrationAPI { pub async fn create_aws_tag_filter( &self, body: crate::datadogV1::model::AWSTagFilterCreateRequest, - ) -> Result, Error> - { + ) -> Result< + std::collections::BTreeMap, + datadog::Error, + > { match self.create_aws_tag_filter_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -597,8 +600,8 @@ impl AWSIntegrationAPI { &self, body: crate::datadogV1::model::AWSTagFilterCreateRequest, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_aws_tag_filter"; @@ -624,7 +627,7 @@ impl AWSIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -647,7 +650,7 @@ impl AWSIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -658,7 +661,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -668,7 +671,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -678,7 +681,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -702,23 +705,23 @@ impl AWSIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -726,14 +729,16 @@ impl AWSIntegrationAPI { pub async fn create_new_aws_external_id( &self, body: crate::datadogV1::model::AWSAccount, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::AWSAccountCreateResponse, + datadog::Error, + > { match self.create_new_aws_external_id_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -747,8 +752,8 @@ impl AWSIntegrationAPI { &self, body: crate::datadogV1::model::AWSAccount, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_new_aws_external_id"; @@ -774,7 +779,7 @@ impl AWSIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -797,7 +802,7 @@ impl AWSIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -808,7 +813,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -818,7 +823,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -828,7 +833,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -852,23 +857,23 @@ impl AWSIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -876,14 +881,16 @@ impl AWSIntegrationAPI { pub async fn delete_aws_account( &self, body: crate::datadogV1::model::AWSAccountDeleteRequest, - ) -> Result, Error> - { + ) -> Result< + std::collections::BTreeMap, + datadog::Error, + > { match self.delete_aws_account_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -897,8 +904,8 @@ impl AWSIntegrationAPI { &self, body: crate::datadogV1::model::AWSAccountDeleteRequest, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.delete_aws_account"; @@ -924,7 +931,7 @@ impl AWSIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -947,7 +954,7 @@ impl AWSIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -958,7 +965,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -968,7 +975,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -978,7 +985,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1002,23 +1009,23 @@ impl AWSIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1028,7 +1035,7 @@ impl AWSIntegrationAPI { body: crate::datadogV1::model::AWSEventBridgeDeleteRequest, ) -> Result< crate::datadogV1::model::AWSEventBridgeDeleteResponse, - Error, + datadog::Error, > { match self .delete_aws_event_bridge_source_with_http_info(body) @@ -1038,7 +1045,7 @@ impl AWSIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1052,8 +1059,8 @@ impl AWSIntegrationAPI { &self, body: crate::datadogV1::model::AWSEventBridgeDeleteRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.delete_aws_event_bridge_source"; @@ -1079,7 +1086,7 @@ impl AWSIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1102,7 +1109,7 @@ impl AWSIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1113,7 +1120,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1123,7 +1130,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1133,7 +1140,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1157,23 +1164,23 @@ impl AWSIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1181,14 +1188,16 @@ impl AWSIntegrationAPI { pub async fn delete_aws_tag_filter( &self, body: crate::datadogV1::model::AWSTagFilterDeleteRequest, - ) -> Result, Error> - { + ) -> Result< + std::collections::BTreeMap, + datadog::Error, + > { match self.delete_aws_tag_filter_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1202,8 +1211,8 @@ impl AWSIntegrationAPI { &self, body: crate::datadogV1::model::AWSTagFilterDeleteRequest, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.delete_aws_tag_filter"; @@ -1229,7 +1238,7 @@ impl AWSIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1252,7 +1261,7 @@ impl AWSIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1263,7 +1272,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1273,7 +1282,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1283,7 +1292,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1307,23 +1316,23 @@ impl AWSIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1331,13 +1340,14 @@ impl AWSIntegrationAPI { pub async fn list_aws_accounts( &self, params: ListAWSAccountsOptionalParams, - ) -> Result> { + ) -> Result> + { match self.list_aws_accounts_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1351,8 +1361,8 @@ impl AWSIntegrationAPI { &self, params: ListAWSAccountsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_aws_accounts"; @@ -1395,7 +1405,7 @@ impl AWSIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1428,23 +1438,23 @@ impl AWSIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1453,14 +1463,14 @@ impl AWSIntegrationAPI { &self, ) -> Result< crate::datadogV1::model::AWSEventBridgeListResponse, - Error, + datadog::Error, > { match self.list_aws_event_bridge_sources_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1473,8 +1483,8 @@ impl AWSIntegrationAPI { pub async fn list_aws_event_bridge_sources_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_aws_event_bridge_sources"; @@ -1499,7 +1509,7 @@ impl AWSIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1532,23 +1542,23 @@ impl AWSIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1556,14 +1566,16 @@ impl AWSIntegrationAPI { pub async fn list_aws_tag_filters( &self, account_id: String, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::AWSTagFilterListResponse, + datadog::Error, + > { match self.list_aws_tag_filters_with_http_info(account_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1577,8 +1589,8 @@ impl AWSIntegrationAPI { &self, account_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_aws_tag_filters"; @@ -1605,7 +1617,7 @@ impl AWSIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1638,36 +1650,36 @@ impl AWSIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// List all namespace rules for a given Datadog-AWS integration. This endpoint takes no arguments. pub async fn list_available_aws_namespaces( &self, - ) -> Result, Error> { + ) -> Result, datadog::Error> { match self.list_available_aws_namespaces_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1679,7 +1691,10 @@ impl AWSIntegrationAPI { /// List all namespace rules for a given Datadog-AWS integration. This endpoint takes no arguments. pub async fn list_available_aws_namespaces_with_http_info( &self, - ) -> Result>, Error> { + ) -> Result< + datadog::ResponseContent>, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.list_available_aws_namespaces"; @@ -1703,7 +1718,7 @@ impl AWSIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1734,23 +1749,23 @@ impl AWSIntegrationAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::>(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1759,14 +1774,16 @@ impl AWSIntegrationAPI { &self, body: crate::datadogV1::model::AWSAccount, params: UpdateAWSAccountOptionalParams, - ) -> Result, Error> - { + ) -> Result< + std::collections::BTreeMap, + datadog::Error, + > { match self.update_aws_account_with_http_info(body, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1781,8 +1798,8 @@ impl AWSIntegrationAPI { body: crate::datadogV1::model::AWSAccount, params: UpdateAWSAccountOptionalParams, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.update_aws_account"; @@ -1826,7 +1843,7 @@ impl AWSIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1849,7 +1866,7 @@ impl AWSIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1860,7 +1877,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1870,7 +1887,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1880,7 +1897,7 @@ impl AWSIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1904,23 +1921,23 @@ impl AWSIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_aws_logs_integration.rs b/src/datadogV1/api/api_aws_logs_integration.rs index 1a339b3e3..6cd8d9f48 100644 --- a/src/datadogV1/api/api_aws_logs_integration.rs +++ b/src/datadogV1/api/api_aws_logs_integration.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -82,13 +81,13 @@ pub enum ListAWSLogsServicesError { #[derive(Debug, Clone)] pub struct AWSLogsIntegrationAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for AWSLogsIntegrationAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -96,7 +95,7 @@ impl AWSLogsIntegrationAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -138,7 +137,7 @@ impl AWSLogsIntegrationAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -155,14 +154,16 @@ impl AWSLogsIntegrationAPI { pub async fn check_aws_logs_lambda_async( &self, body: crate::datadogV1::model::AWSAccountAndLambdaRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::AWSLogsAsyncResponse, + datadog::Error, + > { match self.check_aws_logs_lambda_async_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -183,8 +184,8 @@ impl AWSLogsIntegrationAPI { &self, body: crate::datadogV1::model::AWSAccountAndLambdaRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.check_aws_logs_lambda_async"; @@ -210,7 +211,7 @@ impl AWSLogsIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -233,7 +234,7 @@ impl AWSLogsIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -244,7 +245,7 @@ impl AWSLogsIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -254,7 +255,7 @@ impl AWSLogsIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -264,7 +265,7 @@ impl AWSLogsIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -288,23 +289,23 @@ impl AWSLogsIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -321,8 +322,10 @@ impl AWSLogsIntegrationAPI { pub async fn check_aws_logs_services_async( &self, body: crate::datadogV1::model::AWSLogsServicesRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::AWSLogsAsyncResponse, + datadog::Error, + > { match self .check_aws_logs_services_async_with_http_info(body) .await @@ -331,7 +334,7 @@ impl AWSLogsIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -354,8 +357,8 @@ impl AWSLogsIntegrationAPI { &self, body: crate::datadogV1::model::AWSLogsServicesRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.check_aws_logs_services_async"; @@ -381,7 +384,7 @@ impl AWSLogsIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -404,7 +407,7 @@ impl AWSLogsIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -415,7 +418,7 @@ impl AWSLogsIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -425,7 +428,7 @@ impl AWSLogsIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -435,7 +438,7 @@ impl AWSLogsIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -459,23 +462,23 @@ impl AWSLogsIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -483,14 +486,16 @@ impl AWSLogsIntegrationAPI { pub async fn create_aws_lambda_arn( &self, body: crate::datadogV1::model::AWSAccountAndLambdaRequest, - ) -> Result, Error> - { + ) -> Result< + std::collections::BTreeMap, + datadog::Error, + > { match self.create_aws_lambda_arn_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -504,8 +509,8 @@ impl AWSLogsIntegrationAPI { &self, body: crate::datadogV1::model::AWSAccountAndLambdaRequest, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_aws_lambda_arn"; @@ -531,7 +536,7 @@ impl AWSLogsIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -554,7 +559,7 @@ impl AWSLogsIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -565,7 +570,7 @@ impl AWSLogsIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -575,7 +580,7 @@ impl AWSLogsIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -585,7 +590,7 @@ impl AWSLogsIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -609,23 +614,23 @@ impl AWSLogsIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -633,14 +638,16 @@ impl AWSLogsIntegrationAPI { pub async fn delete_aws_lambda_arn( &self, body: crate::datadogV1::model::AWSAccountAndLambdaRequest, - ) -> Result, Error> - { + ) -> Result< + std::collections::BTreeMap, + datadog::Error, + > { match self.delete_aws_lambda_arn_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -654,8 +661,8 @@ impl AWSLogsIntegrationAPI { &self, body: crate::datadogV1::model::AWSAccountAndLambdaRequest, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.delete_aws_lambda_arn"; @@ -681,7 +688,7 @@ impl AWSLogsIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -704,7 +711,7 @@ impl AWSLogsIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -715,7 +722,7 @@ impl AWSLogsIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -725,7 +732,7 @@ impl AWSLogsIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -735,7 +742,7 @@ impl AWSLogsIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -759,23 +766,23 @@ impl AWSLogsIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -785,14 +792,14 @@ impl AWSLogsIntegrationAPI { body: crate::datadogV1::model::AWSLogsServicesRequest, ) -> Result< std::collections::BTreeMap, - Error, + datadog::Error, > { match self.enable_aws_log_services_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -806,8 +813,8 @@ impl AWSLogsIntegrationAPI { &self, body: crate::datadogV1::model::AWSLogsServicesRequest, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.enable_aws_log_services"; @@ -833,7 +840,7 @@ impl AWSLogsIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -856,7 +863,7 @@ impl AWSLogsIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -867,7 +874,7 @@ impl AWSLogsIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -877,7 +884,7 @@ impl AWSLogsIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -887,7 +894,7 @@ impl AWSLogsIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -911,23 +918,23 @@ impl AWSLogsIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -936,14 +943,14 @@ impl AWSLogsIntegrationAPI { &self, ) -> Result< Vec, - Error, + datadog::Error, > { match self.list_aws_logs_integrations_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -956,8 +963,8 @@ impl AWSLogsIntegrationAPI { pub async fn list_aws_logs_integrations_with_http_info( &self, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_aws_logs_integrations"; @@ -982,7 +989,7 @@ impl AWSLogsIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1015,23 +1022,23 @@ impl AWSLogsIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1040,14 +1047,14 @@ impl AWSLogsIntegrationAPI { &self, ) -> Result< Vec, - Error, + datadog::Error, > { match self.list_aws_logs_services_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1060,8 +1067,8 @@ impl AWSLogsIntegrationAPI { pub async fn list_aws_logs_services_with_http_info( &self, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_aws_logs_services"; @@ -1086,7 +1093,7 @@ impl AWSLogsIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1119,23 +1126,23 @@ impl AWSLogsIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_azure_integration.rs b/src/datadogV1/api/api_azure_integration.rs index 458899026..fea6868fe 100644 --- a/src/datadogV1/api/api_azure_integration.rs +++ b/src/datadogV1/api/api_azure_integration.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -63,13 +62,13 @@ pub enum UpdateAzureIntegrationError { #[derive(Debug, Clone)] pub struct AzureIntegrationAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for AzureIntegrationAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -77,7 +76,7 @@ impl AzureIntegrationAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -119,7 +118,7 @@ impl AzureIntegrationAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -137,14 +136,14 @@ impl AzureIntegrationAPI { body: crate::datadogV1::model::AzureAccount, ) -> Result< std::collections::BTreeMap, - Error, + datadog::Error, > { match self.create_azure_integration_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -164,8 +163,8 @@ impl AzureIntegrationAPI { &self, body: crate::datadogV1::model::AzureAccount, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_azure_integration"; @@ -191,7 +190,7 @@ impl AzureIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -214,7 +213,7 @@ impl AzureIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -225,7 +224,7 @@ impl AzureIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -235,7 +234,7 @@ impl AzureIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -245,7 +244,7 @@ impl AzureIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -269,23 +268,23 @@ impl AzureIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -295,14 +294,14 @@ impl AzureIntegrationAPI { body: crate::datadogV1::model::AzureAccount, ) -> Result< std::collections::BTreeMap, - Error, + datadog::Error, > { match self.delete_azure_integration_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -316,8 +315,8 @@ impl AzureIntegrationAPI { &self, body: crate::datadogV1::model::AzureAccount, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.delete_azure_integration"; @@ -343,7 +342,7 @@ impl AzureIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -366,7 +365,7 @@ impl AzureIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -377,7 +376,7 @@ impl AzureIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -387,7 +386,7 @@ impl AzureIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -397,7 +396,7 @@ impl AzureIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -421,36 +420,37 @@ impl AzureIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// List all Datadog-Azure integrations configured in your Datadog account. pub async fn list_azure_integration( &self, - ) -> Result, Error> { + ) -> Result, datadog::Error> + { match self.list_azure_integration_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -463,8 +463,8 @@ impl AzureIntegrationAPI { pub async fn list_azure_integration_with_http_info( &self, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_azure_integration"; @@ -489,7 +489,7 @@ impl AzureIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -521,23 +521,23 @@ impl AzureIntegrationAPI { match serde_json::from_str::>(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -547,14 +547,14 @@ impl AzureIntegrationAPI { body: crate::datadogV1::model::AzureAccount, ) -> Result< std::collections::BTreeMap, - Error, + datadog::Error, > { match self.update_azure_host_filters_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -568,8 +568,8 @@ impl AzureIntegrationAPI { &self, body: crate::datadogV1::model::AzureAccount, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.update_azure_host_filters"; @@ -595,7 +595,7 @@ impl AzureIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -618,7 +618,7 @@ impl AzureIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -629,7 +629,7 @@ impl AzureIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -639,7 +639,7 @@ impl AzureIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -649,7 +649,7 @@ impl AzureIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -673,23 +673,23 @@ impl AzureIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -701,14 +701,14 @@ impl AzureIntegrationAPI { body: crate::datadogV1::model::AzureAccount, ) -> Result< std::collections::BTreeMap, - Error, + datadog::Error, > { match self.update_azure_integration_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -724,8 +724,8 @@ impl AzureIntegrationAPI { &self, body: crate::datadogV1::model::AzureAccount, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.update_azure_integration"; @@ -751,7 +751,7 @@ impl AzureIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -774,7 +774,7 @@ impl AzureIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -785,7 +785,7 @@ impl AzureIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -795,7 +795,7 @@ impl AzureIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -805,7 +805,7 @@ impl AzureIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -829,23 +829,23 @@ impl AzureIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_dashboard_lists.rs b/src/datadogV1/api/api_dashboard_lists.rs index 03c565de0..8995ac32c 100644 --- a/src/datadogV1/api/api_dashboard_lists.rs +++ b/src/datadogV1/api/api_dashboard_lists.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -63,13 +62,13 @@ pub enum UpdateDashboardListError { #[derive(Debug, Clone)] pub struct DashboardListsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for DashboardListsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -77,7 +76,7 @@ impl DashboardListsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -119,7 +118,7 @@ impl DashboardListsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -129,13 +128,14 @@ impl DashboardListsAPI { pub async fn create_dashboard_list( &self, body: crate::datadogV1::model::DashboardList, - ) -> Result> { + ) -> Result> + { match self.create_dashboard_list_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -149,8 +149,8 @@ impl DashboardListsAPI { &self, body: crate::datadogV1::model::DashboardList, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_dashboard_list"; @@ -176,7 +176,7 @@ impl DashboardListsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -199,7 +199,7 @@ impl DashboardListsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -210,7 +210,7 @@ impl DashboardListsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -220,7 +220,7 @@ impl DashboardListsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -230,7 +230,7 @@ impl DashboardListsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -252,23 +252,23 @@ impl DashboardListsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -276,14 +276,16 @@ impl DashboardListsAPI { pub async fn delete_dashboard_list( &self, list_id: i64, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::DashboardListDeleteResponse, + datadog::Error, + > { match self.delete_dashboard_list_with_http_info(list_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -297,8 +299,8 @@ impl DashboardListsAPI { &self, list_id: i64, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.delete_dashboard_list"; @@ -324,7 +326,7 @@ impl DashboardListsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -357,23 +359,23 @@ impl DashboardListsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -381,13 +383,13 @@ impl DashboardListsAPI { pub async fn get_dashboard_list( &self, list_id: i64, - ) -> Result> { + ) -> Result> { match self.get_dashboard_list_with_http_info(list_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -400,8 +402,10 @@ impl DashboardListsAPI { pub async fn get_dashboard_list_with_http_info( &self, list_id: i64, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_dashboard_list"; @@ -426,7 +430,7 @@ impl DashboardListsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -457,37 +461,39 @@ impl DashboardListsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// Fetch all of your existing dashboard list definitions. pub async fn list_dashboard_lists( &self, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::DashboardListListResponse, + datadog::Error, + > { match self.list_dashboard_lists_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -500,8 +506,8 @@ impl DashboardListsAPI { pub async fn list_dashboard_lists_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_dashboard_lists"; @@ -526,7 +532,7 @@ impl DashboardListsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -559,23 +565,23 @@ impl DashboardListsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -584,7 +590,8 @@ impl DashboardListsAPI { &self, list_id: i64, body: crate::datadogV1::model::DashboardList, - ) -> Result> { + ) -> Result> + { match self .update_dashboard_list_with_http_info(list_id, body) .await @@ -593,7 +600,7 @@ impl DashboardListsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -608,8 +615,8 @@ impl DashboardListsAPI { list_id: i64, body: crate::datadogV1::model::DashboardList, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.update_dashboard_list"; @@ -636,7 +643,7 @@ impl DashboardListsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -659,7 +666,7 @@ impl DashboardListsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -670,7 +677,7 @@ impl DashboardListsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -680,7 +687,7 @@ impl DashboardListsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -690,7 +697,7 @@ impl DashboardListsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -712,23 +719,23 @@ impl DashboardListsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_dashboards.rs b/src/datadogV1/api/api_dashboards.rs index 2d69f96f1..1e3c9b311 100644 --- a/src/datadogV1/api/api_dashboards.rs +++ b/src/datadogV1/api/api_dashboards.rs @@ -1,14 +1,13 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -224,13 +223,13 @@ pub enum UpdatePublicDashboardError { #[derive(Debug, Clone)] pub struct DashboardsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for DashboardsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -238,7 +237,7 @@ impl DashboardsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -280,7 +279,7 @@ impl DashboardsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -291,13 +290,13 @@ impl DashboardsAPI { pub async fn create_dashboard( &self, body: crate::datadogV1::model::Dashboard, - ) -> Result> { + ) -> Result> { match self.create_dashboard_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -311,8 +310,10 @@ impl DashboardsAPI { pub async fn create_dashboard_with_http_info( &self, body: crate::datadogV1::model::Dashboard, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.create_dashboard"; @@ -337,7 +338,7 @@ impl DashboardsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -360,7 +361,7 @@ impl DashboardsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -371,7 +372,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -381,7 +382,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -391,7 +392,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -413,23 +414,23 @@ impl DashboardsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -437,13 +438,14 @@ impl DashboardsAPI { pub async fn create_public_dashboard( &self, body: crate::datadogV1::model::SharedDashboard, - ) -> Result> { + ) -> Result> + { match self.create_public_dashboard_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -457,8 +459,8 @@ impl DashboardsAPI { &self, body: crate::datadogV1::model::SharedDashboard, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_public_dashboard"; @@ -484,7 +486,7 @@ impl DashboardsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -507,7 +509,7 @@ impl DashboardsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -518,7 +520,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -528,7 +530,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -538,7 +540,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -560,23 +562,23 @@ impl DashboardsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -584,13 +586,16 @@ impl DashboardsAPI { pub async fn delete_dashboard( &self, dashboard_id: String, - ) -> Result> { + ) -> Result< + crate::datadogV1::model::DashboardDeleteResponse, + datadog::Error, + > { match self.delete_dashboard_with_http_info(dashboard_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -604,8 +609,8 @@ impl DashboardsAPI { &self, dashboard_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.delete_dashboard"; @@ -615,7 +620,7 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/{dashboard_id}", local_configuration.get_operation_host(operation_id), - dashboard_id = urlencode(dashboard_id) + dashboard_id = datadog::urlencode(dashboard_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -631,7 +636,7 @@ impl DashboardsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -664,23 +669,23 @@ impl DashboardsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -688,7 +693,7 @@ impl DashboardsAPI { pub async fn delete_dashboards( &self, body: crate::datadogV1::model::DashboardBulkDeleteRequest, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.delete_dashboards_with_http_info(body).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -699,7 +704,7 @@ impl DashboardsAPI { pub async fn delete_dashboards_with_http_info( &self, body: crate::datadogV1::model::DashboardBulkDeleteRequest, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v1.delete_dashboards"; @@ -724,7 +729,7 @@ impl DashboardsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -747,7 +752,7 @@ impl DashboardsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -758,7 +763,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -768,7 +773,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -778,7 +783,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -798,7 +803,7 @@ impl DashboardsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -806,12 +811,12 @@ impl DashboardsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -821,14 +826,14 @@ impl DashboardsAPI { token: String, ) -> Result< crate::datadogV1::model::DeleteSharedDashboardResponse, - Error, + datadog::Error, > { match self.delete_public_dashboard_with_http_info(token).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -842,8 +847,8 @@ impl DashboardsAPI { &self, token: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.delete_public_dashboard"; @@ -853,7 +858,7 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/public/{token}", local_configuration.get_operation_host(operation_id), - token = urlencode(token) + token = datadog::urlencode(token) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -869,7 +874,7 @@ impl DashboardsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -902,23 +907,23 @@ impl DashboardsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -927,7 +932,7 @@ impl DashboardsAPI { &self, token: String, body: crate::datadogV1::model::SharedDashboardInvites, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_public_dashboard_invitation_with_http_info(token, body) .await @@ -942,7 +947,8 @@ impl DashboardsAPI { &self, token: String, body: crate::datadogV1::model::SharedDashboardInvites, - ) -> Result, Error> { + ) -> Result, datadog::Error> + { let local_configuration = &self.config; let operation_id = "v1.delete_public_dashboard_invitation"; @@ -951,7 +957,7 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/public/{token}/invitation", local_configuration.get_operation_host(operation_id), - token = urlencode(token) + token = datadog::urlencode(token) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -968,7 +974,7 @@ impl DashboardsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -991,7 +997,7 @@ impl DashboardsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1002,7 +1008,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1012,7 +1018,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1022,7 +1028,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1042,7 +1048,7 @@ impl DashboardsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -1050,12 +1056,12 @@ impl DashboardsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1063,13 +1069,13 @@ impl DashboardsAPI { pub async fn get_dashboard( &self, dashboard_id: String, - ) -> Result> { + ) -> Result> { match self.get_dashboard_with_http_info(dashboard_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1082,7 +1088,10 @@ impl DashboardsAPI { pub async fn get_dashboard_with_http_info( &self, dashboard_id: String, - ) -> Result, Error> { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_dashboard"; @@ -1091,7 +1100,7 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/{dashboard_id}", local_configuration.get_operation_host(operation_id), - dashboard_id = urlencode(dashboard_id) + dashboard_id = datadog::urlencode(dashboard_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1107,7 +1116,7 @@ impl DashboardsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1138,22 +1147,22 @@ impl DashboardsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1161,13 +1170,14 @@ impl DashboardsAPI { pub async fn get_public_dashboard( &self, token: String, - ) -> Result> { + ) -> Result> + { match self.get_public_dashboard_with_http_info(token).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1181,8 +1191,8 @@ impl DashboardsAPI { &self, token: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_public_dashboard"; @@ -1192,7 +1202,7 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/public/{token}", local_configuration.get_operation_host(operation_id), - token = urlencode(token) + token = datadog::urlencode(token) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1208,7 +1218,7 @@ impl DashboardsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1239,23 +1249,23 @@ impl DashboardsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1266,7 +1276,7 @@ impl DashboardsAPI { params: GetPublicDashboardInvitationsOptionalParams, ) -> Result< crate::datadogV1::model::SharedDashboardInvites, - Error, + datadog::Error, > { match self .get_public_dashboard_invitations_with_http_info(token, params) @@ -1276,7 +1286,7 @@ impl DashboardsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1291,8 +1301,8 @@ impl DashboardsAPI { token: String, params: GetPublicDashboardInvitationsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_public_dashboard_invitations"; @@ -1306,7 +1316,7 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/public/{token}/invitation", local_configuration.get_operation_host(operation_id), - token = urlencode(token) + token = datadog::urlencode(token) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1331,7 +1341,7 @@ impl DashboardsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1364,23 +1374,23 @@ impl DashboardsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1391,13 +1401,14 @@ impl DashboardsAPI { pub async fn list_dashboards( &self, params: ListDashboardsOptionalParams, - ) -> Result> { + ) -> Result> + { match self.list_dashboards_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1412,7 +1423,7 @@ impl DashboardsAPI { ) -> impl Stream< Item = Result< crate::datadogV1::model::DashboardSummaryDefinition, - Error, + datadog::Error, >, > + '_ { try_stream! { @@ -1452,8 +1463,8 @@ impl DashboardsAPI { &self, params: ListDashboardsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_dashboards"; @@ -1501,7 +1512,7 @@ impl DashboardsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1533,23 +1544,23 @@ impl DashboardsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1557,7 +1568,7 @@ impl DashboardsAPI { pub async fn restore_dashboards( &self, body: crate::datadogV1::model::DashboardRestoreRequest, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.restore_dashboards_with_http_info(body).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -1568,7 +1579,7 @@ impl DashboardsAPI { pub async fn restore_dashboards_with_http_info( &self, body: crate::datadogV1::model::DashboardRestoreRequest, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v1.restore_dashboards"; @@ -1593,7 +1604,7 @@ impl DashboardsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1616,7 +1627,7 @@ impl DashboardsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1627,7 +1638,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1637,7 +1648,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1647,7 +1658,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1667,7 +1678,7 @@ impl DashboardsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -1675,12 +1686,12 @@ impl DashboardsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1691,7 +1702,7 @@ impl DashboardsAPI { body: crate::datadogV1::model::SharedDashboardInvites, ) -> Result< crate::datadogV1::model::SharedDashboardInvites, - Error, + datadog::Error, > { match self .send_public_dashboard_invitation_with_http_info(token, body) @@ -1701,7 +1712,7 @@ impl DashboardsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1716,8 +1727,8 @@ impl DashboardsAPI { token: String, body: crate::datadogV1::model::SharedDashboardInvites, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.send_public_dashboard_invitation"; @@ -1727,7 +1738,7 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/public/{token}/invitation", local_configuration.get_operation_host(operation_id), - token = urlencode(token) + token = datadog::urlencode(token) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -1744,7 +1755,7 @@ impl DashboardsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1767,7 +1778,7 @@ impl DashboardsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1778,7 +1789,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1788,7 +1799,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1798,7 +1809,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1822,23 +1833,23 @@ impl DashboardsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1847,7 +1858,7 @@ impl DashboardsAPI { &self, dashboard_id: String, body: crate::datadogV1::model::Dashboard, - ) -> Result> { + ) -> Result> { match self .update_dashboard_with_http_info(dashboard_id, body) .await @@ -1856,7 +1867,7 @@ impl DashboardsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1870,8 +1881,10 @@ impl DashboardsAPI { &self, dashboard_id: String, body: crate::datadogV1::model::Dashboard, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.update_dashboard"; @@ -1880,7 +1893,7 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/{dashboard_id}", local_configuration.get_operation_host(operation_id), - dashboard_id = urlencode(dashboard_id) + dashboard_id = datadog::urlencode(dashboard_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -1897,7 +1910,7 @@ impl DashboardsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1920,7 +1933,7 @@ impl DashboardsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1931,7 +1944,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1941,7 +1954,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1951,7 +1964,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1973,23 +1986,23 @@ impl DashboardsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1998,7 +2011,8 @@ impl DashboardsAPI { &self, token: String, body: crate::datadogV1::model::SharedDashboardUpdateRequest, - ) -> Result> { + ) -> Result> + { match self .update_public_dashboard_with_http_info(token, body) .await @@ -2007,7 +2021,7 @@ impl DashboardsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2022,8 +2036,8 @@ impl DashboardsAPI { token: String, body: crate::datadogV1::model::SharedDashboardUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.update_public_dashboard"; @@ -2033,7 +2047,7 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/public/{token}", local_configuration.get_operation_host(operation_id), - token = urlencode(token) + token = datadog::urlencode(token) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -2050,7 +2064,7 @@ impl DashboardsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2073,7 +2087,7 @@ impl DashboardsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -2084,7 +2098,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -2094,7 +2108,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -2104,7 +2118,7 @@ impl DashboardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -2126,23 +2140,23 @@ impl DashboardsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_downtimes.rs b/src/datadogV1/api/api_downtimes.rs index 94ee778ad..a926e66eb 100644 --- a/src/datadogV1/api/api_downtimes.rs +++ b/src/datadogV1/api/api_downtimes.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -107,13 +106,13 @@ pub enum UpdateDowntimeError { #[derive(Debug, Clone)] pub struct DowntimesAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for DowntimesAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -121,7 +120,7 @@ impl DowntimesAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -163,7 +162,7 @@ impl DowntimesAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -173,7 +172,7 @@ impl DowntimesAPI { pub async fn cancel_downtime( &self, downtime_id: i64, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.cancel_downtime_with_http_info(downtime_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -184,7 +183,7 @@ impl DowntimesAPI { pub async fn cancel_downtime_with_http_info( &self, downtime_id: i64, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v1.cancel_downtime"; @@ -209,7 +208,7 @@ impl DowntimesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -238,7 +237,7 @@ impl DowntimesAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -246,12 +245,12 @@ impl DowntimesAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -259,14 +258,16 @@ impl DowntimesAPI { pub async fn cancel_downtimes_by_scope( &self, body: crate::datadogV1::model::CancelDowntimesByScopeRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::CanceledDowntimesIds, + datadog::Error, + > { match self.cancel_downtimes_by_scope_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -280,8 +281,8 @@ impl DowntimesAPI { &self, body: crate::datadogV1::model::CancelDowntimesByScopeRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.cancel_downtimes_by_scope"; @@ -307,7 +308,7 @@ impl DowntimesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -330,7 +331,7 @@ impl DowntimesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -341,7 +342,7 @@ impl DowntimesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -351,7 +352,7 @@ impl DowntimesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -361,7 +362,7 @@ impl DowntimesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -385,23 +386,23 @@ impl DowntimesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -409,13 +410,13 @@ impl DowntimesAPI { pub async fn create_downtime( &self, body: crate::datadogV1::model::Downtime, - ) -> Result> { + ) -> Result> { match self.create_downtime_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -428,8 +429,10 @@ impl DowntimesAPI { pub async fn create_downtime_with_http_info( &self, body: crate::datadogV1::model::Downtime, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.create_downtime"; @@ -454,7 +457,7 @@ impl DowntimesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -477,7 +480,7 @@ impl DowntimesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -488,7 +491,7 @@ impl DowntimesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -498,7 +501,7 @@ impl DowntimesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -508,7 +511,7 @@ impl DowntimesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -530,23 +533,23 @@ impl DowntimesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -554,13 +557,13 @@ impl DowntimesAPI { pub async fn get_downtime( &self, downtime_id: i64, - ) -> Result> { + ) -> Result> { match self.get_downtime_with_http_info(downtime_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -573,7 +576,10 @@ impl DowntimesAPI { pub async fn get_downtime_with_http_info( &self, downtime_id: i64, - ) -> Result, Error> { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_downtime"; @@ -598,7 +604,7 @@ impl DowntimesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -629,22 +635,22 @@ impl DowntimesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -652,13 +658,13 @@ impl DowntimesAPI { pub async fn list_downtimes( &self, params: ListDowntimesOptionalParams, - ) -> Result, Error> { + ) -> Result, datadog::Error> { match self.list_downtimes_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -671,8 +677,10 @@ impl DowntimesAPI { pub async fn list_downtimes_with_http_info( &self, params: ListDowntimesOptionalParams, - ) -> Result>, Error> - { + ) -> Result< + datadog::ResponseContent>, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.list_downtimes"; @@ -709,7 +717,7 @@ impl DowntimesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -740,23 +748,23 @@ impl DowntimesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::>(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -764,13 +772,14 @@ impl DowntimesAPI { pub async fn list_monitor_downtimes( &self, monitor_id: i64, - ) -> Result, Error> { + ) -> Result, datadog::Error> + { match self.list_monitor_downtimes_with_http_info(monitor_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -784,8 +793,8 @@ impl DowntimesAPI { &self, monitor_id: i64, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_monitor_downtimes"; @@ -811,7 +820,7 @@ impl DowntimesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -842,23 +851,23 @@ impl DowntimesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::>(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -867,13 +876,13 @@ impl DowntimesAPI { &self, downtime_id: i64, body: crate::datadogV1::model::Downtime, - ) -> Result> { + ) -> Result> { match self.update_downtime_with_http_info(downtime_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -887,8 +896,10 @@ impl DowntimesAPI { &self, downtime_id: i64, body: crate::datadogV1::model::Downtime, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.update_downtime"; @@ -914,7 +925,7 @@ impl DowntimesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -937,7 +948,7 @@ impl DowntimesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -948,7 +959,7 @@ impl DowntimesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -958,7 +969,7 @@ impl DowntimesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -968,7 +979,7 @@ impl DowntimesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -990,23 +1001,23 @@ impl DowntimesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_events.rs b/src/datadogV1/api/api_events.rs index f8c93be29..c4cb52bce 100644 --- a/src/datadogV1/api/api_events.rs +++ b/src/datadogV1/api/api_events.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -101,13 +100,13 @@ pub enum ListEventsError { #[derive(Debug, Clone)] pub struct EventsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for EventsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -115,7 +114,7 @@ impl EventsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -157,7 +156,7 @@ impl EventsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -168,13 +167,14 @@ impl EventsAPI { pub async fn create_event( &self, body: crate::datadogV1::model::EventCreateRequest, - ) -> Result> { + ) -> Result> + { match self.create_event_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -189,8 +189,8 @@ impl EventsAPI { &self, body: crate::datadogV1::model::EventCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_event"; @@ -216,7 +216,7 @@ impl EventsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -232,7 +232,7 @@ impl EventsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -243,7 +243,7 @@ impl EventsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -253,7 +253,7 @@ impl EventsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -263,7 +263,7 @@ impl EventsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -287,22 +287,22 @@ impl EventsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -313,13 +313,13 @@ impl EventsAPI { pub async fn get_event( &self, event_id: i64, - ) -> Result> { + ) -> Result> { match self.get_event_with_http_info(event_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -335,7 +335,10 @@ impl EventsAPI { pub async fn get_event_with_http_info( &self, event_id: i64, - ) -> Result, Error> { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_event"; @@ -360,7 +363,7 @@ impl EventsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -391,22 +394,22 @@ impl EventsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -424,13 +427,13 @@ impl EventsAPI { start: i64, end: i64, params: ListEventsOptionalParams, - ) -> Result> { + ) -> Result> { match self.list_events_with_http_info(start, end, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -453,8 +456,10 @@ impl EventsAPI { start: i64, end: i64, params: ListEventsOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.list_events"; @@ -513,7 +518,7 @@ impl EventsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -545,22 +550,22 @@ impl EventsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_gcp_integration.rs b/src/datadogV1/api/api_gcp_integration.rs index f7edad60c..38dcfe81c 100644 --- a/src/datadogV1/api/api_gcp_integration.rs +++ b/src/datadogV1/api/api_gcp_integration.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -53,13 +52,13 @@ pub enum UpdateGCPIntegrationError { #[derive(Debug, Clone)] pub struct GCPIntegrationAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for GCPIntegrationAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -67,7 +66,7 @@ impl GCPIntegrationAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -109,7 +108,7 @@ impl GCPIntegrationAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -121,14 +120,14 @@ impl GCPIntegrationAPI { body: crate::datadogV1::model::GCPAccount, ) -> Result< std::collections::BTreeMap, - Error, + datadog::Error, > { match self.create_gcp_integration_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -142,8 +141,8 @@ impl GCPIntegrationAPI { &self, body: crate::datadogV1::model::GCPAccount, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_gcp_integration"; @@ -169,7 +168,7 @@ impl GCPIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -192,7 +191,7 @@ impl GCPIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -203,7 +202,7 @@ impl GCPIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -213,7 +212,7 @@ impl GCPIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -223,7 +222,7 @@ impl GCPIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -247,23 +246,23 @@ impl GCPIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -273,14 +272,14 @@ impl GCPIntegrationAPI { body: crate::datadogV1::model::GCPAccount, ) -> Result< std::collections::BTreeMap, - Error, + datadog::Error, > { match self.delete_gcp_integration_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -294,8 +293,8 @@ impl GCPIntegrationAPI { &self, body: crate::datadogV1::model::GCPAccount, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.delete_gcp_integration"; @@ -321,7 +320,7 @@ impl GCPIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -344,7 +343,7 @@ impl GCPIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -355,7 +354,7 @@ impl GCPIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -365,7 +364,7 @@ impl GCPIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -375,7 +374,7 @@ impl GCPIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -399,36 +398,37 @@ impl GCPIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// This endpoint is deprecated – use the V2 endpoints instead. List all Datadog-GCP integrations configured in your Datadog account. pub async fn list_gcp_integration( &self, - ) -> Result, Error> { + ) -> Result, datadog::Error> + { match self.list_gcp_integration_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -441,8 +441,8 @@ impl GCPIntegrationAPI { pub async fn list_gcp_integration_with_http_info( &self, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_gcp_integration"; @@ -467,7 +467,7 @@ impl GCPIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -498,23 +498,23 @@ impl GCPIntegrationAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::>(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -527,14 +527,14 @@ impl GCPIntegrationAPI { body: crate::datadogV1::model::GCPAccount, ) -> Result< std::collections::BTreeMap, - Error, + datadog::Error, > { match self.update_gcp_integration_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -551,8 +551,8 @@ impl GCPIntegrationAPI { &self, body: crate::datadogV1::model::GCPAccount, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.update_gcp_integration"; @@ -578,7 +578,7 @@ impl GCPIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -601,7 +601,7 @@ impl GCPIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -612,7 +612,7 @@ impl GCPIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -622,7 +622,7 @@ impl GCPIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -632,7 +632,7 @@ impl GCPIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -656,23 +656,23 @@ impl GCPIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_hosts.rs b/src/datadogV1/api/api_hosts.rs index 61b082d04..99160cd37 100644 --- a/src/datadogV1/api/api_hosts.rs +++ b/src/datadogV1/api/api_hosts.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -134,13 +133,13 @@ pub enum UnmuteHostError { #[derive(Debug, Clone)] pub struct HostsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for HostsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -148,7 +147,7 @@ impl HostsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -190,7 +189,7 @@ impl HostsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -201,13 +200,13 @@ impl HostsAPI { pub async fn get_host_totals( &self, params: GetHostTotalsOptionalParams, - ) -> Result> { + ) -> Result> { match self.get_host_totals_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -221,8 +220,10 @@ impl HostsAPI { pub async fn get_host_totals_with_http_info( &self, params: GetHostTotalsOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_host_totals"; @@ -254,7 +255,7 @@ impl HostsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -285,23 +286,23 @@ impl HostsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -312,13 +313,13 @@ impl HostsAPI { pub async fn list_hosts( &self, params: ListHostsOptionalParams, - ) -> Result> { + ) -> Result> { match self.list_hosts_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -334,8 +335,10 @@ impl HostsAPI { pub async fn list_hosts_with_http_info( &self, params: ListHostsOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.list_hosts"; @@ -402,7 +405,7 @@ impl HostsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -434,22 +437,22 @@ impl HostsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -458,13 +461,13 @@ impl HostsAPI { &self, host_name: String, body: crate::datadogV1::model::HostMuteSettings, - ) -> Result> { + ) -> Result> { match self.mute_host_with_http_info(host_name, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -478,8 +481,10 @@ impl HostsAPI { &self, host_name: String, body: crate::datadogV1::model::HostMuteSettings, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.mute_host"; @@ -488,7 +493,7 @@ impl HostsAPI { let local_uri_str = format!( "{}/api/v1/host/{host_name}/mute", local_configuration.get_operation_host(operation_id), - host_name = urlencode(host_name) + host_name = datadog::urlencode(host_name) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -505,7 +510,7 @@ impl HostsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -528,7 +533,7 @@ impl HostsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -539,7 +544,7 @@ impl HostsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -549,7 +554,7 @@ impl HostsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -559,7 +564,7 @@ impl HostsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -582,22 +587,22 @@ impl HostsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -605,13 +610,13 @@ impl HostsAPI { pub async fn unmute_host( &self, host_name: String, - ) -> Result> { + ) -> Result> { match self.unmute_host_with_http_info(host_name).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -624,8 +629,10 @@ impl HostsAPI { pub async fn unmute_host_with_http_info( &self, host_name: String, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.unmute_host"; @@ -634,7 +641,7 @@ impl HostsAPI { let local_uri_str = format!( "{}/api/v1/host/{host_name}/unmute", local_configuration.get_operation_host(operation_id), - host_name = urlencode(host_name) + host_name = datadog::urlencode(host_name) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -650,7 +657,7 @@ impl HostsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -682,22 +689,22 @@ impl HostsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_ip_ranges.rs b/src/datadogV1/api/api_ip_ranges.rs index 9e1ffee23..7098df756 100644 --- a/src/datadogV1/api/api_ip_ranges.rs +++ b/src/datadogV1/api/api_ip_ranges.rs @@ -1,8 +1,7 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; -use reqwest; +use crate::datadog; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; @@ -16,13 +15,13 @@ pub enum GetIPRangesError { #[derive(Debug, Clone)] pub struct IPRangesAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for IPRangesAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -30,7 +29,7 @@ impl IPRangesAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -72,7 +71,7 @@ impl IPRangesAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -81,13 +80,13 @@ impl IPRangesAPI { /// Get information about Datadog IP ranges. pub async fn get_ip_ranges( &self, - ) -> Result> { + ) -> Result> { match self.get_ip_ranges_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -99,7 +98,10 @@ impl IPRangesAPI { /// Get information about Datadog IP ranges. pub async fn get_ip_ranges_with_http_info( &self, - ) -> Result, Error> { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_ip_ranges"; @@ -120,7 +122,7 @@ impl IPRangesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -137,22 +139,22 @@ impl IPRangesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_key_management.rs b/src/datadogV1/api/api_key_management.rs index 38ea7b414..9d21b6de9 100644 --- a/src/datadogV1/api/api_key_management.rs +++ b/src/datadogV1/api/api_key_management.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -116,13 +115,13 @@ pub enum UpdateApplicationKeyError { #[derive(Debug, Clone)] pub struct KeyManagementAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for KeyManagementAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -130,7 +129,7 @@ impl KeyManagementAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -172,7 +171,7 @@ impl KeyManagementAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -182,13 +181,13 @@ impl KeyManagementAPI { pub async fn create_api_key( &self, body: crate::datadogV1::model::ApiKey, - ) -> Result> { + ) -> Result> { match self.create_api_key_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -201,8 +200,10 @@ impl KeyManagementAPI { pub async fn create_api_key_with_http_info( &self, body: crate::datadogV1::model::ApiKey, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.create_api_key"; @@ -227,7 +228,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -250,7 +251,7 @@ impl KeyManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -261,7 +262,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -271,7 +272,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -281,7 +282,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -303,22 +304,22 @@ impl KeyManagementAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -326,14 +327,16 @@ impl KeyManagementAPI { pub async fn create_application_key( &self, body: crate::datadogV1::model::ApplicationKey, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::ApplicationKeyResponse, + datadog::Error, + > { match self.create_application_key_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -347,8 +350,8 @@ impl KeyManagementAPI { &self, body: crate::datadogV1::model::ApplicationKey, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_application_key"; @@ -374,7 +377,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -397,7 +400,7 @@ impl KeyManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -408,7 +411,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -418,7 +421,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -428,7 +431,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -452,23 +455,23 @@ impl KeyManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -476,13 +479,13 @@ impl KeyManagementAPI { pub async fn delete_api_key( &self, key: String, - ) -> Result> { + ) -> Result> { match self.delete_api_key_with_http_info(key).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -495,8 +498,10 @@ impl KeyManagementAPI { pub async fn delete_api_key_with_http_info( &self, key: String, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.delete_api_key"; @@ -505,7 +510,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v1/api_key/{key}", local_configuration.get_operation_host(operation_id), - key = urlencode(key) + key = datadog::urlencode(key) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -521,7 +526,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -552,22 +557,22 @@ impl KeyManagementAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -575,14 +580,16 @@ impl KeyManagementAPI { pub async fn delete_application_key( &self, key: String, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::ApplicationKeyResponse, + datadog::Error, + > { match self.delete_application_key_with_http_info(key).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -596,8 +603,8 @@ impl KeyManagementAPI { &self, key: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.delete_application_key"; @@ -607,7 +614,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v1/application_key/{key}", local_configuration.get_operation_host(operation_id), - key = urlencode(key) + key = datadog::urlencode(key) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -623,7 +630,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -656,23 +663,23 @@ impl KeyManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -680,13 +687,13 @@ impl KeyManagementAPI { pub async fn get_api_key( &self, key: String, - ) -> Result> { + ) -> Result> { match self.get_api_key_with_http_info(key).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -699,8 +706,10 @@ impl KeyManagementAPI { pub async fn get_api_key_with_http_info( &self, key: String, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_api_key"; @@ -709,7 +718,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v1/api_key/{key}", local_configuration.get_operation_host(operation_id), - key = urlencode(key) + key = datadog::urlencode(key) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -725,7 +734,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -756,22 +765,22 @@ impl KeyManagementAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -779,14 +788,16 @@ impl KeyManagementAPI { pub async fn get_application_key( &self, key: String, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::ApplicationKeyResponse, + datadog::Error, + > { match self.get_application_key_with_http_info(key).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -800,8 +811,8 @@ impl KeyManagementAPI { &self, key: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_application_key"; @@ -811,7 +822,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v1/application_key/{key}", local_configuration.get_operation_host(operation_id), - key = urlencode(key) + key = datadog::urlencode(key) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -827,7 +838,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -860,36 +871,36 @@ impl KeyManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// Get all API keys available for your account. pub async fn list_api_keys( &self, - ) -> Result> { + ) -> Result> { match self.list_api_keys_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -901,8 +912,10 @@ impl KeyManagementAPI { /// Get all API keys available for your account. pub async fn list_api_keys_with_http_info( &self, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.list_api_keys"; @@ -926,7 +939,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -959,36 +972,38 @@ impl KeyManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// Get all application keys available for your Datadog account. pub async fn list_application_keys( &self, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::ApplicationKeyListResponse, + datadog::Error, + > { match self.list_application_keys_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1001,8 +1016,8 @@ impl KeyManagementAPI { pub async fn list_application_keys_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_application_keys"; @@ -1027,7 +1042,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1060,23 +1075,23 @@ impl KeyManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1085,13 +1100,13 @@ impl KeyManagementAPI { &self, key: String, body: crate::datadogV1::model::ApiKey, - ) -> Result> { + ) -> Result> { match self.update_api_key_with_http_info(key, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1105,8 +1120,10 @@ impl KeyManagementAPI { &self, key: String, body: crate::datadogV1::model::ApiKey, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.update_api_key"; @@ -1115,7 +1132,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v1/api_key/{key}", local_configuration.get_operation_host(operation_id), - key = urlencode(key) + key = datadog::urlencode(key) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -1132,7 +1149,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1155,7 +1172,7 @@ impl KeyManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1166,7 +1183,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1176,7 +1193,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1186,7 +1203,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1208,22 +1225,22 @@ impl KeyManagementAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1232,14 +1249,16 @@ impl KeyManagementAPI { &self, key: String, body: crate::datadogV1::model::ApplicationKey, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::ApplicationKeyResponse, + datadog::Error, + > { match self.update_application_key_with_http_info(key, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1254,8 +1273,8 @@ impl KeyManagementAPI { key: String, body: crate::datadogV1::model::ApplicationKey, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.update_application_key"; @@ -1265,7 +1284,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v1/application_key/{key}", local_configuration.get_operation_host(operation_id), - key = urlencode(key) + key = datadog::urlencode(key) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -1282,7 +1301,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1305,7 +1324,7 @@ impl KeyManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1316,7 +1335,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1326,7 +1345,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1336,7 +1355,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1360,23 +1379,23 @@ impl KeyManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_logs.rs b/src/datadogV1/api/api_logs.rs index aa00ee128..7e82f6b5a 100644 --- a/src/datadogV1/api/api_logs.rs +++ b/src/datadogV1/api/api_logs.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -55,13 +54,13 @@ pub enum SubmitLogError { #[derive(Debug, Clone)] pub struct LogsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for LogsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -69,7 +68,7 @@ impl LogsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -111,7 +110,7 @@ impl LogsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -129,13 +128,13 @@ impl LogsAPI { pub async fn list_logs( &self, body: crate::datadogV1::model::LogsListRequest, - ) -> Result> { + ) -> Result> { match self.list_logs_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -156,8 +155,10 @@ impl LogsAPI { pub async fn list_logs_with_http_info( &self, body: crate::datadogV1::model::LogsListRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.list_logs"; @@ -182,7 +183,7 @@ impl LogsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -205,7 +206,7 @@ impl LogsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -216,7 +217,7 @@ impl LogsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -226,7 +227,7 @@ impl LogsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -236,7 +237,7 @@ impl LogsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -259,22 +260,22 @@ impl LogsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -301,13 +302,14 @@ impl LogsAPI { &self, body: Vec, params: SubmitLogOptionalParams, - ) -> Result, Error> { + ) -> Result, datadog::Error> + { match self.submit_log_with_http_info(body, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -340,8 +342,8 @@ impl LogsAPI { body: Vec, params: SubmitLogOptionalParams, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.submit_log"; @@ -386,7 +388,7 @@ impl LogsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -402,7 +404,7 @@ impl LogsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -413,7 +415,7 @@ impl LogsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -423,7 +425,7 @@ impl LogsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -433,7 +435,7 @@ impl LogsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -457,22 +459,22 @@ impl LogsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_logs_indexes.rs b/src/datadogV1/api/api_logs_indexes.rs index f13c74220..698faa681 100644 --- a/src/datadogV1/api/api_logs_indexes.rs +++ b/src/datadogV1/api/api_logs_indexes.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -71,13 +70,13 @@ pub enum UpdateLogsIndexOrderError { #[derive(Debug, Clone)] pub struct LogsIndexesAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for LogsIndexesAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -85,7 +84,7 @@ impl LogsIndexesAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -127,7 +126,7 @@ impl LogsIndexesAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -137,13 +136,13 @@ impl LogsIndexesAPI { pub async fn create_logs_index( &self, body: crate::datadogV1::model::LogsIndex, - ) -> Result> { + ) -> Result> { match self.create_logs_index_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -156,8 +155,10 @@ impl LogsIndexesAPI { pub async fn create_logs_index_with_http_info( &self, body: crate::datadogV1::model::LogsIndex, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.create_logs_index"; @@ -182,7 +183,7 @@ impl LogsIndexesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -205,7 +206,7 @@ impl LogsIndexesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -216,7 +217,7 @@ impl LogsIndexesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -226,7 +227,7 @@ impl LogsIndexesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -236,7 +237,7 @@ impl LogsIndexesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -258,23 +259,23 @@ impl LogsIndexesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -282,13 +283,13 @@ impl LogsIndexesAPI { pub async fn get_logs_index( &self, name: String, - ) -> Result> { + ) -> Result> { match self.get_logs_index_with_http_info(name).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -301,7 +302,10 @@ impl LogsIndexesAPI { pub async fn get_logs_index_with_http_info( &self, name: String, - ) -> Result, Error> { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_logs_index"; @@ -310,7 +314,7 @@ impl LogsIndexesAPI { let local_uri_str = format!( "{}/api/v1/logs/config/indexes/{name}", local_configuration.get_operation_host(operation_id), - name = urlencode(name) + name = datadog::urlencode(name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -326,7 +330,7 @@ impl LogsIndexesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -357,35 +361,36 @@ impl LogsIndexesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// Get the current order of your log indexes. This endpoint takes no JSON arguments. pub async fn get_logs_index_order( &self, - ) -> Result> { + ) -> Result> + { match self.get_logs_index_order_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -398,8 +403,8 @@ impl LogsIndexesAPI { pub async fn get_logs_index_order_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_logs_index_order"; @@ -424,7 +429,7 @@ impl LogsIndexesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -456,23 +461,23 @@ impl LogsIndexesAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -480,13 +485,14 @@ impl LogsIndexesAPI { /// This endpoint returns an array of the `LogIndex` objects of your organization. pub async fn list_log_indexes( &self, - ) -> Result> { + ) -> Result> + { match self.list_log_indexes_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -500,8 +506,8 @@ impl LogsIndexesAPI { pub async fn list_log_indexes_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_log_indexes"; @@ -526,7 +532,7 @@ impl LogsIndexesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -559,23 +565,23 @@ impl LogsIndexesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -588,13 +594,13 @@ impl LogsIndexesAPI { &self, name: String, body: crate::datadogV1::model::LogsIndexUpdateRequest, - ) -> Result> { + ) -> Result> { match self.update_logs_index_with_http_info(name, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -612,8 +618,10 @@ impl LogsIndexesAPI { &self, name: String, body: crate::datadogV1::model::LogsIndexUpdateRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.update_logs_index"; @@ -622,7 +630,7 @@ impl LogsIndexesAPI { let local_uri_str = format!( "{}/api/v1/logs/config/indexes/{name}", local_configuration.get_operation_host(operation_id), - name = urlencode(name) + name = datadog::urlencode(name) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -639,7 +647,7 @@ impl LogsIndexesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -662,7 +670,7 @@ impl LogsIndexesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -673,7 +681,7 @@ impl LogsIndexesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -683,7 +691,7 @@ impl LogsIndexesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -693,7 +701,7 @@ impl LogsIndexesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -715,23 +723,23 @@ impl LogsIndexesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -740,13 +748,14 @@ impl LogsIndexesAPI { pub async fn update_logs_index_order( &self, body: crate::datadogV1::model::LogsIndexesOrder, - ) -> Result> { + ) -> Result> + { match self.update_logs_index_order_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -761,8 +770,8 @@ impl LogsIndexesAPI { &self, body: crate::datadogV1::model::LogsIndexesOrder, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.update_logs_index_order"; @@ -788,7 +797,7 @@ impl LogsIndexesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -811,7 +820,7 @@ impl LogsIndexesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -822,7 +831,7 @@ impl LogsIndexesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -832,7 +841,7 @@ impl LogsIndexesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -842,7 +851,7 @@ impl LogsIndexesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -865,23 +874,23 @@ impl LogsIndexesAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_logs_pipelines.rs b/src/datadogV1/api/api_logs_pipelines.rs index 230af2d68..32d3b48d4 100644 --- a/src/datadogV1/api/api_logs_pipelines.rs +++ b/src/datadogV1/api/api_logs_pipelines.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -82,13 +81,13 @@ pub enum UpdateLogsPipelineOrderError { #[derive(Debug, Clone)] pub struct LogsPipelinesAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for LogsPipelinesAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -96,7 +95,7 @@ impl LogsPipelinesAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -138,7 +137,7 @@ impl LogsPipelinesAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -148,13 +147,14 @@ impl LogsPipelinesAPI { pub async fn create_logs_pipeline( &self, body: crate::datadogV1::model::LogsPipeline, - ) -> Result> { + ) -> Result> + { match self.create_logs_pipeline_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -168,8 +168,8 @@ impl LogsPipelinesAPI { &self, body: crate::datadogV1::model::LogsPipeline, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_logs_pipeline"; @@ -195,7 +195,7 @@ impl LogsPipelinesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -218,7 +218,7 @@ impl LogsPipelinesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -229,7 +229,7 @@ impl LogsPipelinesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -239,7 +239,7 @@ impl LogsPipelinesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -249,7 +249,7 @@ impl LogsPipelinesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -271,23 +271,23 @@ impl LogsPipelinesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -296,7 +296,7 @@ impl LogsPipelinesAPI { pub async fn delete_logs_pipeline( &self, pipeline_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.delete_logs_pipeline_with_http_info(pipeline_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -308,7 +308,7 @@ impl LogsPipelinesAPI { pub async fn delete_logs_pipeline_with_http_info( &self, pipeline_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v1.delete_logs_pipeline"; @@ -317,7 +317,7 @@ impl LogsPipelinesAPI { let local_uri_str = format!( "{}/api/v1/logs/config/pipelines/{pipeline_id}", local_configuration.get_operation_host(operation_id), - pipeline_id = urlencode(pipeline_id) + pipeline_id = datadog::urlencode(pipeline_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -333,7 +333,7 @@ impl LogsPipelinesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -362,7 +362,7 @@ impl LogsPipelinesAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -370,12 +370,12 @@ impl LogsPipelinesAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -384,13 +384,13 @@ impl LogsPipelinesAPI { pub async fn get_logs_pipeline( &self, pipeline_id: String, - ) -> Result> { + ) -> Result> { match self.get_logs_pipeline_with_http_info(pipeline_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -404,8 +404,10 @@ impl LogsPipelinesAPI { pub async fn get_logs_pipeline_with_http_info( &self, pipeline_id: String, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_logs_pipeline"; @@ -414,7 +416,7 @@ impl LogsPipelinesAPI { let local_uri_str = format!( "{}/api/v1/logs/config/pipelines/{pipeline_id}", local_configuration.get_operation_host(operation_id), - pipeline_id = urlencode(pipeline_id) + pipeline_id = datadog::urlencode(pipeline_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -430,7 +432,7 @@ impl LogsPipelinesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -461,23 +463,23 @@ impl LogsPipelinesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -485,13 +487,16 @@ impl LogsPipelinesAPI { /// This endpoint takes no JSON arguments. pub async fn get_logs_pipeline_order( &self, - ) -> Result> { + ) -> Result< + crate::datadogV1::model::LogsPipelinesOrder, + datadog::Error, + > { match self.get_logs_pipeline_order_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -505,8 +510,8 @@ impl LogsPipelinesAPI { pub async fn get_logs_pipeline_order_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_logs_pipeline_order"; @@ -531,7 +536,7 @@ impl LogsPipelinesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -564,23 +569,23 @@ impl LogsPipelinesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -588,13 +593,14 @@ impl LogsPipelinesAPI { /// This endpoint takes no JSON arguments. pub async fn list_logs_pipelines( &self, - ) -> Result, Error> { + ) -> Result, datadog::Error> + { match self.list_logs_pipelines_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -608,8 +614,8 @@ impl LogsPipelinesAPI { pub async fn list_logs_pipelines_with_http_info( &self, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_logs_pipelines"; @@ -634,7 +640,7 @@ impl LogsPipelinesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -666,23 +672,23 @@ impl LogsPipelinesAPI { match serde_json::from_str::>(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -694,7 +700,8 @@ impl LogsPipelinesAPI { &self, pipeline_id: String, body: crate::datadogV1::model::LogsPipeline, - ) -> Result> { + ) -> Result> + { match self .update_logs_pipeline_with_http_info(pipeline_id, body) .await @@ -703,7 +710,7 @@ impl LogsPipelinesAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -721,8 +728,8 @@ impl LogsPipelinesAPI { pipeline_id: String, body: crate::datadogV1::model::LogsPipeline, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.update_logs_pipeline"; @@ -732,7 +739,7 @@ impl LogsPipelinesAPI { let local_uri_str = format!( "{}/api/v1/logs/config/pipelines/{pipeline_id}", local_configuration.get_operation_host(operation_id), - pipeline_id = urlencode(pipeline_id) + pipeline_id = datadog::urlencode(pipeline_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -749,7 +756,7 @@ impl LogsPipelinesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -772,7 +779,7 @@ impl LogsPipelinesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -783,7 +790,7 @@ impl LogsPipelinesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -793,7 +800,7 @@ impl LogsPipelinesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -803,7 +810,7 @@ impl LogsPipelinesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -825,23 +832,23 @@ impl LogsPipelinesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -853,14 +860,16 @@ impl LogsPipelinesAPI { pub async fn update_logs_pipeline_order( &self, body: crate::datadogV1::model::LogsPipelinesOrder, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::LogsPipelinesOrder, + datadog::Error, + > { match self.update_logs_pipeline_order_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -878,8 +887,8 @@ impl LogsPipelinesAPI { &self, body: crate::datadogV1::model::LogsPipelinesOrder, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.update_logs_pipeline_order"; @@ -905,7 +914,7 @@ impl LogsPipelinesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -928,7 +937,7 @@ impl LogsPipelinesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -939,7 +948,7 @@ impl LogsPipelinesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -949,7 +958,7 @@ impl LogsPipelinesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -959,7 +968,7 @@ impl LogsPipelinesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -983,23 +992,23 @@ impl LogsPipelinesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_metrics.rs b/src/datadogV1/api/api_metrics.rs index 9240ccc0b..dfb42dc1b 100644 --- a/src/datadogV1/api/api_metrics.rs +++ b/src/datadogV1/api/api_metrics.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -153,13 +152,13 @@ pub enum UpdateMetricMetadataError { #[derive(Debug, Clone)] pub struct MetricsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for MetricsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -167,7 +166,7 @@ impl MetricsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -209,7 +208,7 @@ impl MetricsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -219,13 +218,14 @@ impl MetricsAPI { pub async fn get_metric_metadata( &self, metric_name: String, - ) -> Result> { + ) -> Result> + { match self.get_metric_metadata_with_http_info(metric_name).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -239,8 +239,8 @@ impl MetricsAPI { &self, metric_name: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_metric_metadata"; @@ -250,7 +250,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v1/metrics/{metric_name}", local_configuration.get_operation_host(operation_id), - metric_name = urlencode(metric_name) + metric_name = datadog::urlencode(metric_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -266,7 +266,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -297,23 +297,23 @@ impl MetricsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -322,13 +322,14 @@ impl MetricsAPI { &self, from: i64, params: ListActiveMetricsOptionalParams, - ) -> Result> { + ) -> Result> + { match self.list_active_metrics_with_http_info(from, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -343,8 +344,8 @@ impl MetricsAPI { from: i64, params: ListActiveMetricsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_active_metrics"; @@ -383,7 +384,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -416,23 +417,23 @@ impl MetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -440,13 +441,14 @@ impl MetricsAPI { pub async fn list_metrics( &self, q: String, - ) -> Result> { + ) -> Result> + { match self.list_metrics_with_http_info(q).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -460,8 +462,8 @@ impl MetricsAPI { &self, q: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_metrics"; @@ -488,7 +490,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -521,22 +523,22 @@ impl MetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -546,13 +548,14 @@ impl MetricsAPI { from: i64, to: i64, query: String, - ) -> Result> { + ) -> Result> + { match self.query_metrics_with_http_info(from, to, query).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -568,8 +571,8 @@ impl MetricsAPI { to: i64, query: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.query_metrics"; @@ -598,7 +601,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -631,22 +634,22 @@ impl MetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -655,8 +658,10 @@ impl MetricsAPI { &self, body: crate::datadogV1::model::DistributionPointsPayload, params: SubmitDistributionPointsOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::IntakePayloadAccepted, + datadog::Error, + > { match self .submit_distribution_points_with_http_info(body, params) .await @@ -665,7 +670,7 @@ impl MetricsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -680,8 +685,8 @@ impl MetricsAPI { body: crate::datadogV1::model::DistributionPointsPayload, params: SubmitDistributionPointsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.submit_distribution_points"; @@ -720,7 +725,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -736,7 +741,7 @@ impl MetricsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -747,7 +752,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -757,7 +762,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -767,7 +772,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -791,23 +796,23 @@ impl MetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -826,13 +831,14 @@ impl MetricsAPI { &self, body: crate::datadogV1::model::MetricsPayload, params: SubmitMetricsOptionalParams, - ) -> Result> { + ) -> Result> + { match self.submit_metrics_with_http_info(body, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -857,8 +863,8 @@ impl MetricsAPI { body: crate::datadogV1::model::MetricsPayload, params: SubmitMetricsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.submit_metrics"; @@ -897,7 +903,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -913,7 +919,7 @@ impl MetricsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -924,7 +930,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -934,7 +940,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -944,7 +950,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -968,23 +974,23 @@ impl MetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -993,7 +999,8 @@ impl MetricsAPI { &self, metric_name: String, body: crate::datadogV1::model::MetricMetadata, - ) -> Result> { + ) -> Result> + { match self .update_metric_metadata_with_http_info(metric_name, body) .await @@ -1002,7 +1009,7 @@ impl MetricsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1017,8 +1024,8 @@ impl MetricsAPI { metric_name: String, body: crate::datadogV1::model::MetricMetadata, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.update_metric_metadata"; @@ -1028,7 +1035,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v1/metrics/{metric_name}", local_configuration.get_operation_host(operation_id), - metric_name = urlencode(metric_name) + metric_name = datadog::urlencode(metric_name) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -1045,7 +1052,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1068,7 +1075,7 @@ impl MetricsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1079,7 +1086,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1089,7 +1096,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1099,7 +1106,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1121,23 +1128,23 @@ impl MetricsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_monitors.rs b/src/datadogV1/api/api_monitors.rs index 588b73b38..46ad8aa86 100644 --- a/src/datadogV1/api/api_monitors.rs +++ b/src/datadogV1/api/api_monitors.rs @@ -1,14 +1,13 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -349,13 +348,13 @@ pub enum ValidateMonitorError { #[derive(Debug, Clone)] pub struct MonitorsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for MonitorsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -363,7 +362,7 @@ impl MonitorsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -405,7 +404,7 @@ impl MonitorsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -417,7 +416,7 @@ impl MonitorsAPI { monitor_ids: Vec, ) -> Result< crate::datadogV1::model::CheckCanDeleteMonitorResponse, - Error, + datadog::Error, > { match self .check_can_delete_monitor_with_http_info(monitor_ids) @@ -427,7 +426,7 @@ impl MonitorsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -441,8 +440,8 @@ impl MonitorsAPI { &self, monitor_ids: Vec, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.check_can_delete_monitor"; @@ -477,7 +476,7 @@ impl MonitorsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -510,23 +509,23 @@ impl MonitorsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -713,13 +712,13 @@ impl MonitorsAPI { pub async fn create_monitor( &self, body: crate::datadogV1::model::Monitor, - ) -> Result> { + ) -> Result> { match self.create_monitor_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -911,7 +910,10 @@ impl MonitorsAPI { pub async fn create_monitor_with_http_info( &self, body: crate::datadogV1::model::Monitor, - ) -> Result, Error> { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.create_monitor"; @@ -936,7 +938,7 @@ impl MonitorsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -959,7 +961,7 @@ impl MonitorsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -970,7 +972,7 @@ impl MonitorsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -980,7 +982,7 @@ impl MonitorsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -990,7 +992,7 @@ impl MonitorsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1012,23 +1014,23 @@ impl MonitorsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1037,13 +1039,13 @@ impl MonitorsAPI { &self, monitor_id: i64, params: DeleteMonitorOptionalParams, - ) -> Result> { + ) -> Result> { match self.delete_monitor_with_http_info(monitor_id, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1057,8 +1059,10 @@ impl MonitorsAPI { &self, monitor_id: i64, params: DeleteMonitorOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.delete_monitor"; @@ -1091,7 +1095,7 @@ impl MonitorsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1122,23 +1126,23 @@ impl MonitorsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1147,13 +1151,13 @@ impl MonitorsAPI { &self, monitor_id: i64, params: GetMonitorOptionalParams, - ) -> Result> { + ) -> Result> { match self.get_monitor_with_http_info(monitor_id, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1167,7 +1171,10 @@ impl MonitorsAPI { &self, monitor_id: i64, params: GetMonitorOptionalParams, - ) -> Result, Error> { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_monitor"; @@ -1205,7 +1212,7 @@ impl MonitorsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1236,22 +1243,22 @@ impl MonitorsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1259,13 +1266,13 @@ impl MonitorsAPI { pub async fn list_monitors( &self, params: ListMonitorsOptionalParams, - ) -> Result, Error> { + ) -> Result, datadog::Error> { match self.list_monitors_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1277,8 +1284,9 @@ impl MonitorsAPI { pub fn list_monitors_with_pagination( &self, mut params: ListMonitorsOptionalParams, - ) -> impl Stream>> + '_ - { + ) -> impl Stream< + Item = Result>, + > + '_ { try_stream! { let mut page_size: i32 = 100; if params.page_size.is_none() { @@ -1310,8 +1318,10 @@ impl MonitorsAPI { pub async fn list_monitors_with_http_info( &self, params: ListMonitorsOptionalParams, - ) -> Result>, Error> - { + ) -> Result< + datadog::ResponseContent>, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.list_monitors"; @@ -1378,7 +1388,7 @@ impl MonitorsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1409,22 +1419,22 @@ impl MonitorsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::>(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1432,14 +1442,16 @@ impl MonitorsAPI { pub async fn search_monitor_groups( &self, params: SearchMonitorGroupsOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::MonitorGroupSearchResponse, + datadog::Error, + > { match self.search_monitor_groups_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1453,8 +1465,8 @@ impl MonitorsAPI { &self, params: SearchMonitorGroupsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.search_monitor_groups"; @@ -1502,7 +1514,7 @@ impl MonitorsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1535,23 +1547,23 @@ impl MonitorsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1559,13 +1571,14 @@ impl MonitorsAPI { pub async fn search_monitors( &self, params: SearchMonitorsOptionalParams, - ) -> Result> { + ) -> Result> + { match self.search_monitors_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1579,8 +1592,8 @@ impl MonitorsAPI { &self, params: SearchMonitorsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.search_monitors"; @@ -1628,7 +1641,7 @@ impl MonitorsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1661,23 +1674,23 @@ impl MonitorsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1686,13 +1699,13 @@ impl MonitorsAPI { &self, monitor_id: i64, body: crate::datadogV1::model::MonitorUpdateRequest, - ) -> Result> { + ) -> Result> { match self.update_monitor_with_http_info(monitor_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1706,7 +1719,10 @@ impl MonitorsAPI { &self, monitor_id: i64, body: crate::datadogV1::model::MonitorUpdateRequest, - ) -> Result, Error> { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.update_monitor"; @@ -1732,7 +1748,7 @@ impl MonitorsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1755,7 +1771,7 @@ impl MonitorsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1766,7 +1782,7 @@ impl MonitorsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1776,7 +1792,7 @@ impl MonitorsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1786,7 +1802,7 @@ impl MonitorsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1808,23 +1824,23 @@ impl MonitorsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1835,7 +1851,7 @@ impl MonitorsAPI { body: crate::datadogV1::model::Monitor, ) -> Result< std::collections::BTreeMap, - Error, + datadog::Error, > { match self .validate_existing_monitor_with_http_info(monitor_id, body) @@ -1845,7 +1861,7 @@ impl MonitorsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1860,8 +1876,8 @@ impl MonitorsAPI { monitor_id: i64, body: crate::datadogV1::model::Monitor, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.validate_existing_monitor"; @@ -1888,7 +1904,7 @@ impl MonitorsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1911,7 +1927,7 @@ impl MonitorsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1922,7 +1938,7 @@ impl MonitorsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1932,7 +1948,7 @@ impl MonitorsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1942,7 +1958,7 @@ impl MonitorsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1966,23 +1982,23 @@ impl MonitorsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1992,14 +2008,16 @@ impl MonitorsAPI { pub async fn validate_monitor( &self, body: crate::datadogV1::model::Monitor, - ) -> Result, Error> - { + ) -> Result< + std::collections::BTreeMap, + datadog::Error, + > { match self.validate_monitor_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2015,8 +2033,8 @@ impl MonitorsAPI { &self, body: crate::datadogV1::model::Monitor, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.validate_monitor"; @@ -2042,7 +2060,7 @@ impl MonitorsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2065,7 +2083,7 @@ impl MonitorsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -2076,7 +2094,7 @@ impl MonitorsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -2086,7 +2104,7 @@ impl MonitorsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -2096,7 +2114,7 @@ impl MonitorsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -2120,23 +2138,23 @@ impl MonitorsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_notebooks.rs b/src/datadogV1/api/api_notebooks.rs index f0ca73cd8..b14077a84 100644 --- a/src/datadogV1/api/api_notebooks.rs +++ b/src/datadogV1/api/api_notebooks.rs @@ -1,14 +1,13 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -148,13 +147,13 @@ pub enum UpdateNotebookError { #[derive(Debug, Clone)] pub struct NotebooksAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for NotebooksAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -162,7 +161,7 @@ impl NotebooksAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -204,7 +203,7 @@ impl NotebooksAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -214,13 +213,14 @@ impl NotebooksAPI { pub async fn create_notebook( &self, body: crate::datadogV1::model::NotebookCreateRequest, - ) -> Result> { + ) -> Result> + { match self.create_notebook_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -234,8 +234,8 @@ impl NotebooksAPI { &self, body: crate::datadogV1::model::NotebookCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_notebook"; @@ -261,7 +261,7 @@ impl NotebooksAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -284,7 +284,7 @@ impl NotebooksAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -295,7 +295,7 @@ impl NotebooksAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -305,7 +305,7 @@ impl NotebooksAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -315,7 +315,7 @@ impl NotebooksAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -338,23 +338,23 @@ impl NotebooksAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -362,7 +362,7 @@ impl NotebooksAPI { pub async fn delete_notebook( &self, notebook_id: i64, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.delete_notebook_with_http_info(notebook_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -373,7 +373,7 @@ impl NotebooksAPI { pub async fn delete_notebook_with_http_info( &self, notebook_id: i64, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v1.delete_notebook"; @@ -398,7 +398,7 @@ impl NotebooksAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -427,7 +427,7 @@ impl NotebooksAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -435,12 +435,12 @@ impl NotebooksAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -448,13 +448,13 @@ impl NotebooksAPI { pub async fn get_notebook( &self, notebook_id: i64, - ) -> Result> { + ) -> Result> { match self.get_notebook_with_http_info(notebook_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -467,8 +467,10 @@ impl NotebooksAPI { pub async fn get_notebook_with_http_info( &self, notebook_id: i64, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_notebook"; @@ -493,7 +495,7 @@ impl NotebooksAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -525,22 +527,22 @@ impl NotebooksAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -549,13 +551,14 @@ impl NotebooksAPI { pub async fn list_notebooks( &self, params: ListNotebooksOptionalParams, - ) -> Result> { + ) -> Result> + { match self.list_notebooks_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -568,7 +571,10 @@ impl NotebooksAPI { &self, mut params: ListNotebooksOptionalParams, ) -> impl Stream< - Item = Result>, + Item = Result< + crate::datadogV1::model::NotebooksResponseData, + datadog::Error, + >, > + '_ { try_stream! { let mut page_size: i64 = 100; @@ -605,8 +611,8 @@ impl NotebooksAPI { &self, params: ListNotebooksOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_notebooks"; @@ -684,7 +690,7 @@ impl NotebooksAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -716,23 +722,23 @@ impl NotebooksAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -741,13 +747,14 @@ impl NotebooksAPI { &self, notebook_id: i64, body: crate::datadogV1::model::NotebookUpdateRequest, - ) -> Result> { + ) -> Result> + { match self.update_notebook_with_http_info(notebook_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -762,8 +769,8 @@ impl NotebooksAPI { notebook_id: i64, body: crate::datadogV1::model::NotebookUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.update_notebook"; @@ -790,7 +797,7 @@ impl NotebooksAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -813,7 +820,7 @@ impl NotebooksAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -824,7 +831,7 @@ impl NotebooksAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -834,7 +841,7 @@ impl NotebooksAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -844,7 +851,7 @@ impl NotebooksAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -867,23 +874,23 @@ impl NotebooksAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_organizations.rs b/src/datadogV1/api/api_organizations.rs index a5bf0c8e7..9fef7502a 100644 --- a/src/datadogV1/api/api_organizations.rs +++ b/src/datadogV1/api/api_organizations.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -73,13 +72,13 @@ pub enum UploadIdPForOrgError { #[derive(Debug, Clone)] pub struct OrganizationsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for OrganizationsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -87,7 +86,7 @@ impl OrganizationsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -129,7 +128,7 @@ impl OrganizationsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -148,14 +147,16 @@ impl OrganizationsAPI { pub async fn create_child_org( &self, body: crate::datadogV1::model::OrganizationCreateBody, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::OrganizationCreateResponse, + datadog::Error, + > { match self.create_child_org_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -178,8 +179,8 @@ impl OrganizationsAPI { &self, body: crate::datadogV1::model::OrganizationCreateBody, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_child_org"; @@ -205,7 +206,7 @@ impl OrganizationsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -228,7 +229,7 @@ impl OrganizationsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -239,7 +240,7 @@ impl OrganizationsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -249,7 +250,7 @@ impl OrganizationsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -259,7 +260,7 @@ impl OrganizationsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -283,23 +284,23 @@ impl OrganizationsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -307,13 +308,14 @@ impl OrganizationsAPI { pub async fn downgrade_org( &self, public_id: String, - ) -> Result> { + ) -> Result> + { match self.downgrade_org_with_http_info(public_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -327,8 +329,8 @@ impl OrganizationsAPI { &self, public_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.downgrade_org"; @@ -338,7 +340,7 @@ impl OrganizationsAPI { let local_uri_str = format!( "{}/api/v1/org/{public_id}/downgrade", local_configuration.get_operation_host(operation_id), - public_id = urlencode(public_id) + public_id = datadog::urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -354,7 +356,7 @@ impl OrganizationsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -387,22 +389,22 @@ impl OrganizationsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -410,13 +412,13 @@ impl OrganizationsAPI { pub async fn get_org( &self, public_id: String, - ) -> Result> { + ) -> Result> { match self.get_org_with_http_info(public_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -429,8 +431,10 @@ impl OrganizationsAPI { pub async fn get_org_with_http_info( &self, public_id: String, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_org"; @@ -439,7 +443,7 @@ impl OrganizationsAPI { let local_uri_str = format!( "{}/api/v1/org/{public_id}", local_configuration.get_operation_host(operation_id), - public_id = urlencode(public_id) + public_id = datadog::urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -455,7 +459,7 @@ impl OrganizationsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -488,35 +492,36 @@ impl OrganizationsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// This endpoint returns data on your top-level organization. pub async fn list_orgs( &self, - ) -> Result> { + ) -> Result> + { match self.list_orgs_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -529,8 +534,8 @@ impl OrganizationsAPI { pub async fn list_orgs_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_orgs"; @@ -555,7 +560,7 @@ impl OrganizationsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -588,22 +593,22 @@ impl OrganizationsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -612,13 +617,13 @@ impl OrganizationsAPI { &self, public_id: String, body: crate::datadogV1::model::Organization, - ) -> Result> { + ) -> Result> { match self.update_org_with_http_info(public_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -632,8 +637,10 @@ impl OrganizationsAPI { &self, public_id: String, body: crate::datadogV1::model::Organization, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.update_org"; @@ -642,7 +649,7 @@ impl OrganizationsAPI { let local_uri_str = format!( "{}/api/v1/org/{public_id}", local_configuration.get_operation_host(operation_id), - public_id = urlencode(public_id) + public_id = datadog::urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -659,7 +666,7 @@ impl OrganizationsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -682,7 +689,7 @@ impl OrganizationsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -693,7 +700,7 @@ impl OrganizationsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -703,7 +710,7 @@ impl OrganizationsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -713,7 +720,7 @@ impl OrganizationsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -737,22 +744,22 @@ impl OrganizationsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -766,7 +773,7 @@ impl OrganizationsAPI { &self, public_id: String, idp_file: Vec, - ) -> Result> { + ) -> Result> { match self .upload_idp_for_org_with_http_info(public_id, idp_file) .await @@ -775,7 +782,7 @@ impl OrganizationsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -794,8 +801,10 @@ impl OrganizationsAPI { &self, public_id: String, idp_file: Vec, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.upload_idp_for_org"; @@ -804,7 +813,7 @@ impl OrganizationsAPI { let local_uri_str = format!( "{}/api/v1/org/{public_id}/idp_metadata", local_configuration.get_operation_host(operation_id), - public_id = urlencode(public_id) + public_id = datadog::urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -824,7 +833,7 @@ impl OrganizationsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -876,23 +885,23 @@ impl OrganizationsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_pager_duty_integration.rs b/src/datadogV1/api/api_pager_duty_integration.rs index 65bdc25bb..d55ecd1e1 100644 --- a/src/datadogV1/api/api_pager_duty_integration.rs +++ b/src/datadogV1/api/api_pager_duty_integration.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -54,13 +53,13 @@ pub enum UpdatePagerDutyIntegrationServiceError { #[derive(Debug, Clone)] pub struct PagerDutyIntegrationAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for PagerDutyIntegrationAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -68,7 +67,7 @@ impl PagerDutyIntegrationAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -110,7 +109,7 @@ impl PagerDutyIntegrationAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -122,7 +121,7 @@ impl PagerDutyIntegrationAPI { body: crate::datadogV1::model::PagerDutyService, ) -> Result< crate::datadogV1::model::PagerDutyServiceName, - Error, + datadog::Error, > { match self .create_pager_duty_integration_service_with_http_info(body) @@ -132,7 +131,7 @@ impl PagerDutyIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -146,8 +145,8 @@ impl PagerDutyIntegrationAPI { &self, body: crate::datadogV1::model::PagerDutyService, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_pager_duty_integration_service"; @@ -173,7 +172,7 @@ impl PagerDutyIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -196,7 +195,7 @@ impl PagerDutyIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -207,7 +206,7 @@ impl PagerDutyIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -217,7 +216,7 @@ impl PagerDutyIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -227,7 +226,7 @@ impl PagerDutyIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -251,23 +250,23 @@ impl PagerDutyIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -275,7 +274,7 @@ impl PagerDutyIntegrationAPI { pub async fn delete_pager_duty_integration_service( &self, service_name: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_pager_duty_integration_service_with_http_info(service_name) .await @@ -289,7 +288,8 @@ impl PagerDutyIntegrationAPI { pub async fn delete_pager_duty_integration_service_with_http_info( &self, service_name: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> + { let local_configuration = &self.config; let operation_id = "v1.delete_pager_duty_integration_service"; @@ -298,7 +298,7 @@ impl PagerDutyIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/pagerduty/configuration/services/{service_name}", local_configuration.get_operation_host(operation_id), - service_name = urlencode(service_name) + service_name = datadog::urlencode(service_name) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -314,7 +314,7 @@ impl PagerDutyIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -343,7 +343,7 @@ impl PagerDutyIntegrationAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -351,12 +351,12 @@ impl PagerDutyIntegrationAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -366,7 +366,7 @@ impl PagerDutyIntegrationAPI { service_name: String, ) -> Result< crate::datadogV1::model::PagerDutyServiceName, - Error, + datadog::Error, > { match self .get_pager_duty_integration_service_with_http_info(service_name) @@ -376,7 +376,7 @@ impl PagerDutyIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -390,8 +390,8 @@ impl PagerDutyIntegrationAPI { &self, service_name: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_pager_duty_integration_service"; @@ -401,7 +401,7 @@ impl PagerDutyIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/pagerduty/configuration/services/{service_name}", local_configuration.get_operation_host(operation_id), - service_name = urlencode(service_name) + service_name = datadog::urlencode(service_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -417,7 +417,7 @@ impl PagerDutyIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -450,23 +450,23 @@ impl PagerDutyIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -475,7 +475,7 @@ impl PagerDutyIntegrationAPI { &self, service_name: String, body: crate::datadogV1::model::PagerDutyServiceKey, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .update_pager_duty_integration_service_with_http_info(service_name, body) .await @@ -490,7 +490,8 @@ impl PagerDutyIntegrationAPI { &self, service_name: String, body: crate::datadogV1::model::PagerDutyServiceKey, - ) -> Result, Error> { + ) -> Result, datadog::Error> + { let local_configuration = &self.config; let operation_id = "v1.update_pager_duty_integration_service"; @@ -499,7 +500,7 @@ impl PagerDutyIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/pagerduty/configuration/services/{service_name}", local_configuration.get_operation_host(operation_id), - service_name = urlencode(service_name) + service_name = datadog::urlencode(service_name) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -516,7 +517,7 @@ impl PagerDutyIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -539,7 +540,7 @@ impl PagerDutyIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -550,7 +551,7 @@ impl PagerDutyIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -560,7 +561,7 @@ impl PagerDutyIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -570,7 +571,7 @@ impl PagerDutyIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -590,7 +591,7 @@ impl PagerDutyIntegrationAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -598,12 +599,12 @@ impl PagerDutyIntegrationAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_security_monitoring.rs b/src/datadogV1/api/api_security_monitoring.rs index f85978ba2..6e6180724 100644 --- a/src/datadogV1/api/api_security_monitoring.rs +++ b/src/datadogV1/api/api_security_monitoring.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -46,13 +45,13 @@ pub enum EditSecurityMonitoringSignalStateError { #[derive(Debug, Clone)] pub struct SecurityMonitoringAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for SecurityMonitoringAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -60,7 +59,7 @@ impl SecurityMonitoringAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -102,7 +101,7 @@ impl SecurityMonitoringAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -115,7 +114,7 @@ impl SecurityMonitoringAPI { body: crate::datadogV1::model::AddSignalToIncidentRequest, ) -> Result< crate::datadogV1::model::SuccessfulSignalUpdateResponse, - Error, + datadog::Error, > { match self .add_security_monitoring_signal_to_incident_with_http_info(signal_id, body) @@ -125,7 +124,7 @@ impl SecurityMonitoringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -140,8 +139,8 @@ impl SecurityMonitoringAPI { signal_id: String, body: crate::datadogV1::model::AddSignalToIncidentRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.add_security_monitoring_signal_to_incident"; @@ -151,7 +150,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v1/security_analytics/signals/{signal_id}/add_to_incident", local_configuration.get_operation_host(operation_id), - signal_id = urlencode(signal_id) + signal_id = datadog::urlencode(signal_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -168,7 +167,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -191,7 +190,7 @@ impl SecurityMonitoringAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -202,7 +201,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -212,7 +211,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -222,7 +221,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -246,23 +245,23 @@ impl SecurityMonitoringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -273,7 +272,7 @@ impl SecurityMonitoringAPI { body: crate::datadogV1::model::SignalAssigneeUpdateRequest, ) -> Result< crate::datadogV1::model::SuccessfulSignalUpdateResponse, - Error, + datadog::Error, > { match self .edit_security_monitoring_signal_assignee_with_http_info(signal_id, body) @@ -283,7 +282,7 @@ impl SecurityMonitoringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -298,8 +297,8 @@ impl SecurityMonitoringAPI { signal_id: String, body: crate::datadogV1::model::SignalAssigneeUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.edit_security_monitoring_signal_assignee"; @@ -309,7 +308,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v1/security_analytics/signals/{signal_id}/assignee", local_configuration.get_operation_host(operation_id), - signal_id = urlencode(signal_id) + signal_id = datadog::urlencode(signal_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -326,7 +325,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -349,7 +348,7 @@ impl SecurityMonitoringAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -360,7 +359,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -370,7 +369,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -380,7 +379,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -404,23 +403,23 @@ impl SecurityMonitoringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -431,7 +430,7 @@ impl SecurityMonitoringAPI { body: crate::datadogV1::model::SignalStateUpdateRequest, ) -> Result< crate::datadogV1::model::SuccessfulSignalUpdateResponse, - Error, + datadog::Error, > { match self .edit_security_monitoring_signal_state_with_http_info(signal_id, body) @@ -441,7 +440,7 @@ impl SecurityMonitoringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -456,8 +455,8 @@ impl SecurityMonitoringAPI { signal_id: String, body: crate::datadogV1::model::SignalStateUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.edit_security_monitoring_signal_state"; @@ -467,7 +466,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v1/security_analytics/signals/{signal_id}/state", local_configuration.get_operation_host(operation_id), - signal_id = urlencode(signal_id) + signal_id = datadog::urlencode(signal_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -484,7 +483,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -507,7 +506,7 @@ impl SecurityMonitoringAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -518,7 +517,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -528,7 +527,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -538,7 +537,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -562,23 +561,23 @@ impl SecurityMonitoringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_service_checks.rs b/src/datadogV1/api/api_service_checks.rs index ea2aa7dab..c85f076b7 100644 --- a/src/datadogV1/api/api_service_checks.rs +++ b/src/datadogV1/api/api_service_checks.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -25,13 +24,13 @@ pub enum SubmitServiceCheckError { #[derive(Debug, Clone)] pub struct ServiceChecksAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for ServiceChecksAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -39,7 +38,7 @@ impl ServiceChecksAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -81,7 +80,7 @@ impl ServiceChecksAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -95,14 +94,16 @@ impl ServiceChecksAPI { pub async fn submit_service_check( &self, body: Vec, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::IntakePayloadAccepted, + datadog::Error, + > { match self.submit_service_check_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -120,8 +121,8 @@ impl ServiceChecksAPI { &self, body: Vec, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.submit_service_check"; @@ -147,7 +148,7 @@ impl ServiceChecksAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -163,7 +164,7 @@ impl ServiceChecksAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -174,7 +175,7 @@ impl ServiceChecksAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -184,7 +185,7 @@ impl ServiceChecksAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -194,7 +195,7 @@ impl ServiceChecksAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -218,23 +219,23 @@ impl ServiceChecksAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_service_level_objective_corrections.rs b/src/datadogV1/api/api_service_level_objective_corrections.rs index 54925de73..4e74bfe75 100644 --- a/src/datadogV1/api/api_service_level_objective_corrections.rs +++ b/src/datadogV1/api/api_service_level_objective_corrections.rs @@ -1,14 +1,13 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -89,13 +88,13 @@ pub enum UpdateSLOCorrectionError { #[derive(Debug, Clone)] pub struct ServiceLevelObjectiveCorrectionsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for ServiceLevelObjectiveCorrectionsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -103,7 +102,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -145,7 +144,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -155,14 +154,16 @@ impl ServiceLevelObjectiveCorrectionsAPI { pub async fn create_slo_correction( &self, body: crate::datadogV1::model::SLOCorrectionCreateRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::SLOCorrectionResponse, + datadog::Error, + > { match self.create_slo_correction_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -176,8 +177,8 @@ impl ServiceLevelObjectiveCorrectionsAPI { &self, body: crate::datadogV1::model::SLOCorrectionCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_slo_correction"; @@ -203,7 +204,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -226,7 +227,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -237,7 +238,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -247,7 +248,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -257,7 +258,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -281,23 +282,23 @@ impl ServiceLevelObjectiveCorrectionsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -305,7 +306,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { pub async fn delete_slo_correction( &self, slo_correction_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_slo_correction_with_http_info(slo_correction_id) .await @@ -319,7 +320,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { pub async fn delete_slo_correction_with_http_info( &self, slo_correction_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v1.delete_slo_correction"; @@ -328,7 +329,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { let local_uri_str = format!( "{}/api/v1/slo/correction/{slo_correction_id}", local_configuration.get_operation_host(operation_id), - slo_correction_id = urlencode(slo_correction_id) + slo_correction_id = datadog::urlencode(slo_correction_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -344,7 +345,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -373,7 +374,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -381,12 +382,12 @@ impl ServiceLevelObjectiveCorrectionsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -394,7 +395,8 @@ impl ServiceLevelObjectiveCorrectionsAPI { pub async fn get_slo_correction( &self, slo_correction_id: String, - ) -> Result> { + ) -> Result> + { match self .get_slo_correction_with_http_info(slo_correction_id) .await @@ -403,7 +405,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -417,8 +419,8 @@ impl ServiceLevelObjectiveCorrectionsAPI { &self, slo_correction_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_slo_correction"; @@ -428,7 +430,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { let local_uri_str = format!( "{}/api/v1/slo/correction/{slo_correction_id}", local_configuration.get_operation_host(operation_id), - slo_correction_id = urlencode(slo_correction_id) + slo_correction_id = datadog::urlencode(slo_correction_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -444,7 +446,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -477,23 +479,23 @@ impl ServiceLevelObjectiveCorrectionsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -501,14 +503,16 @@ impl ServiceLevelObjectiveCorrectionsAPI { pub async fn list_slo_correction( &self, params: ListSLOCorrectionOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::SLOCorrectionListResponse, + datadog::Error, + > { match self.list_slo_correction_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -521,7 +525,10 @@ impl ServiceLevelObjectiveCorrectionsAPI { &self, mut params: ListSLOCorrectionOptionalParams, ) -> impl Stream< - Item = Result>, + Item = Result< + crate::datadogV1::model::SLOCorrection, + datadog::Error, + >, > + '_ { try_stream! { let mut page_size: i64 = 25; @@ -557,8 +564,8 @@ impl ServiceLevelObjectiveCorrectionsAPI { &self, params: ListSLOCorrectionOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_slo_correction"; @@ -596,7 +603,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -629,23 +636,23 @@ impl ServiceLevelObjectiveCorrectionsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -654,8 +661,10 @@ impl ServiceLevelObjectiveCorrectionsAPI { &self, slo_correction_id: String, body: crate::datadogV1::model::SLOCorrectionUpdateRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::SLOCorrectionResponse, + datadog::Error, + > { match self .update_slo_correction_with_http_info(slo_correction_id, body) .await @@ -664,7 +673,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -679,8 +688,8 @@ impl ServiceLevelObjectiveCorrectionsAPI { slo_correction_id: String, body: crate::datadogV1::model::SLOCorrectionUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.update_slo_correction"; @@ -690,7 +699,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { let local_uri_str = format!( "{}/api/v1/slo/correction/{slo_correction_id}", local_configuration.get_operation_host(operation_id), - slo_correction_id = urlencode(slo_correction_id) + slo_correction_id = datadog::urlencode(slo_correction_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -707,7 +716,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -730,7 +739,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -741,7 +750,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -751,7 +760,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -761,7 +770,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -785,23 +794,23 @@ impl ServiceLevelObjectiveCorrectionsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_service_level_objectives.rs b/src/datadogV1/api/api_service_level_objectives.rs index 936cda155..492c11e09 100644 --- a/src/datadogV1/api/api_service_level_objectives.rs +++ b/src/datadogV1/api/api_service_level_objectives.rs @@ -1,14 +1,13 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -270,13 +269,13 @@ pub enum UpdateSLOError { #[derive(Debug, Clone)] pub struct ServiceLevelObjectivesAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for ServiceLevelObjectivesAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -284,7 +283,7 @@ impl ServiceLevelObjectivesAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -326,7 +325,7 @@ impl ServiceLevelObjectivesAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -337,14 +336,16 @@ impl ServiceLevelObjectivesAPI { pub async fn check_can_delete_slo( &self, ids: String, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::CheckCanDeleteSLOResponse, + datadog::Error, + > { match self.check_can_delete_slo_with_http_info(ids).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -359,8 +360,8 @@ impl ServiceLevelObjectivesAPI { &self, ids: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.check_can_delete_slo"; @@ -387,7 +388,7 @@ impl ServiceLevelObjectivesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -420,23 +421,23 @@ impl ServiceLevelObjectivesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -444,13 +445,13 @@ impl ServiceLevelObjectivesAPI { pub async fn create_slo( &self, body: crate::datadogV1::model::ServiceLevelObjectiveRequest, - ) -> Result> { + ) -> Result> { match self.create_slo_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -463,8 +464,10 @@ impl ServiceLevelObjectivesAPI { pub async fn create_slo_with_http_info( &self, body: crate::datadogV1::model::ServiceLevelObjectiveRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.create_slo"; @@ -489,7 +492,7 @@ impl ServiceLevelObjectivesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -512,7 +515,7 @@ impl ServiceLevelObjectivesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -523,7 +526,7 @@ impl ServiceLevelObjectivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -533,7 +536,7 @@ impl ServiceLevelObjectivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -543,7 +546,7 @@ impl ServiceLevelObjectivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -565,22 +568,22 @@ impl ServiceLevelObjectivesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -592,13 +595,13 @@ impl ServiceLevelObjectivesAPI { &self, slo_id: String, params: DeleteSLOOptionalParams, - ) -> Result> { + ) -> Result> { match self.delete_slo_with_http_info(slo_id, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -615,8 +618,10 @@ impl ServiceLevelObjectivesAPI { &self, slo_id: String, params: DeleteSLOOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.delete_slo"; @@ -628,7 +633,7 @@ impl ServiceLevelObjectivesAPI { let local_uri_str = format!( "{}/api/v1/slo/{slo_id}", local_configuration.get_operation_host(operation_id), - slo_id = urlencode(slo_id) + slo_id = datadog::urlencode(slo_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -649,7 +654,7 @@ impl ServiceLevelObjectivesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -681,22 +686,22 @@ impl ServiceLevelObjectivesAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -708,14 +713,16 @@ impl ServiceLevelObjectivesAPI { pub async fn delete_slo_timeframe_in_bulk( &self, body: std::collections::BTreeMap>, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::SLOBulkDeleteResponse, + datadog::Error, + > { match self.delete_slo_timeframe_in_bulk_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -733,8 +740,8 @@ impl ServiceLevelObjectivesAPI { &self, body: std::collections::BTreeMap>, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.delete_slo_timeframe_in_bulk"; @@ -760,7 +767,7 @@ impl ServiceLevelObjectivesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -783,7 +790,7 @@ impl ServiceLevelObjectivesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -794,7 +801,7 @@ impl ServiceLevelObjectivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -804,7 +811,7 @@ impl ServiceLevelObjectivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -814,7 +821,7 @@ impl ServiceLevelObjectivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -838,23 +845,23 @@ impl ServiceLevelObjectivesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -863,13 +870,13 @@ impl ServiceLevelObjectivesAPI { &self, slo_id: String, params: GetSLOOptionalParams, - ) -> Result> { + ) -> Result> { match self.get_slo_with_http_info(slo_id, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -883,7 +890,10 @@ impl ServiceLevelObjectivesAPI { &self, slo_id: String, params: GetSLOOptionalParams, - ) -> Result, Error> { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_slo"; @@ -895,7 +905,7 @@ impl ServiceLevelObjectivesAPI { let local_uri_str = format!( "{}/api/v1/slo/{slo_id}", local_configuration.get_operation_host(operation_id), - slo_id = urlencode(slo_id) + slo_id = datadog::urlencode(slo_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -916,7 +926,7 @@ impl ServiceLevelObjectivesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -947,22 +957,22 @@ impl ServiceLevelObjectivesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -970,14 +980,16 @@ impl ServiceLevelObjectivesAPI { pub async fn get_slo_corrections( &self, slo_id: String, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::SLOCorrectionListResponse, + datadog::Error, + > { match self.get_slo_corrections_with_http_info(slo_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -991,8 +1003,8 @@ impl ServiceLevelObjectivesAPI { &self, slo_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_slo_corrections"; @@ -1002,7 +1014,7 @@ impl ServiceLevelObjectivesAPI { let local_uri_str = format!( "{}/api/v1/slo/{slo_id}/corrections", local_configuration.get_operation_host(operation_id), - slo_id = urlencode(slo_id) + slo_id = datadog::urlencode(slo_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1018,7 +1030,7 @@ impl ServiceLevelObjectivesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1051,23 +1063,23 @@ impl ServiceLevelObjectivesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1085,7 +1097,8 @@ impl ServiceLevelObjectivesAPI { from_ts: i64, to_ts: i64, params: GetSLOHistoryOptionalParams, - ) -> Result> { + ) -> Result> + { match self .get_slo_history_with_http_info(slo_id, from_ts, to_ts, params) .await @@ -1094,7 +1107,7 @@ impl ServiceLevelObjectivesAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1118,8 +1131,8 @@ impl ServiceLevelObjectivesAPI { to_ts: i64, params: GetSLOHistoryOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_slo_history"; @@ -1133,7 +1146,7 @@ impl ServiceLevelObjectivesAPI { let local_uri_str = format!( "{}/api/v1/slo/{slo_id}/history", local_configuration.get_operation_host(operation_id), - slo_id = urlencode(slo_id) + slo_id = datadog::urlencode(slo_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1160,7 +1173,7 @@ impl ServiceLevelObjectivesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1193,23 +1206,23 @@ impl ServiceLevelObjectivesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1217,13 +1230,13 @@ impl ServiceLevelObjectivesAPI { pub async fn list_slos( &self, params: ListSLOsOptionalParams, - ) -> Result> { + ) -> Result> { match self.list_slos_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1236,7 +1249,10 @@ impl ServiceLevelObjectivesAPI { &self, mut params: ListSLOsOptionalParams, ) -> impl Stream< - Item = Result>, + Item = Result< + crate::datadogV1::model::ServiceLevelObjective, + datadog::Error, + >, > + '_ { try_stream! { let mut page_size: i64 = 1000; @@ -1271,8 +1287,10 @@ impl ServiceLevelObjectivesAPI { pub async fn list_slos_with_http_info( &self, params: ListSLOsOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.list_slos"; @@ -1328,7 +1346,7 @@ impl ServiceLevelObjectivesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1359,22 +1377,22 @@ impl ServiceLevelObjectivesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1382,13 +1400,13 @@ impl ServiceLevelObjectivesAPI { pub async fn search_slo( &self, params: SearchSLOOptionalParams, - ) -> Result> { + ) -> Result> { match self.search_slo_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1401,8 +1419,10 @@ impl ServiceLevelObjectivesAPI { pub async fn search_slo_with_http_info( &self, params: SearchSLOOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.search_slo"; @@ -1449,7 +1469,7 @@ impl ServiceLevelObjectivesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1481,22 +1501,22 @@ impl ServiceLevelObjectivesAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1505,13 +1525,13 @@ impl ServiceLevelObjectivesAPI { &self, slo_id: String, body: crate::datadogV1::model::ServiceLevelObjective, - ) -> Result> { + ) -> Result> { match self.update_slo_with_http_info(slo_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1525,8 +1545,10 @@ impl ServiceLevelObjectivesAPI { &self, slo_id: String, body: crate::datadogV1::model::ServiceLevelObjective, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.update_slo"; @@ -1535,7 +1557,7 @@ impl ServiceLevelObjectivesAPI { let local_uri_str = format!( "{}/api/v1/slo/{slo_id}", local_configuration.get_operation_host(operation_id), - slo_id = urlencode(slo_id) + slo_id = datadog::urlencode(slo_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -1552,7 +1574,7 @@ impl ServiceLevelObjectivesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1575,7 +1597,7 @@ impl ServiceLevelObjectivesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1586,7 +1608,7 @@ impl ServiceLevelObjectivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1596,7 +1618,7 @@ impl ServiceLevelObjectivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1606,7 +1628,7 @@ impl ServiceLevelObjectivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1628,22 +1650,22 @@ impl ServiceLevelObjectivesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_slack_integration.rs b/src/datadogV1/api/api_slack_integration.rs index ed6f77d8a..696a53eed 100644 --- a/src/datadogV1/api/api_slack_integration.rs +++ b/src/datadogV1/api/api_slack_integration.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -68,13 +67,13 @@ pub enum UpdateSlackIntegrationChannelError { #[derive(Debug, Clone)] pub struct SlackIntegrationAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for SlackIntegrationAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -82,7 +81,7 @@ impl SlackIntegrationAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -124,7 +123,7 @@ impl SlackIntegrationAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -137,7 +136,7 @@ impl SlackIntegrationAPI { body: crate::datadogV1::model::SlackIntegrationChannel, ) -> Result< crate::datadogV1::model::SlackIntegrationChannel, - Error, + datadog::Error, > { match self .create_slack_integration_channel_with_http_info(account_name, body) @@ -147,7 +146,7 @@ impl SlackIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -162,8 +161,8 @@ impl SlackIntegrationAPI { account_name: String, body: crate::datadogV1::model::SlackIntegrationChannel, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_slack_integration_channel"; @@ -173,7 +172,7 @@ impl SlackIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels", local_configuration.get_operation_host(operation_id), - account_name = urlencode(account_name) + account_name = datadog::urlencode(account_name) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -190,7 +189,7 @@ impl SlackIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -213,7 +212,7 @@ impl SlackIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -224,7 +223,7 @@ impl SlackIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -234,7 +233,7 @@ impl SlackIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -244,7 +243,7 @@ impl SlackIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -268,23 +267,23 @@ impl SlackIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -295,7 +294,7 @@ impl SlackIntegrationAPI { channel_name: String, ) -> Result< crate::datadogV1::model::SlackIntegrationChannel, - Error, + datadog::Error, > { match self .get_slack_integration_channel_with_http_info(account_name, channel_name) @@ -305,7 +304,7 @@ impl SlackIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -320,8 +319,8 @@ impl SlackIntegrationAPI { account_name: String, channel_name: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_slack_integration_channel"; @@ -331,9 +330,9 @@ impl SlackIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name}", local_configuration.get_operation_host(operation_id), account_name= - urlencode(account_name) + datadog::urlencode(account_name) , channel_name= - urlencode(channel_name) + datadog::urlencode(channel_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -349,7 +348,7 @@ impl SlackIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -382,23 +381,23 @@ impl SlackIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -408,7 +407,7 @@ impl SlackIntegrationAPI { account_name: String, ) -> Result< Vec, - Error, + datadog::Error, > { match self .get_slack_integration_channels_with_http_info(account_name) @@ -418,7 +417,7 @@ impl SlackIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -432,8 +431,8 @@ impl SlackIntegrationAPI { &self, account_name: String, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_slack_integration_channels"; @@ -443,7 +442,7 @@ impl SlackIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels", local_configuration.get_operation_host(operation_id), - account_name = urlencode(account_name) + account_name = datadog::urlencode(account_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -459,7 +458,7 @@ impl SlackIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -492,23 +491,23 @@ impl SlackIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -517,7 +516,7 @@ impl SlackIntegrationAPI { &self, account_name: String, channel_name: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .remove_slack_integration_channel_with_http_info(account_name, channel_name) .await @@ -532,7 +531,8 @@ impl SlackIntegrationAPI { &self, account_name: String, channel_name: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> + { let local_configuration = &self.config; let operation_id = "v1.remove_slack_integration_channel"; @@ -541,9 +541,9 @@ impl SlackIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name}", local_configuration.get_operation_host(operation_id), account_name= - urlencode(account_name) + datadog::urlencode(account_name) , channel_name= - urlencode(channel_name) + datadog::urlencode(channel_name) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -559,7 +559,7 @@ impl SlackIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -588,7 +588,7 @@ impl SlackIntegrationAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -596,12 +596,12 @@ impl SlackIntegrationAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -613,7 +613,7 @@ impl SlackIntegrationAPI { body: crate::datadogV1::model::SlackIntegrationChannel, ) -> Result< crate::datadogV1::model::SlackIntegrationChannel, - Error, + datadog::Error, > { match self .update_slack_integration_channel_with_http_info(account_name, channel_name, body) @@ -623,7 +623,7 @@ impl SlackIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -639,8 +639,8 @@ impl SlackIntegrationAPI { channel_name: String, body: crate::datadogV1::model::SlackIntegrationChannel, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.update_slack_integration_channel"; @@ -650,9 +650,9 @@ impl SlackIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name}", local_configuration.get_operation_host(operation_id), account_name= - urlencode(account_name) + datadog::urlencode(account_name) , channel_name= - urlencode(channel_name) + datadog::urlencode(channel_name) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -669,7 +669,7 @@ impl SlackIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -692,7 +692,7 @@ impl SlackIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -703,7 +703,7 @@ impl SlackIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -713,7 +713,7 @@ impl SlackIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -723,7 +723,7 @@ impl SlackIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -747,23 +747,23 @@ impl SlackIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_snapshots.rs b/src/datadogV1/api/api_snapshots.rs index eba73a3f6..20fbfefbf 100644 --- a/src/datadogV1/api/api_snapshots.rs +++ b/src/datadogV1/api/api_snapshots.rs @@ -1,8 +1,7 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; -use reqwest; +use crate::datadog; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; @@ -73,13 +72,13 @@ pub enum GetGraphSnapshotError { #[derive(Debug, Clone)] pub struct SnapshotsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for SnapshotsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -87,7 +86,7 @@ impl SnapshotsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -129,7 +128,7 @@ impl SnapshotsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -142,7 +141,7 @@ impl SnapshotsAPI { start: i64, end: i64, params: GetGraphSnapshotOptionalParams, - ) -> Result> { + ) -> Result> { match self .get_graph_snapshot_with_http_info(start, end, params) .await @@ -151,7 +150,7 @@ impl SnapshotsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -167,8 +166,10 @@ impl SnapshotsAPI { start: i64, end: i64, params: GetGraphSnapshotOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_graph_snapshot"; @@ -227,7 +228,7 @@ impl SnapshotsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -258,23 +259,23 @@ impl SnapshotsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_synthetics.rs b/src/datadogV1/api/api_synthetics.rs index a022bfa79..b0ce5d901 100644 --- a/src/datadogV1/api/api_synthetics.rs +++ b/src/datadogV1/api/api_synthetics.rs @@ -1,14 +1,13 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -385,13 +384,13 @@ pub enum UpdateTestPauseStatusError { #[derive(Debug, Clone)] pub struct SyntheticsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for SyntheticsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -399,7 +398,7 @@ impl SyntheticsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -441,7 +440,7 @@ impl SyntheticsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -451,14 +450,16 @@ impl SyntheticsAPI { pub async fn create_global_variable( &self, body: crate::datadogV1::model::SyntheticsGlobalVariable, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::SyntheticsGlobalVariable, + datadog::Error, + > { match self.create_global_variable_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -472,8 +473,8 @@ impl SyntheticsAPI { &self, body: crate::datadogV1::model::SyntheticsGlobalVariable, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_global_variable"; @@ -499,7 +500,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -522,7 +523,7 @@ impl SyntheticsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -533,7 +534,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -543,7 +544,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -553,7 +554,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -577,23 +578,23 @@ impl SyntheticsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -603,14 +604,14 @@ impl SyntheticsAPI { body: crate::datadogV1::model::SyntheticsPrivateLocation, ) -> Result< crate::datadogV1::model::SyntheticsPrivateLocationCreationResponse, - Error, + datadog::Error, > { match self.create_private_location_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -624,8 +625,10 @@ impl SyntheticsAPI { &self, body: crate::datadogV1::model::SyntheticsPrivateLocation, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent< + crate::datadogV1::model::SyntheticsPrivateLocationCreationResponse, + >, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_private_location"; @@ -651,7 +654,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -674,7 +677,7 @@ impl SyntheticsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -685,7 +688,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -695,7 +698,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -705,7 +708,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -730,23 +733,23 @@ impl SyntheticsAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -754,14 +757,16 @@ impl SyntheticsAPI { pub async fn create_synthetics_api_test( &self, body: crate::datadogV1::model::SyntheticsAPITest, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::SyntheticsAPITest, + datadog::Error, + > { match self.create_synthetics_api_test_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -775,8 +780,8 @@ impl SyntheticsAPI { &self, body: crate::datadogV1::model::SyntheticsAPITest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_synthetics_api_test"; @@ -802,7 +807,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -825,7 +830,7 @@ impl SyntheticsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -836,7 +841,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -846,7 +851,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -856,7 +861,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -879,23 +884,23 @@ impl SyntheticsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -905,7 +910,7 @@ impl SyntheticsAPI { body: crate::datadogV1::model::SyntheticsBrowserTest, ) -> Result< crate::datadogV1::model::SyntheticsBrowserTest, - Error, + datadog::Error, > { match self .create_synthetics_browser_test_with_http_info(body) @@ -915,7 +920,7 @@ impl SyntheticsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -929,8 +934,8 @@ impl SyntheticsAPI { &self, body: crate::datadogV1::model::SyntheticsBrowserTest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_synthetics_browser_test"; @@ -956,7 +961,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -979,7 +984,7 @@ impl SyntheticsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -990,7 +995,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1000,7 +1005,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1010,7 +1015,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1034,23 +1039,23 @@ impl SyntheticsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1058,7 +1063,7 @@ impl SyntheticsAPI { pub async fn delete_global_variable( &self, variable_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_global_variable_with_http_info(variable_id) .await @@ -1072,7 +1077,7 @@ impl SyntheticsAPI { pub async fn delete_global_variable_with_http_info( &self, variable_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v1.delete_global_variable"; @@ -1081,7 +1086,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/variables/{variable_id}", local_configuration.get_operation_host(operation_id), - variable_id = urlencode(variable_id) + variable_id = datadog::urlencode(variable_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -1097,7 +1102,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1126,7 +1131,7 @@ impl SyntheticsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -1134,12 +1139,12 @@ impl SyntheticsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1147,7 +1152,7 @@ impl SyntheticsAPI { pub async fn delete_private_location( &self, location_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_private_location_with_http_info(location_id) .await @@ -1161,7 +1166,7 @@ impl SyntheticsAPI { pub async fn delete_private_location_with_http_info( &self, location_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v1.delete_private_location"; @@ -1170,7 +1175,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/private-locations/{location_id}", local_configuration.get_operation_host(operation_id), - location_id = urlencode(location_id) + location_id = datadog::urlencode(location_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -1186,7 +1191,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1215,7 +1220,7 @@ impl SyntheticsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -1223,12 +1228,12 @@ impl SyntheticsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1236,14 +1241,16 @@ impl SyntheticsAPI { pub async fn delete_tests( &self, body: crate::datadogV1::model::SyntheticsDeleteTestsPayload, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::SyntheticsDeleteTestsResponse, + datadog::Error, + > { match self.delete_tests_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1257,8 +1264,8 @@ impl SyntheticsAPI { &self, body: crate::datadogV1::model::SyntheticsDeleteTestsPayload, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.delete_tests"; @@ -1284,7 +1291,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1307,7 +1314,7 @@ impl SyntheticsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1318,7 +1325,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1328,7 +1335,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1338,7 +1345,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1362,22 +1369,22 @@ impl SyntheticsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1386,8 +1393,10 @@ impl SyntheticsAPI { &self, variable_id: String, body: crate::datadogV1::model::SyntheticsGlobalVariable, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::SyntheticsGlobalVariable, + datadog::Error, + > { match self .edit_global_variable_with_http_info(variable_id, body) .await @@ -1396,7 +1405,7 @@ impl SyntheticsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1411,8 +1420,8 @@ impl SyntheticsAPI { variable_id: String, body: crate::datadogV1::model::SyntheticsGlobalVariable, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.edit_global_variable"; @@ -1422,7 +1431,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/variables/{variable_id}", local_configuration.get_operation_host(operation_id), - variable_id = urlencode(variable_id) + variable_id = datadog::urlencode(variable_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -1439,7 +1448,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1462,7 +1471,7 @@ impl SyntheticsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1473,7 +1482,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1483,7 +1492,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1493,7 +1502,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1517,23 +1526,23 @@ impl SyntheticsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1542,13 +1551,13 @@ impl SyntheticsAPI { pub async fn get_api_test( &self, public_id: String, - ) -> Result> { + ) -> Result> { match self.get_api_test_with_http_info(public_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1562,8 +1571,10 @@ impl SyntheticsAPI { pub async fn get_api_test_with_http_info( &self, public_id: String, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_api_test"; @@ -1572,7 +1583,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/api/{public_id}", local_configuration.get_operation_host(operation_id), - public_id = urlencode(public_id) + public_id = datadog::urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1588,7 +1599,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1620,22 +1631,22 @@ impl SyntheticsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1646,7 +1657,7 @@ impl SyntheticsAPI { params: GetAPITestLatestResultsOptionalParams, ) -> Result< crate::datadogV1::model::SyntheticsGetAPITestLatestResultsResponse, - Error, + datadog::Error, > { match self .get_api_test_latest_results_with_http_info(public_id, params) @@ -1656,7 +1667,7 @@ impl SyntheticsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1671,8 +1682,10 @@ impl SyntheticsAPI { public_id: String, params: GetAPITestLatestResultsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent< + crate::datadogV1::model::SyntheticsGetAPITestLatestResultsResponse, + >, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_api_test_latest_results"; @@ -1687,7 +1700,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/{public_id}/results", local_configuration.get_operation_host(operation_id), - public_id = urlencode(public_id) + public_id = datadog::urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1723,7 +1736,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1757,23 +1770,23 @@ impl SyntheticsAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1782,8 +1795,10 @@ impl SyntheticsAPI { &self, public_id: String, result_id: String, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::SyntheticsAPITestResultFull, + datadog::Error, + > { match self .get_api_test_result_with_http_info(public_id, result_id) .await @@ -1792,7 +1807,7 @@ impl SyntheticsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1807,8 +1822,8 @@ impl SyntheticsAPI { public_id: String, result_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_api_test_result"; @@ -1818,8 +1833,8 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/{public_id}/results/{result_id}", local_configuration.get_operation_host(operation_id), - public_id = urlencode(public_id), - result_id = urlencode(result_id) + public_id = datadog::urlencode(public_id), + result_id = datadog::urlencode(result_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1835,7 +1850,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1868,23 +1883,23 @@ impl SyntheticsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1893,13 +1908,14 @@ impl SyntheticsAPI { pub async fn get_browser_test( &self, public_id: String, - ) -> Result> { + ) -> Result> + { match self.get_browser_test_with_http_info(public_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1914,8 +1930,8 @@ impl SyntheticsAPI { &self, public_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_browser_test"; @@ -1925,7 +1941,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/browser/{public_id}", local_configuration.get_operation_host(operation_id), - public_id = urlencode(public_id) + public_id = datadog::urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1941,7 +1957,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1974,23 +1990,23 @@ impl SyntheticsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2001,7 +2017,7 @@ impl SyntheticsAPI { params: GetBrowserTestLatestResultsOptionalParams, ) -> Result< crate::datadogV1::model::SyntheticsGetBrowserTestLatestResultsResponse, - Error, + datadog::Error, > { match self .get_browser_test_latest_results_with_http_info(public_id, params) @@ -2011,7 +2027,7 @@ impl SyntheticsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2026,8 +2042,10 @@ impl SyntheticsAPI { public_id: String, params: GetBrowserTestLatestResultsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent< + crate::datadogV1::model::SyntheticsGetBrowserTestLatestResultsResponse, + >, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_browser_test_latest_results"; @@ -2042,7 +2060,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/browser/{public_id}/results", local_configuration.get_operation_host(operation_id), - public_id = urlencode(public_id) + public_id = datadog::urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2078,7 +2096,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2112,23 +2130,23 @@ impl SyntheticsAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2139,7 +2157,7 @@ impl SyntheticsAPI { result_id: String, ) -> Result< crate::datadogV1::model::SyntheticsBrowserTestResultFull, - Error, + datadog::Error, > { match self .get_browser_test_result_with_http_info(public_id, result_id) @@ -2149,7 +2167,7 @@ impl SyntheticsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2164,8 +2182,8 @@ impl SyntheticsAPI { public_id: String, result_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_browser_test_result"; @@ -2175,8 +2193,8 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/browser/{public_id}/results/{result_id}", local_configuration.get_operation_host(operation_id), - public_id = urlencode(public_id), - result_id = urlencode(result_id) + public_id = datadog::urlencode(public_id), + result_id = datadog::urlencode(result_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2192,7 +2210,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2225,23 +2243,23 @@ impl SyntheticsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2249,14 +2267,16 @@ impl SyntheticsAPI { pub async fn get_global_variable( &self, variable_id: String, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::SyntheticsGlobalVariable, + datadog::Error, + > { match self.get_global_variable_with_http_info(variable_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2270,8 +2290,8 @@ impl SyntheticsAPI { &self, variable_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_global_variable"; @@ -2281,7 +2301,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/variables/{variable_id}", local_configuration.get_operation_host(operation_id), - variable_id = urlencode(variable_id) + variable_id = datadog::urlencode(variable_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2297,7 +2317,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2330,23 +2350,23 @@ impl SyntheticsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2354,14 +2374,16 @@ impl SyntheticsAPI { pub async fn get_private_location( &self, location_id: String, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::SyntheticsPrivateLocation, + datadog::Error, + > { match self.get_private_location_with_http_info(location_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2375,8 +2397,8 @@ impl SyntheticsAPI { &self, location_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_private_location"; @@ -2386,7 +2408,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/private-locations/{location_id}", local_configuration.get_operation_host(operation_id), - location_id = urlencode(location_id) + location_id = datadog::urlencode(location_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2402,7 +2424,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2435,23 +2457,23 @@ impl SyntheticsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2459,14 +2481,16 @@ impl SyntheticsAPI { pub async fn get_synthetics_ci_batch( &self, batch_id: String, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::SyntheticsBatchDetails, + datadog::Error, + > { match self.get_synthetics_ci_batch_with_http_info(batch_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2480,8 +2504,8 @@ impl SyntheticsAPI { &self, batch_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_synthetics_ci_batch"; @@ -2491,7 +2515,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/ci/batch/{batch_id}", local_configuration.get_operation_host(operation_id), - batch_id = urlencode(batch_id) + batch_id = datadog::urlencode(batch_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2507,7 +2531,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2540,36 +2564,36 @@ impl SyntheticsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// Get the default locations settings. pub async fn get_synthetics_default_locations( &self, - ) -> Result, Error> { + ) -> Result, datadog::Error> { match self.get_synthetics_default_locations_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2581,7 +2605,10 @@ impl SyntheticsAPI { /// Get the default locations settings. pub async fn get_synthetics_default_locations_with_http_info( &self, - ) -> Result>, Error> { + ) -> Result< + datadog::ResponseContent>, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_synthetics_default_locations"; @@ -2605,7 +2632,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2636,23 +2663,23 @@ impl SyntheticsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::>(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2660,13 +2687,13 @@ impl SyntheticsAPI { pub async fn get_test( &self, public_id: String, - ) -> Result> { + ) -> Result> { match self.get_test_with_http_info(public_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2679,8 +2706,10 @@ impl SyntheticsAPI { pub async fn get_test_with_http_info( &self, public_id: String, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_test"; @@ -2689,7 +2718,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/{public_id}", local_configuration.get_operation_host(operation_id), - public_id = urlencode(public_id) + public_id = datadog::urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2705,7 +2734,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2738,22 +2767,22 @@ impl SyntheticsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2762,14 +2791,14 @@ impl SyntheticsAPI { &self, ) -> Result< crate::datadogV1::model::SyntheticsListGlobalVariablesResponse, - Error, + datadog::Error, > { match self.list_global_variables_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2782,8 +2811,8 @@ impl SyntheticsAPI { pub async fn list_global_variables_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_global_variables"; @@ -2808,7 +2837,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2842,23 +2871,23 @@ impl SyntheticsAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2866,13 +2895,14 @@ impl SyntheticsAPI { /// tests. No arguments required. pub async fn list_locations( &self, - ) -> Result> { + ) -> Result> + { match self.list_locations_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2886,8 +2916,8 @@ impl SyntheticsAPI { pub async fn list_locations_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_locations"; @@ -2912,7 +2942,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2945,23 +2975,23 @@ impl SyntheticsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2969,13 +2999,14 @@ impl SyntheticsAPI { pub async fn list_tests( &self, params: ListTestsOptionalParams, - ) -> Result> { + ) -> Result> + { match self.list_tests_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2988,7 +3019,10 @@ impl SyntheticsAPI { &self, mut params: ListTestsOptionalParams, ) -> impl Stream< - Item = Result>, + Item = Result< + crate::datadogV1::model::SyntheticsTestDetails, + datadog::Error, + >, > + '_ { try_stream! { let mut page_size: i64 = 100; @@ -3023,8 +3057,8 @@ impl SyntheticsAPI { &self, params: ListTestsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.list_tests"; @@ -3062,7 +3096,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3095,22 +3129,22 @@ impl SyntheticsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3119,13 +3153,14 @@ impl SyntheticsAPI { &self, public_id: String, body: crate::datadogV1::model::SyntheticsPatchTestBody, - ) -> Result> { + ) -> Result> + { match self.patch_test_with_http_info(public_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -3140,8 +3175,8 @@ impl SyntheticsAPI { public_id: String, body: crate::datadogV1::model::SyntheticsPatchTestBody, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.patch_test"; @@ -3151,7 +3186,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/{public_id}", local_configuration.get_operation_host(operation_id), - public_id = urlencode(public_id) + public_id = datadog::urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -3168,7 +3203,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3191,7 +3226,7 @@ impl SyntheticsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -3202,7 +3237,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -3212,7 +3247,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -3222,7 +3257,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -3246,22 +3281,22 @@ impl SyntheticsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3269,14 +3304,16 @@ impl SyntheticsAPI { pub async fn trigger_ci_tests( &self, body: crate::datadogV1::model::SyntheticsCITestBody, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::SyntheticsTriggerCITestsResponse, + datadog::Error, + > { match self.trigger_ci_tests_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -3290,8 +3327,8 @@ impl SyntheticsAPI { &self, body: crate::datadogV1::model::SyntheticsCITestBody, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.trigger_ci_tests"; @@ -3317,7 +3354,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3340,7 +3377,7 @@ impl SyntheticsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -3351,7 +3388,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -3361,7 +3398,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -3371,7 +3408,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -3395,23 +3432,23 @@ impl SyntheticsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3419,14 +3456,16 @@ impl SyntheticsAPI { pub async fn trigger_tests( &self, body: crate::datadogV1::model::SyntheticsTriggerBody, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::SyntheticsTriggerCITestsResponse, + datadog::Error, + > { match self.trigger_tests_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -3440,8 +3479,8 @@ impl SyntheticsAPI { &self, body: crate::datadogV1::model::SyntheticsTriggerBody, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.trigger_tests"; @@ -3467,7 +3506,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3490,7 +3529,7 @@ impl SyntheticsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -3501,7 +3540,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -3511,7 +3550,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -3521,7 +3560,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -3545,22 +3584,22 @@ impl SyntheticsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3569,13 +3608,14 @@ impl SyntheticsAPI { &self, public_id: String, body: crate::datadogV1::model::SyntheticsAPITest, - ) -> Result> { + ) -> Result> + { match self.update_api_test_with_http_info(public_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -3590,8 +3630,8 @@ impl SyntheticsAPI { public_id: String, body: crate::datadogV1::model::SyntheticsAPITest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.update_api_test"; @@ -3601,7 +3641,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/api/{public_id}", local_configuration.get_operation_host(operation_id), - public_id = urlencode(public_id) + public_id = datadog::urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -3618,7 +3658,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3641,7 +3681,7 @@ impl SyntheticsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -3652,7 +3692,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -3662,7 +3702,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -3672,7 +3712,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -3695,23 +3735,23 @@ impl SyntheticsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3720,7 +3760,10 @@ impl SyntheticsAPI { &self, public_id: String, body: crate::datadogV1::model::SyntheticsBrowserTest, - ) -> Result> { + ) -> Result< + crate::datadogV1::model::SyntheticsBrowserTest, + datadog::Error, + > { match self .update_browser_test_with_http_info(public_id, body) .await @@ -3729,7 +3772,7 @@ impl SyntheticsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -3744,8 +3787,8 @@ impl SyntheticsAPI { public_id: String, body: crate::datadogV1::model::SyntheticsBrowserTest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.update_browser_test"; @@ -3755,7 +3798,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/browser/{public_id}", local_configuration.get_operation_host(operation_id), - public_id = urlencode(public_id) + public_id = datadog::urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -3772,7 +3815,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3795,7 +3838,7 @@ impl SyntheticsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -3806,7 +3849,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -3816,7 +3859,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -3826,7 +3869,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -3850,23 +3893,23 @@ impl SyntheticsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3875,8 +3918,10 @@ impl SyntheticsAPI { &self, location_id: String, body: crate::datadogV1::model::SyntheticsPrivateLocation, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::SyntheticsPrivateLocation, + datadog::Error, + > { match self .update_private_location_with_http_info(location_id, body) .await @@ -3885,7 +3930,7 @@ impl SyntheticsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -3900,8 +3945,8 @@ impl SyntheticsAPI { location_id: String, body: crate::datadogV1::model::SyntheticsPrivateLocation, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.update_private_location"; @@ -3911,7 +3956,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/private-locations/{location_id}", local_configuration.get_operation_host(operation_id), - location_id = urlencode(location_id) + location_id = datadog::urlencode(location_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -3928,7 +3973,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3951,7 +3996,7 @@ impl SyntheticsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -3962,7 +4007,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -3972,7 +4017,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -3982,7 +4027,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -4006,23 +4051,23 @@ impl SyntheticsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -4031,7 +4076,7 @@ impl SyntheticsAPI { &self, public_id: String, body: crate::datadogV1::model::SyntheticsUpdateTestPauseStatusPayload, - ) -> Result> { + ) -> Result> { match self .update_test_pause_status_with_http_info(public_id, body) .await @@ -4040,7 +4085,7 @@ impl SyntheticsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -4054,7 +4099,7 @@ impl SyntheticsAPI { &self, public_id: String, body: crate::datadogV1::model::SyntheticsUpdateTestPauseStatusPayload, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v1.update_test_pause_status"; @@ -4063,7 +4108,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/{public_id}/status", local_configuration.get_operation_host(operation_id), - public_id = urlencode(public_id) + public_id = datadog::urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -4080,7 +4125,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -4103,7 +4148,7 @@ impl SyntheticsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -4114,7 +4159,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -4124,7 +4169,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -4134,7 +4179,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -4156,23 +4201,23 @@ impl SyntheticsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_tags.rs b/src/datadogV1/api/api_tags.rs index f90619945..11ec85df8 100644 --- a/src/datadogV1/api/api_tags.rs +++ b/src/datadogV1/api/api_tags.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -149,13 +148,13 @@ pub enum UpdateHostTagsError { #[derive(Debug, Clone)] pub struct TagsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for TagsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -163,7 +162,7 @@ impl TagsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -205,7 +204,7 @@ impl TagsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -218,7 +217,7 @@ impl TagsAPI { host_name: String, body: crate::datadogV1::model::HostTags, params: CreateHostTagsOptionalParams, - ) -> Result> { + ) -> Result> { match self .create_host_tags_with_http_info(host_name, body, params) .await @@ -227,7 +226,7 @@ impl TagsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -243,8 +242,10 @@ impl TagsAPI { host_name: String, body: crate::datadogV1::model::HostTags, params: CreateHostTagsOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.create_host_tags"; @@ -256,7 +257,7 @@ impl TagsAPI { let local_uri_str = format!( "{}/api/v1/tags/hosts/{host_name}", local_configuration.get_operation_host(operation_id), - host_name = urlencode(host_name) + host_name = datadog::urlencode(host_name) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -278,7 +279,7 @@ impl TagsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -301,7 +302,7 @@ impl TagsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -312,7 +313,7 @@ impl TagsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -322,7 +323,7 @@ impl TagsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -332,7 +333,7 @@ impl TagsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -354,23 +355,23 @@ impl TagsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -380,7 +381,7 @@ impl TagsAPI { &self, host_name: String, params: DeleteHostTagsOptionalParams, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_host_tags_with_http_info(host_name, params) .await @@ -396,7 +397,7 @@ impl TagsAPI { &self, host_name: String, params: DeleteHostTagsOptionalParams, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v1.delete_host_tags"; @@ -408,7 +409,7 @@ impl TagsAPI { let local_uri_str = format!( "{}/api/v1/tags/hosts/{host_name}", local_configuration.get_operation_host(operation_id), - host_name = urlencode(host_name) + host_name = datadog::urlencode(host_name) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -429,7 +430,7 @@ impl TagsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -458,7 +459,7 @@ impl TagsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -466,12 +467,12 @@ impl TagsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -480,13 +481,13 @@ impl TagsAPI { &self, host_name: String, params: GetHostTagsOptionalParams, - ) -> Result> { + ) -> Result> { match self.get_host_tags_with_http_info(host_name, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -500,7 +501,10 @@ impl TagsAPI { &self, host_name: String, params: GetHostTagsOptionalParams, - ) -> Result, Error> { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_host_tags"; @@ -512,7 +516,7 @@ impl TagsAPI { let local_uri_str = format!( "{}/api/v1/tags/hosts/{host_name}", local_configuration.get_operation_host(operation_id), - host_name = urlencode(host_name) + host_name = datadog::urlencode(host_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -533,7 +537,7 @@ impl TagsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -564,22 +568,22 @@ impl TagsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -587,13 +591,13 @@ impl TagsAPI { pub async fn list_host_tags( &self, params: ListHostTagsOptionalParams, - ) -> Result> { + ) -> Result> { match self.list_host_tags_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -606,8 +610,10 @@ impl TagsAPI { pub async fn list_host_tags_with_http_info( &self, params: ListHostTagsOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.list_host_tags"; @@ -639,7 +645,7 @@ impl TagsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -670,22 +676,22 @@ impl TagsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -696,7 +702,7 @@ impl TagsAPI { host_name: String, body: crate::datadogV1::model::HostTags, params: UpdateHostTagsOptionalParams, - ) -> Result> { + ) -> Result> { match self .update_host_tags_with_http_info(host_name, body, params) .await @@ -705,7 +711,7 @@ impl TagsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -721,8 +727,10 @@ impl TagsAPI { host_name: String, body: crate::datadogV1::model::HostTags, params: UpdateHostTagsOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.update_host_tags"; @@ -734,7 +742,7 @@ impl TagsAPI { let local_uri_str = format!( "{}/api/v1/tags/hosts/{host_name}", local_configuration.get_operation_host(operation_id), - host_name = urlencode(host_name) + host_name = datadog::urlencode(host_name) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -756,7 +764,7 @@ impl TagsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -779,7 +787,7 @@ impl TagsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -790,7 +798,7 @@ impl TagsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -800,7 +808,7 @@ impl TagsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -810,7 +818,7 @@ impl TagsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -832,23 +840,23 @@ impl TagsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_usage_metering.rs b/src/datadogV1/api/api_usage_metering.rs index 3fb7907bf..8bf483657 100644 --- a/src/datadogV1/api/api_usage_metering.rs +++ b/src/datadogV1/api/api_usage_metering.rs @@ -1,8 +1,7 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; -use reqwest; +use crate::datadog; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; @@ -1125,13 +1124,13 @@ pub enum GetUsageTopAvgMetricsError { #[derive(Debug, Clone)] pub struct UsageMeteringAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for UsageMeteringAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -1139,7 +1138,7 @@ impl UsageMeteringAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -1181,7 +1180,7 @@ impl UsageMeteringAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -1195,14 +1194,14 @@ impl UsageMeteringAPI { params: GetDailyCustomReportsOptionalParams, ) -> Result< crate::datadogV1::model::UsageCustomReportsResponse, - Error, + datadog::Error, > { match self.get_daily_custom_reports_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1218,8 +1217,8 @@ impl UsageMeteringAPI { &self, params: GetDailyCustomReportsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_daily_custom_reports"; @@ -1270,7 +1269,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1303,23 +1302,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1345,7 +1344,7 @@ impl UsageMeteringAPI { params: GetHourlyUsageAttributionOptionalParams, ) -> Result< crate::datadogV1::model::HourlyUsageAttributionResponse, - Error, + datadog::Error, > { match self .get_hourly_usage_attribution_with_http_info(start_hr, usage_type, params) @@ -1355,7 +1354,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1385,8 +1384,8 @@ impl UsageMeteringAPI { usage_type: crate::datadogV1::model::HourlyUsageAttributionUsageType, params: GetHourlyUsageAttributionOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_hourly_usage_attribution"; @@ -1439,7 +1438,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1472,23 +1471,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1500,7 +1499,7 @@ impl UsageMeteringAPI { params: GetIncidentManagementOptionalParams, ) -> Result< crate::datadogV1::model::UsageIncidentManagementResponse, - Error, + datadog::Error, > { match self .get_incident_management_with_http_info(start_hr, params) @@ -1510,7 +1509,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1526,8 +1525,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetIncidentManagementOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_incident_management"; @@ -1564,7 +1563,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1597,23 +1596,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1623,8 +1622,10 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetIngestedSpansOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::UsageIngestedSpansResponse, + datadog::Error, + > { match self .get_ingested_spans_with_http_info(start_hr, params) .await @@ -1633,7 +1634,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1649,8 +1650,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetIngestedSpansOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_ingested_spans"; @@ -1687,7 +1688,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1720,23 +1721,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1748,14 +1749,14 @@ impl UsageMeteringAPI { params: GetMonthlyCustomReportsOptionalParams, ) -> Result< crate::datadogV1::model::UsageCustomReportsResponse, - Error, + datadog::Error, > { match self.get_monthly_custom_reports_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1771,8 +1772,8 @@ impl UsageMeteringAPI { &self, params: GetMonthlyCustomReportsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_monthly_custom_reports"; @@ -1823,7 +1824,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1856,23 +1857,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1898,7 +1899,7 @@ impl UsageMeteringAPI { params: GetMonthlyUsageAttributionOptionalParams, ) -> Result< crate::datadogV1::model::MonthlyUsageAttributionResponse, - Error, + datadog::Error, > { match self .get_monthly_usage_attribution_with_http_info(start_month, fields, params) @@ -1908,7 +1909,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1938,8 +1939,8 @@ impl UsageMeteringAPI { fields: crate::datadogV1::model::MonthlyUsageAttributionSupportedMetrics, params: GetMonthlyUsageAttributionOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_monthly_usage_attribution"; @@ -2002,7 +2003,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2035,23 +2036,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2063,7 +2064,7 @@ impl UsageMeteringAPI { report_id: String, ) -> Result< crate::datadogV1::model::UsageSpecifiedCustomReportsResponse, - Error, + datadog::Error, > { match self .get_specified_daily_custom_reports_with_http_info(report_id) @@ -2073,7 +2074,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2089,8 +2090,8 @@ impl UsageMeteringAPI { &self, report_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_specified_daily_custom_reports"; @@ -2100,7 +2101,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/daily_custom_reports/{report_id}", local_configuration.get_operation_host(operation_id), - report_id = urlencode(report_id) + report_id = datadog::urlencode(report_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2119,7 +2120,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2152,23 +2153,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2180,7 +2181,7 @@ impl UsageMeteringAPI { report_id: String, ) -> Result< crate::datadogV1::model::UsageSpecifiedCustomReportsResponse, - Error, + datadog::Error, > { match self .get_specified_monthly_custom_reports_with_http_info(report_id) @@ -2190,7 +2191,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2206,8 +2207,8 @@ impl UsageMeteringAPI { &self, report_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_specified_monthly_custom_reports"; @@ -2217,7 +2218,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/monthly_custom_reports/{report_id}", local_configuration.get_operation_host(operation_id), - report_id = urlencode(report_id) + report_id = datadog::urlencode(report_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2236,7 +2237,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2269,23 +2270,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2295,8 +2296,10 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageAnalyzedLogsOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::UsageAnalyzedLogsResponse, + datadog::Error, + > { match self .get_usage_analyzed_logs_with_http_info(start_hr, params) .await @@ -2305,7 +2308,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2321,8 +2324,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageAnalyzedLogsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_analyzed_logs"; @@ -2359,7 +2362,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2392,23 +2395,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2418,8 +2421,10 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageAuditLogsOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::UsageAuditLogsResponse, + datadog::Error, + > { match self .get_usage_audit_logs_with_http_info(start_hr, params) .await @@ -2428,7 +2433,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2444,8 +2449,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageAuditLogsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_audit_logs"; @@ -2482,7 +2487,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2515,23 +2520,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2541,14 +2546,14 @@ impl UsageMeteringAPI { params: GetUsageBillableSummaryOptionalParams, ) -> Result< crate::datadogV1::model::UsageBillableSummaryResponse, - Error, + datadog::Error, > { match self.get_usage_billable_summary_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2562,8 +2567,8 @@ impl UsageMeteringAPI { &self, params: GetUsageBillableSummaryOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_billable_summary"; @@ -2599,7 +2604,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2632,23 +2637,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2658,13 +2663,16 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageCIAppOptionalParams, - ) -> Result> { + ) -> Result< + crate::datadogV1::model::UsageCIVisibilityResponse, + datadog::Error, + > { match self.get_usage_ci_app_with_http_info(start_hr, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2680,8 +2688,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageCIAppOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_ci_app"; @@ -2718,7 +2726,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2751,23 +2759,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2777,13 +2785,13 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageCWSOptionalParams, - ) -> Result> { + ) -> Result> { match self.get_usage_cws_with_http_info(start_hr, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2798,8 +2806,10 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageCWSOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_usage_cws"; @@ -2835,7 +2845,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2867,22 +2877,22 @@ impl UsageMeteringAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2894,7 +2904,7 @@ impl UsageMeteringAPI { params: GetUsageCloudSecurityPostureManagementOptionalParams, ) -> Result< crate::datadogV1::model::UsageCloudSecurityPostureManagementResponse, - Error, + datadog::Error, > { match self .get_usage_cloud_security_posture_management_with_http_info(start_hr, params) @@ -2904,7 +2914,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2920,8 +2930,10 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageCloudSecurityPostureManagementOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent< + crate::datadogV1::model::UsageCloudSecurityPostureManagementResponse, + >, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_cloud_security_posture_management"; @@ -2958,7 +2970,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2992,23 +3004,23 @@ impl UsageMeteringAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3018,13 +3030,13 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageDBMOptionalParams, - ) -> Result> { + ) -> Result> { match self.get_usage_dbm_with_http_info(start_hr, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -3039,8 +3051,10 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageDBMOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_usage_dbm"; @@ -3076,7 +3090,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3108,22 +3122,22 @@ impl UsageMeteringAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3133,7 +3147,8 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageFargateOptionalParams, - ) -> Result> { + ) -> Result> + { match self .get_usage_fargate_with_http_info(start_hr, params) .await @@ -3142,7 +3157,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -3158,8 +3173,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageFargateOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_fargate"; @@ -3196,7 +3211,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3229,23 +3244,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3255,13 +3270,14 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageHostsOptionalParams, - ) -> Result> { + ) -> Result> + { match self.get_usage_hosts_with_http_info(start_hr, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -3277,8 +3293,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageHostsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_hosts"; @@ -3315,7 +3331,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3348,23 +3364,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3374,8 +3390,10 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageIndexedSpansOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::UsageIndexedSpansResponse, + datadog::Error, + > { match self .get_usage_indexed_spans_with_http_info(start_hr, params) .await @@ -3384,7 +3402,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -3400,8 +3418,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageIndexedSpansOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_indexed_spans"; @@ -3438,7 +3456,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3471,23 +3489,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3497,8 +3515,10 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageInternetOfThingsOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::UsageIoTResponse, + datadog::Error, + > { match self .get_usage_internet_of_things_with_http_info(start_hr, params) .await @@ -3507,7 +3527,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -3523,8 +3543,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageInternetOfThingsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_internet_of_things"; @@ -3561,7 +3581,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3593,23 +3613,23 @@ impl UsageMeteringAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3619,13 +3639,14 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageLambdaOptionalParams, - ) -> Result> { + ) -> Result> + { match self.get_usage_lambda_with_http_info(start_hr, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -3641,8 +3662,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageLambdaOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_lambda"; @@ -3679,7 +3700,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3712,23 +3733,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3738,13 +3759,13 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageLogsOptionalParams, - ) -> Result> { + ) -> Result> { match self.get_usage_logs_with_http_info(start_hr, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -3759,8 +3780,10 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageLogsOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_usage_logs"; @@ -3796,7 +3819,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3828,22 +3851,22 @@ impl UsageMeteringAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3852,8 +3875,10 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageLogsByIndexOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::UsageLogsByIndexResponse, + datadog::Error, + > { match self .get_usage_logs_by_index_with_http_info(start_hr, params) .await @@ -3862,7 +3887,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -3877,8 +3902,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageLogsByIndexOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_logs_by_index"; @@ -3927,7 +3952,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3960,23 +3985,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3988,7 +4013,7 @@ impl UsageMeteringAPI { params: GetUsageLogsByRetentionOptionalParams, ) -> Result< crate::datadogV1::model::UsageLogsByRetentionResponse, - Error, + datadog::Error, > { match self .get_usage_logs_by_retention_with_http_info(start_hr, params) @@ -3998,7 +4023,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -4014,8 +4039,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageLogsByRetentionOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_logs_by_retention"; @@ -4052,7 +4077,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -4085,23 +4110,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -4111,8 +4136,10 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageNetworkFlowsOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::UsageNetworkFlowsResponse, + datadog::Error, + > { match self .get_usage_network_flows_with_http_info(start_hr, params) .await @@ -4121,7 +4148,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -4137,8 +4164,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageNetworkFlowsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_network_flows"; @@ -4175,7 +4202,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -4208,23 +4235,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -4234,8 +4261,10 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageNetworkHostsOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::UsageNetworkHostsResponse, + datadog::Error, + > { match self .get_usage_network_hosts_with_http_info(start_hr, params) .await @@ -4244,7 +4273,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -4260,8 +4289,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageNetworkHostsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_network_hosts"; @@ -4298,7 +4327,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -4331,23 +4360,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -4359,7 +4388,7 @@ impl UsageMeteringAPI { params: GetUsageOnlineArchiveOptionalParams, ) -> Result< crate::datadogV1::model::UsageOnlineArchiveResponse, - Error, + datadog::Error, > { match self .get_usage_online_archive_with_http_info(start_hr, params) @@ -4369,7 +4398,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -4385,8 +4414,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageOnlineArchiveOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_online_archive"; @@ -4423,7 +4452,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -4456,23 +4485,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -4482,8 +4511,10 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageProfilingOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::UsageProfilingResponse, + datadog::Error, + > { match self .get_usage_profiling_with_http_info(start_hr, params) .await @@ -4492,7 +4523,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -4508,8 +4539,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageProfilingOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_profiling"; @@ -4546,7 +4577,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -4579,23 +4610,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -4605,8 +4636,10 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageRumSessionsOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::UsageRumSessionsResponse, + datadog::Error, + > { match self .get_usage_rum_sessions_with_http_info(start_hr, params) .await @@ -4615,7 +4648,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -4631,8 +4664,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageRumSessionsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_rum_sessions"; @@ -4674,7 +4707,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -4707,23 +4740,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -4733,7 +4766,8 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageRumUnitsOptionalParams, - ) -> Result> { + ) -> Result> + { match self .get_usage_rum_units_with_http_info(start_hr, params) .await @@ -4742,7 +4776,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -4758,8 +4792,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageRumUnitsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_rum_units"; @@ -4796,7 +4830,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -4829,23 +4863,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -4855,13 +4889,13 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageSDSOptionalParams, - ) -> Result> { + ) -> Result> { match self.get_usage_sds_with_http_info(start_hr, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -4876,8 +4910,10 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageSDSOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_usage_sds"; @@ -4913,7 +4949,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -4945,22 +4981,22 @@ impl UsageMeteringAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -4970,13 +5006,13 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageSNMPOptionalParams, - ) -> Result> { + ) -> Result> { match self.get_usage_snmp_with_http_info(start_hr, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -4991,8 +5027,10 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageSNMPOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_usage_snmp"; @@ -5028,7 +5066,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -5060,22 +5098,22 @@ impl UsageMeteringAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -5084,7 +5122,8 @@ impl UsageMeteringAPI { &self, start_month: String, params: GetUsageSummaryOptionalParams, - ) -> Result> { + ) -> Result> + { match self .get_usage_summary_with_http_info(start_month, params) .await @@ -5093,7 +5132,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -5108,8 +5147,8 @@ impl UsageMeteringAPI { start_month: String, params: GetUsageSummaryOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_summary"; @@ -5151,7 +5190,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -5184,23 +5223,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -5210,8 +5249,10 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageSyntheticsOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::UsageSyntheticsResponse, + datadog::Error, + > { match self .get_usage_synthetics_with_http_info(start_hr, params) .await @@ -5220,7 +5261,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -5236,8 +5277,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageSyntheticsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_synthetics"; @@ -5274,7 +5315,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -5307,23 +5348,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -5335,7 +5376,7 @@ impl UsageMeteringAPI { params: GetUsageSyntheticsAPIOptionalParams, ) -> Result< crate::datadogV1::model::UsageSyntheticsAPIResponse, - Error, + datadog::Error, > { match self .get_usage_synthetics_api_with_http_info(start_hr, params) @@ -5345,7 +5386,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -5361,8 +5402,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageSyntheticsAPIOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_synthetics_api"; @@ -5399,7 +5440,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -5432,23 +5473,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -5460,7 +5501,7 @@ impl UsageMeteringAPI { params: GetUsageSyntheticsBrowserOptionalParams, ) -> Result< crate::datadogV1::model::UsageSyntheticsBrowserResponse, - Error, + datadog::Error, > { match self .get_usage_synthetics_browser_with_http_info(start_hr, params) @@ -5470,7 +5511,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -5486,8 +5527,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageSyntheticsBrowserOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_synthetics_browser"; @@ -5524,7 +5565,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -5557,23 +5598,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -5583,8 +5624,10 @@ impl UsageMeteringAPI { &self, start_hr: String, params: GetUsageTimeseriesOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::UsageTimeseriesResponse, + datadog::Error, + > { match self .get_usage_timeseries_with_http_info(start_hr, params) .await @@ -5593,7 +5636,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -5609,8 +5652,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageTimeseriesOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_timeseries"; @@ -5647,7 +5690,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -5680,23 +5723,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -5706,14 +5749,14 @@ impl UsageMeteringAPI { params: GetUsageTopAvgMetricsOptionalParams, ) -> Result< crate::datadogV1::model::UsageTopAvgMetricsResponse, - Error, + datadog::Error, > { match self.get_usage_top_avg_metrics_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -5727,8 +5770,8 @@ impl UsageMeteringAPI { &self, params: GetUsageTopAvgMetricsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_usage_top_avg_metrics"; @@ -5790,7 +5833,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -5823,23 +5866,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_users.rs b/src/datadogV1/api/api_users.rs index c23cce093..235673bf0 100644 --- a/src/datadogV1/api/api_users.rs +++ b/src/datadogV1/api/api_users.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -65,13 +64,13 @@ pub enum UpdateUserError { #[derive(Debug, Clone)] pub struct UsersAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for UsersAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -79,7 +78,7 @@ impl UsersAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -121,7 +120,7 @@ impl UsersAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -134,13 +133,13 @@ impl UsersAPI { pub async fn create_user( &self, body: crate::datadogV1::model::User, - ) -> Result> { + ) -> Result> { match self.create_user_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -156,8 +155,10 @@ impl UsersAPI { pub async fn create_user_with_http_info( &self, body: crate::datadogV1::model::User, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.create_user"; @@ -182,7 +183,7 @@ impl UsersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -205,7 +206,7 @@ impl UsersAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -216,7 +217,7 @@ impl UsersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -226,7 +227,7 @@ impl UsersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -236,7 +237,7 @@ impl UsersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -258,22 +259,22 @@ impl UsersAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -284,13 +285,14 @@ impl UsersAPI { pub async fn disable_user( &self, user_handle: String, - ) -> Result> { + ) -> Result> + { match self.disable_user_with_http_info(user_handle).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -307,8 +309,8 @@ impl UsersAPI { &self, user_handle: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.disable_user"; @@ -318,7 +320,7 @@ impl UsersAPI { let local_uri_str = format!( "{}/api/v1/user/{user_handle}", local_configuration.get_operation_host(operation_id), - user_handle = urlencode(user_handle) + user_handle = datadog::urlencode(user_handle) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -334,7 +336,7 @@ impl UsersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -367,22 +369,22 @@ impl UsersAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -390,13 +392,13 @@ impl UsersAPI { pub async fn get_user( &self, user_handle: String, - ) -> Result> { + ) -> Result> { match self.get_user_with_http_info(user_handle).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -409,7 +411,10 @@ impl UsersAPI { pub async fn get_user_with_http_info( &self, user_handle: String, - ) -> Result, Error> { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.get_user"; @@ -418,7 +423,7 @@ impl UsersAPI { let local_uri_str = format!( "{}/api/v1/user/{user_handle}", local_configuration.get_operation_host(operation_id), - user_handle = urlencode(user_handle) + user_handle = datadog::urlencode(user_handle) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -434,7 +439,7 @@ impl UsersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -465,35 +470,35 @@ impl UsersAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// List all users for your organization. pub async fn list_users( &self, - ) -> Result> { + ) -> Result> { match self.list_users_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -505,8 +510,10 @@ impl UsersAPI { /// List all users for your organization. pub async fn list_users_with_http_info( &self, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.list_users"; @@ -530,7 +537,7 @@ impl UsersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -562,22 +569,22 @@ impl UsersAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -588,13 +595,13 @@ impl UsersAPI { &self, user_handle: String, body: crate::datadogV1::model::User, - ) -> Result> { + ) -> Result> { match self.update_user_with_http_info(user_handle, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -610,8 +617,10 @@ impl UsersAPI { &self, user_handle: String, body: crate::datadogV1::model::User, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.update_user"; @@ -620,7 +629,7 @@ impl UsersAPI { let local_uri_str = format!( "{}/api/v1/user/{user_handle}", local_configuration.get_operation_host(operation_id), - user_handle = urlencode(user_handle) + user_handle = datadog::urlencode(user_handle) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -637,7 +646,7 @@ impl UsersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -660,7 +669,7 @@ impl UsersAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -671,7 +680,7 @@ impl UsersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -681,7 +690,7 @@ impl UsersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -691,7 +700,7 @@ impl UsersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -713,22 +722,22 @@ impl UsersAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/api/api_webhooks_integration.rs b/src/datadogV1/api/api_webhooks_integration.rs index e88415823..793bd4ed0 100644 --- a/src/datadogV1/api/api_webhooks_integration.rs +++ b/src/datadogV1/api/api_webhooks_integration.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -97,13 +96,13 @@ pub enum UpdateWebhooksIntegrationCustomVariableError { #[derive(Debug, Clone)] pub struct WebhooksIntegrationAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for WebhooksIntegrationAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -111,7 +110,7 @@ impl WebhooksIntegrationAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -153,7 +152,7 @@ impl WebhooksIntegrationAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -163,14 +162,16 @@ impl WebhooksIntegrationAPI { pub async fn create_webhooks_integration( &self, body: crate::datadogV1::model::WebhooksIntegration, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::WebhooksIntegration, + datadog::Error, + > { match self.create_webhooks_integration_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -184,8 +185,8 @@ impl WebhooksIntegrationAPI { &self, body: crate::datadogV1::model::WebhooksIntegration, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_webhooks_integration"; @@ -211,7 +212,7 @@ impl WebhooksIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -234,7 +235,7 @@ impl WebhooksIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -245,7 +246,7 @@ impl WebhooksIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -255,7 +256,7 @@ impl WebhooksIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -265,7 +266,7 @@ impl WebhooksIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -289,23 +290,23 @@ impl WebhooksIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -315,7 +316,7 @@ impl WebhooksIntegrationAPI { body: crate::datadogV1::model::WebhooksIntegrationCustomVariable, ) -> Result< crate::datadogV1::model::WebhooksIntegrationCustomVariableResponse, - Error, + datadog::Error, > { match self .create_webhooks_integration_custom_variable_with_http_info(body) @@ -325,7 +326,7 @@ impl WebhooksIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -339,8 +340,10 @@ impl WebhooksIntegrationAPI { &self, body: crate::datadogV1::model::WebhooksIntegrationCustomVariable, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent< + crate::datadogV1::model::WebhooksIntegrationCustomVariableResponse, + >, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.create_webhooks_integration_custom_variable"; @@ -366,7 +369,7 @@ impl WebhooksIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -389,7 +392,7 @@ impl WebhooksIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -400,7 +403,7 @@ impl WebhooksIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -410,7 +413,7 @@ impl WebhooksIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -420,7 +423,7 @@ impl WebhooksIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -445,23 +448,23 @@ impl WebhooksIntegrationAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -469,7 +472,7 @@ impl WebhooksIntegrationAPI { pub async fn delete_webhooks_integration( &self, webhook_name: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_webhooks_integration_with_http_info(webhook_name) .await @@ -483,7 +486,7 @@ impl WebhooksIntegrationAPI { pub async fn delete_webhooks_integration_with_http_info( &self, webhook_name: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v1.delete_webhooks_integration"; @@ -492,7 +495,7 @@ impl WebhooksIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}", local_configuration.get_operation_host(operation_id), - webhook_name = urlencode(webhook_name) + webhook_name = datadog::urlencode(webhook_name) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -508,7 +511,7 @@ impl WebhooksIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -537,7 +540,7 @@ impl WebhooksIntegrationAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -545,12 +548,12 @@ impl WebhooksIntegrationAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -558,7 +561,7 @@ impl WebhooksIntegrationAPI { pub async fn delete_webhooks_integration_custom_variable( &self, custom_variable_name: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_webhooks_integration_custom_variable_with_http_info(custom_variable_name) .await @@ -572,7 +575,10 @@ impl WebhooksIntegrationAPI { pub async fn delete_webhooks_integration_custom_variable_with_http_info( &self, custom_variable_name: String, - ) -> Result, Error> { + ) -> Result< + datadog::ResponseContent<()>, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v1.delete_webhooks_integration_custom_variable"; @@ -581,7 +587,7 @@ impl WebhooksIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}", local_configuration.get_operation_host(operation_id), - custom_variable_name = urlencode(custom_variable_name) + custom_variable_name = datadog::urlencode(custom_variable_name) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -597,7 +603,7 @@ impl WebhooksIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -626,7 +632,7 @@ impl WebhooksIntegrationAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -634,12 +640,12 @@ impl WebhooksIntegrationAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -647,8 +653,10 @@ impl WebhooksIntegrationAPI { pub async fn get_webhooks_integration( &self, webhook_name: String, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::WebhooksIntegration, + datadog::Error, + > { match self .get_webhooks_integration_with_http_info(webhook_name) .await @@ -657,7 +665,7 @@ impl WebhooksIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -671,8 +679,8 @@ impl WebhooksIntegrationAPI { &self, webhook_name: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_webhooks_integration"; @@ -682,7 +690,7 @@ impl WebhooksIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}", local_configuration.get_operation_host(operation_id), - webhook_name = urlencode(webhook_name) + webhook_name = datadog::urlencode(webhook_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -698,7 +706,7 @@ impl WebhooksIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -731,23 +739,23 @@ impl WebhooksIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -760,7 +768,7 @@ impl WebhooksIntegrationAPI { custom_variable_name: String, ) -> Result< crate::datadogV1::model::WebhooksIntegrationCustomVariableResponse, - Error, + datadog::Error, > { match self .get_webhooks_integration_custom_variable_with_http_info(custom_variable_name) @@ -770,7 +778,7 @@ impl WebhooksIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -787,8 +795,10 @@ impl WebhooksIntegrationAPI { &self, custom_variable_name: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent< + crate::datadogV1::model::WebhooksIntegrationCustomVariableResponse, + >, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.get_webhooks_integration_custom_variable"; @@ -798,7 +808,7 @@ impl WebhooksIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}", local_configuration.get_operation_host(operation_id), - custom_variable_name = urlencode(custom_variable_name) + custom_variable_name = datadog::urlencode(custom_variable_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -814,7 +824,7 @@ impl WebhooksIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -848,23 +858,23 @@ impl WebhooksIntegrationAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -873,8 +883,10 @@ impl WebhooksIntegrationAPI { &self, webhook_name: String, body: crate::datadogV1::model::WebhooksIntegrationUpdateRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV1::model::WebhooksIntegration, + datadog::Error, + > { match self .update_webhooks_integration_with_http_info(webhook_name, body) .await @@ -883,7 +895,7 @@ impl WebhooksIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -898,8 +910,8 @@ impl WebhooksIntegrationAPI { webhook_name: String, body: crate::datadogV1::model::WebhooksIntegrationUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.update_webhooks_integration"; @@ -909,7 +921,7 @@ impl WebhooksIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}", local_configuration.get_operation_host(operation_id), - webhook_name = urlencode(webhook_name) + webhook_name = datadog::urlencode(webhook_name) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -926,7 +938,7 @@ impl WebhooksIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -949,7 +961,7 @@ impl WebhooksIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -960,7 +972,7 @@ impl WebhooksIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -970,7 +982,7 @@ impl WebhooksIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -980,7 +992,7 @@ impl WebhooksIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1004,23 +1016,23 @@ impl WebhooksIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1031,7 +1043,7 @@ impl WebhooksIntegrationAPI { body: crate::datadogV1::model::WebhooksIntegrationCustomVariableUpdateRequest, ) -> Result< crate::datadogV1::model::WebhooksIntegrationCustomVariableResponse, - Error, + datadog::Error, > { match self .update_webhooks_integration_custom_variable_with_http_info(custom_variable_name, body) @@ -1041,7 +1053,7 @@ impl WebhooksIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1056,8 +1068,10 @@ impl WebhooksIntegrationAPI { custom_variable_name: String, body: crate::datadogV1::model::WebhooksIntegrationCustomVariableUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent< + crate::datadogV1::model::WebhooksIntegrationCustomVariableResponse, + >, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v1.update_webhooks_integration_custom_variable"; @@ -1067,7 +1081,7 @@ impl WebhooksIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}", local_configuration.get_operation_host(operation_id), - custom_variable_name = urlencode(custom_variable_name) + custom_variable_name = datadog::urlencode(custom_variable_name) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -1084,7 +1098,7 @@ impl WebhooksIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1107,7 +1121,7 @@ impl WebhooksIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1118,7 +1132,7 @@ impl WebhooksIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1128,7 +1142,7 @@ impl WebhooksIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1138,7 +1152,7 @@ impl WebhooksIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1163,23 +1177,23 @@ impl WebhooksIntegrationAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV1/mod.rs b/src/datadogV1/mod.rs index f0d16bd38..a4f8bbe34 100644 --- a/src/datadogV1/mod.rs +++ b/src/datadogV1/mod.rs @@ -3,4 +3,35 @@ // Copyright 2019-Present Datadog, Inc. pub mod api; +pub use self::api::api_authentication; +pub use self::api::api_aws_integration; +pub use self::api::api_aws_logs_integration; +pub use self::api::api_azure_integration; +pub use self::api::api_dashboard_lists; +pub use self::api::api_dashboards; +pub use self::api::api_downtimes; +pub use self::api::api_events; +pub use self::api::api_gcp_integration; +pub use self::api::api_hosts; +pub use self::api::api_ip_ranges; +pub use self::api::api_key_management; +pub use self::api::api_logs; +pub use self::api::api_logs_indexes; +pub use self::api::api_logs_pipelines; +pub use self::api::api_metrics; +pub use self::api::api_monitors; +pub use self::api::api_notebooks; +pub use self::api::api_organizations; +pub use self::api::api_pager_duty_integration; +pub use self::api::api_security_monitoring; +pub use self::api::api_service_checks; +pub use self::api::api_service_level_objective_corrections; +pub use self::api::api_service_level_objectives; +pub use self::api::api_slack_integration; +pub use self::api::api_snapshots; +pub use self::api::api_synthetics; +pub use self::api::api_tags; +pub use self::api::api_usage_metering; +pub use self::api::api_users; +pub use self::api::api_webhooks_integration; pub mod model; diff --git a/src/datadogV2/api/api_api_management.rs b/src/datadogV2/api/api_api_management.rs index 6b57a4a5d..8fc41721a 100644 --- a/src/datadogV2/api/api_api_management.rs +++ b/src/datadogV2/api/api_api_management.rs @@ -1,9 +1,8 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use log::warn; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; @@ -84,13 +83,13 @@ pub enum UpdateOpenAPIError { #[derive(Debug, Clone)] pub struct APIManagementAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for APIManagementAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -98,7 +97,7 @@ impl APIManagementAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -140,7 +139,7 @@ impl APIManagementAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -154,13 +153,14 @@ impl APIManagementAPI { pub async fn create_open_api( &self, params: CreateOpenAPIOptionalParams, - ) -> Result> { + ) -> Result> + { match self.create_open_api_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -178,18 +178,18 @@ impl APIManagementAPI { &self, params: CreateOpenAPIOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_open_api"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.create_open_api' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } // unbox and build optional parameters @@ -219,7 +219,7 @@ impl APIManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -275,28 +275,31 @@ impl APIManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// Delete a specific API by ID. - pub async fn delete_open_api(&self, id: String) -> Result<(), Error> { + pub async fn delete_open_api( + &self, + id: String, + ) -> Result<(), datadog::Error> { match self.delete_open_api_with_http_info(id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -307,16 +310,16 @@ impl APIManagementAPI { pub async fn delete_open_api_with_http_info( &self, id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_open_api"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.delete_open_api' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -324,7 +327,7 @@ impl APIManagementAPI { let local_uri_str = format!( "{}/api/v2/apicatalog/api/{id}", local_configuration.get_operation_host(operation_id), - id = urlencode(id) + id = datadog::urlencode(id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -340,7 +343,7 @@ impl APIManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -369,7 +372,7 @@ impl APIManagementAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -377,23 +380,26 @@ impl APIManagementAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// Retrieve information about a specific API in [OpenAPI]() format file. - pub async fn get_open_api(&self, id: String) -> Result, Error> { + pub async fn get_open_api( + &self, + id: String, + ) -> Result, datadog::Error> { match self.get_open_api_with_http_info(id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -406,16 +412,16 @@ impl APIManagementAPI { pub async fn get_open_api_with_http_info( &self, id: String, - ) -> Result>, Error> { + ) -> Result>, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.get_open_api"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.get_open_api' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -423,7 +429,7 @@ impl APIManagementAPI { let local_uri_str = format!( "{}/api/v2/apicatalog/api/{id}/openapi", local_configuration.get_operation_host(operation_id), - id = urlencode(id) + id = datadog::urlencode(id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -439,7 +445,7 @@ impl APIManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -468,19 +474,19 @@ impl APIManagementAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content.clone(), entity: Some(local_content.into_bytes()), }) } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -491,13 +497,14 @@ impl APIManagementAPI { &self, id: String, params: UpdateOpenAPIOptionalParams, - ) -> Result> { + ) -> Result> + { match self.update_open_api_with_http_info(id, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -514,18 +521,18 @@ impl APIManagementAPI { id: String, params: UpdateOpenAPIOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_open_api"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.update_open_api' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } // unbox and build optional parameters @@ -536,7 +543,7 @@ impl APIManagementAPI { let local_uri_str = format!( "{}/api/v2/apicatalog/api/{id}/openapi", local_configuration.get_operation_host(operation_id), - id = urlencode(id) + id = datadog::urlencode(id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -556,7 +563,7 @@ impl APIManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -612,23 +619,23 @@ impl APIManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_apm_retention_filters.rs b/src/datadogV2/api/api_apm_retention_filters.rs index 0989487d7..3dee028ac 100644 --- a/src/datadogV2/api/api_apm_retention_filters.rs +++ b/src/datadogV2/api/api_apm_retention_filters.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -74,13 +73,13 @@ pub enum UpdateApmRetentionFilterError { #[derive(Debug, Clone)] pub struct APMRetentionFiltersAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for APMRetentionFiltersAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -88,7 +87,7 @@ impl APMRetentionFiltersAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -130,7 +129,7 @@ impl APMRetentionFiltersAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -143,14 +142,14 @@ impl APMRetentionFiltersAPI { body: crate::datadogV2::model::RetentionFilterCreateRequest, ) -> Result< crate::datadogV2::model::RetentionFilterResponse, - Error, + datadog::Error, > { match self.create_apm_retention_filter_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -165,8 +164,8 @@ impl APMRetentionFiltersAPI { &self, body: crate::datadogV2::model::RetentionFilterCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_apm_retention_filter"; @@ -192,7 +191,7 @@ impl APMRetentionFiltersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -215,7 +214,7 @@ impl APMRetentionFiltersAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -226,7 +225,7 @@ impl APMRetentionFiltersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -236,7 +235,7 @@ impl APMRetentionFiltersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -246,7 +245,7 @@ impl APMRetentionFiltersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -270,23 +269,23 @@ impl APMRetentionFiltersAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -294,7 +293,7 @@ impl APMRetentionFiltersAPI { pub async fn delete_apm_retention_filter( &self, filter_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_apm_retention_filter_with_http_info(filter_id) .await @@ -308,7 +307,7 @@ impl APMRetentionFiltersAPI { pub async fn delete_apm_retention_filter_with_http_info( &self, filter_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_apm_retention_filter"; @@ -317,7 +316,7 @@ impl APMRetentionFiltersAPI { let local_uri_str = format!( "{}/api/v2/apm/config/retention-filters/{filter_id}", local_configuration.get_operation_host(operation_id), - filter_id = urlencode(filter_id) + filter_id = datadog::urlencode(filter_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -333,7 +332,7 @@ impl APMRetentionFiltersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -362,7 +361,7 @@ impl APMRetentionFiltersAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -370,12 +369,12 @@ impl APMRetentionFiltersAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -383,8 +382,10 @@ impl APMRetentionFiltersAPI { pub async fn get_apm_retention_filter( &self, filter_id: String, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::RetentionFilterResponse, + datadog::Error, + > { match self .get_apm_retention_filter_with_http_info(filter_id) .await @@ -393,7 +394,7 @@ impl APMRetentionFiltersAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -407,8 +408,8 @@ impl APMRetentionFiltersAPI { &self, filter_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_apm_retention_filter"; @@ -418,7 +419,7 @@ impl APMRetentionFiltersAPI { let local_uri_str = format!( "{}/api/v2/apm/config/retention-filters/{filter_id}", local_configuration.get_operation_host(operation_id), - filter_id = urlencode(filter_id) + filter_id = datadog::urlencode(filter_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -434,7 +435,7 @@ impl APMRetentionFiltersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -467,23 +468,23 @@ impl APMRetentionFiltersAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -492,14 +493,14 @@ impl APMRetentionFiltersAPI { &self, ) -> Result< crate::datadogV2::model::RetentionFiltersResponse, - Error, + datadog::Error, > { match self.list_apm_retention_filters_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -512,8 +513,8 @@ impl APMRetentionFiltersAPI { pub async fn list_apm_retention_filters_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_apm_retention_filters"; @@ -538,7 +539,7 @@ impl APMRetentionFiltersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -571,23 +572,23 @@ impl APMRetentionFiltersAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -595,7 +596,7 @@ impl APMRetentionFiltersAPI { pub async fn reorder_apm_retention_filters( &self, body: crate::datadogV2::model::ReorderRetentionFiltersRequest, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .reorder_apm_retention_filters_with_http_info(body) .await @@ -609,7 +610,7 @@ impl APMRetentionFiltersAPI { pub async fn reorder_apm_retention_filters_with_http_info( &self, body: crate::datadogV2::model::ReorderRetentionFiltersRequest, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.reorder_apm_retention_filters"; @@ -634,7 +635,7 @@ impl APMRetentionFiltersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -657,7 +658,7 @@ impl APMRetentionFiltersAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -668,7 +669,7 @@ impl APMRetentionFiltersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -678,7 +679,7 @@ impl APMRetentionFiltersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -688,7 +689,7 @@ impl APMRetentionFiltersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -708,7 +709,7 @@ impl APMRetentionFiltersAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -716,12 +717,12 @@ impl APMRetentionFiltersAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -732,7 +733,7 @@ impl APMRetentionFiltersAPI { body: crate::datadogV2::model::RetentionFilterUpdateRequest, ) -> Result< crate::datadogV2::model::RetentionFilterResponse, - Error, + datadog::Error, > { match self .update_apm_retention_filter_with_http_info(filter_id, body) @@ -742,7 +743,7 @@ impl APMRetentionFiltersAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -757,8 +758,8 @@ impl APMRetentionFiltersAPI { filter_id: String, body: crate::datadogV2::model::RetentionFilterUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_apm_retention_filter"; @@ -768,7 +769,7 @@ impl APMRetentionFiltersAPI { let local_uri_str = format!( "{}/api/v2/apm/config/retention-filters/{filter_id}", local_configuration.get_operation_host(operation_id), - filter_id = urlencode(filter_id) + filter_id = datadog::urlencode(filter_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -785,7 +786,7 @@ impl APMRetentionFiltersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -808,7 +809,7 @@ impl APMRetentionFiltersAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -819,7 +820,7 @@ impl APMRetentionFiltersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -829,7 +830,7 @@ impl APMRetentionFiltersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -839,7 +840,7 @@ impl APMRetentionFiltersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -863,23 +864,23 @@ impl APMRetentionFiltersAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_audit.rs b/src/datadogV2/api/api_audit.rs index 374a3a03f..fec00e63d 100644 --- a/src/datadogV2/api/api_audit.rs +++ b/src/datadogV2/api/api_audit.rs @@ -1,14 +1,13 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -100,13 +99,13 @@ pub enum SearchAuditLogsError { #[derive(Debug, Clone)] pub struct AuditAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for AuditAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -114,7 +113,7 @@ impl AuditAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -156,7 +155,7 @@ impl AuditAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -171,13 +170,14 @@ impl AuditAPI { pub async fn list_audit_logs( &self, params: ListAuditLogsOptionalParams, - ) -> Result> { + ) -> Result> + { match self.list_audit_logs_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -189,8 +189,9 @@ impl AuditAPI { pub fn list_audit_logs_with_pagination( &self, mut params: ListAuditLogsOptionalParams, - ) -> impl Stream>> - + '_ { + ) -> impl Stream< + Item = Result>, + > + '_ { try_stream! { let mut page_size: i32 = 10; if params.page_limit.is_none() { @@ -230,8 +231,8 @@ impl AuditAPI { &self, params: ListAuditLogsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_audit_logs"; @@ -289,7 +290,7 @@ impl AuditAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -322,23 +323,23 @@ impl AuditAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -351,13 +352,16 @@ impl AuditAPI { pub async fn search_audit_logs( &self, params: SearchAuditLogsOptionalParams, - ) -> Result> { + ) -> Result< + crate::datadogV2::model::AuditLogsEventsResponse, + datadog::Error, + > { match self.search_audit_logs_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -370,7 +374,10 @@ impl AuditAPI { &self, mut params: SearchAuditLogsOptionalParams, ) -> impl Stream< - Item = Result>, + Item = Result< + crate::datadogV2::model::AuditLogsEvent, + datadog::Error, + >, > + '_ { try_stream! { let mut page_size: i32 = 10; @@ -417,8 +424,8 @@ impl AuditAPI { &self, params: SearchAuditLogsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.search_audit_logs"; @@ -447,7 +454,7 @@ impl AuditAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -470,7 +477,7 @@ impl AuditAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -481,7 +488,7 @@ impl AuditAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -491,7 +498,7 @@ impl AuditAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -501,7 +508,7 @@ impl AuditAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -525,23 +532,23 @@ impl AuditAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_authn_mappings.rs b/src/datadogV2/api/api_authn_mappings.rs index 8deb896f5..f20fc9d46 100644 --- a/src/datadogV2/api/api_authn_mappings.rs +++ b/src/datadogV2/api/api_authn_mappings.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -103,13 +102,13 @@ pub enum UpdateAuthNMappingError { #[derive(Debug, Clone)] pub struct AuthNMappingsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for AuthNMappingsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -117,7 +116,7 @@ impl AuthNMappingsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -159,7 +158,7 @@ impl AuthNMappingsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -169,13 +168,16 @@ impl AuthNMappingsAPI { pub async fn create_authn_mapping( &self, body: crate::datadogV2::model::AuthNMappingCreateRequest, - ) -> Result> { + ) -> Result< + crate::datadogV2::model::AuthNMappingResponse, + datadog::Error, + > { match self.create_authn_mapping_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -189,8 +191,8 @@ impl AuthNMappingsAPI { &self, body: crate::datadogV2::model::AuthNMappingCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_authn_mapping"; @@ -216,7 +218,7 @@ impl AuthNMappingsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -239,7 +241,7 @@ impl AuthNMappingsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -250,7 +252,7 @@ impl AuthNMappingsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -260,7 +262,7 @@ impl AuthNMappingsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -270,7 +272,7 @@ impl AuthNMappingsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -294,23 +296,23 @@ impl AuthNMappingsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -318,7 +320,7 @@ impl AuthNMappingsAPI { pub async fn delete_authn_mapping( &self, authn_mapping_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_authn_mapping_with_http_info(authn_mapping_id) .await @@ -332,7 +334,7 @@ impl AuthNMappingsAPI { pub async fn delete_authn_mapping_with_http_info( &self, authn_mapping_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_authn_mapping"; @@ -341,7 +343,7 @@ impl AuthNMappingsAPI { let local_uri_str = format!( "{}/api/v2/authn_mappings/{authn_mapping_id}", local_configuration.get_operation_host(operation_id), - authn_mapping_id = urlencode(authn_mapping_id) + authn_mapping_id = datadog::urlencode(authn_mapping_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -357,7 +359,7 @@ impl AuthNMappingsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -386,7 +388,7 @@ impl AuthNMappingsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -394,12 +396,12 @@ impl AuthNMappingsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -407,7 +409,8 @@ impl AuthNMappingsAPI { pub async fn get_authn_mapping( &self, authn_mapping_id: String, - ) -> Result> { + ) -> Result> + { match self .get_authn_mapping_with_http_info(authn_mapping_id) .await @@ -416,7 +419,7 @@ impl AuthNMappingsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -430,8 +433,8 @@ impl AuthNMappingsAPI { &self, authn_mapping_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_authn_mapping"; @@ -441,7 +444,7 @@ impl AuthNMappingsAPI { let local_uri_str = format!( "{}/api/v2/authn_mappings/{authn_mapping_id}", local_configuration.get_operation_host(operation_id), - authn_mapping_id = urlencode(authn_mapping_id) + authn_mapping_id = datadog::urlencode(authn_mapping_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -457,7 +460,7 @@ impl AuthNMappingsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -490,23 +493,23 @@ impl AuthNMappingsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -514,13 +517,16 @@ impl AuthNMappingsAPI { pub async fn list_authn_mappings( &self, params: ListAuthNMappingsOptionalParams, - ) -> Result> { + ) -> Result< + crate::datadogV2::model::AuthNMappingsResponse, + datadog::Error, + > { match self.list_authn_mappings_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -534,8 +540,8 @@ impl AuthNMappingsAPI { &self, params: ListAuthNMappingsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_authn_mappings"; @@ -583,7 +589,7 @@ impl AuthNMappingsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -616,23 +622,23 @@ impl AuthNMappingsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -641,7 +647,10 @@ impl AuthNMappingsAPI { &self, authn_mapping_id: String, body: crate::datadogV2::model::AuthNMappingUpdateRequest, - ) -> Result> { + ) -> Result< + crate::datadogV2::model::AuthNMappingResponse, + datadog::Error, + > { match self .update_authn_mapping_with_http_info(authn_mapping_id, body) .await @@ -650,7 +659,7 @@ impl AuthNMappingsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -665,8 +674,8 @@ impl AuthNMappingsAPI { authn_mapping_id: String, body: crate::datadogV2::model::AuthNMappingUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_authn_mapping"; @@ -676,7 +685,7 @@ impl AuthNMappingsAPI { let local_uri_str = format!( "{}/api/v2/authn_mappings/{authn_mapping_id}", local_configuration.get_operation_host(operation_id), - authn_mapping_id = urlencode(authn_mapping_id) + authn_mapping_id = datadog::urlencode(authn_mapping_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -693,7 +702,7 @@ impl AuthNMappingsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -716,7 +725,7 @@ impl AuthNMappingsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -727,7 +736,7 @@ impl AuthNMappingsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -737,7 +746,7 @@ impl AuthNMappingsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -747,7 +756,7 @@ impl AuthNMappingsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -771,23 +780,23 @@ impl AuthNMappingsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_case_management.rs b/src/datadogV2/api/api_case_management.rs index 124edb4b7..701f9b086 100644 --- a/src/datadogV2/api/api_case_management.rs +++ b/src/datadogV2/api/api_case_management.rs @@ -1,14 +1,13 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -213,13 +212,13 @@ pub enum UpdateStatusError { #[derive(Debug, Clone)] pub struct CaseManagementAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for CaseManagementAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -227,7 +226,7 @@ impl CaseManagementAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -269,7 +268,7 @@ impl CaseManagementAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -280,13 +279,13 @@ impl CaseManagementAPI { &self, case_id: String, body: crate::datadogV2::model::CaseEmptyRequest, - ) -> Result> { + ) -> Result> { match self.archive_case_with_http_info(case_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -300,8 +299,10 @@ impl CaseManagementAPI { &self, case_id: String, body: crate::datadogV2::model::CaseEmptyRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.archive_case"; @@ -310,7 +311,7 @@ impl CaseManagementAPI { let local_uri_str = format!( "{}/api/v2/cases/{case_id}/archive", local_configuration.get_operation_host(operation_id), - case_id = urlencode(case_id) + case_id = datadog::urlencode(case_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -327,7 +328,7 @@ impl CaseManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -350,7 +351,7 @@ impl CaseManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -361,7 +362,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -371,7 +372,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -381,7 +382,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -403,22 +404,22 @@ impl CaseManagementAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -427,13 +428,13 @@ impl CaseManagementAPI { &self, case_id: String, body: crate::datadogV2::model::CaseAssignRequest, - ) -> Result> { + ) -> Result> { match self.assign_case_with_http_info(case_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -447,8 +448,10 @@ impl CaseManagementAPI { &self, case_id: String, body: crate::datadogV2::model::CaseAssignRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.assign_case"; @@ -457,7 +460,7 @@ impl CaseManagementAPI { let local_uri_str = format!( "{}/api/v2/cases/{case_id}/assign", local_configuration.get_operation_host(operation_id), - case_id = urlencode(case_id) + case_id = datadog::urlencode(case_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -474,7 +477,7 @@ impl CaseManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -497,7 +500,7 @@ impl CaseManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -508,7 +511,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -518,7 +521,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -528,7 +531,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -550,22 +553,22 @@ impl CaseManagementAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -573,13 +576,13 @@ impl CaseManagementAPI { pub async fn create_case( &self, body: crate::datadogV2::model::CaseCreateRequest, - ) -> Result> { + ) -> Result> { match self.create_case_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -592,8 +595,10 @@ impl CaseManagementAPI { pub async fn create_case_with_http_info( &self, body: crate::datadogV2::model::CaseCreateRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.create_case"; @@ -618,7 +623,7 @@ impl CaseManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -641,7 +646,7 @@ impl CaseManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -652,7 +657,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -662,7 +667,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -672,7 +677,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -694,22 +699,22 @@ impl CaseManagementAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -717,13 +722,13 @@ impl CaseManagementAPI { pub async fn create_project( &self, body: crate::datadogV2::model::ProjectCreateRequest, - ) -> Result> { + ) -> Result> { match self.create_project_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -736,8 +741,10 @@ impl CaseManagementAPI { pub async fn create_project_with_http_info( &self, body: crate::datadogV2::model::ProjectCreateRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.create_project"; @@ -762,7 +769,7 @@ impl CaseManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -785,7 +792,7 @@ impl CaseManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -796,7 +803,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -806,7 +813,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -816,7 +823,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -838,23 +845,23 @@ impl CaseManagementAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -862,7 +869,7 @@ impl CaseManagementAPI { pub async fn delete_project( &self, project_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.delete_project_with_http_info(project_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -873,7 +880,7 @@ impl CaseManagementAPI { pub async fn delete_project_with_http_info( &self, project_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_project"; @@ -882,7 +889,7 @@ impl CaseManagementAPI { let local_uri_str = format!( "{}/api/v2/cases/projects/{project_id}", local_configuration.get_operation_host(operation_id), - project_id = urlencode(project_id) + project_id = datadog::urlencode(project_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -898,7 +905,7 @@ impl CaseManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -927,7 +934,7 @@ impl CaseManagementAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -935,12 +942,12 @@ impl CaseManagementAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -948,13 +955,13 @@ impl CaseManagementAPI { pub async fn get_case( &self, case_id: String, - ) -> Result> { + ) -> Result> { match self.get_case_with_http_info(case_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -967,7 +974,10 @@ impl CaseManagementAPI { pub async fn get_case_with_http_info( &self, case_id: String, - ) -> Result, Error> { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.get_case"; @@ -976,7 +986,7 @@ impl CaseManagementAPI { let local_uri_str = format!( "{}/api/v2/cases/{case_id}", local_configuration.get_operation_host(operation_id), - case_id = urlencode(case_id) + case_id = datadog::urlencode(case_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -992,7 +1002,7 @@ impl CaseManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1023,22 +1033,22 @@ impl CaseManagementAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1046,13 +1056,13 @@ impl CaseManagementAPI { pub async fn get_project( &self, project_id: String, - ) -> Result> { + ) -> Result> { match self.get_project_with_http_info(project_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1065,8 +1075,10 @@ impl CaseManagementAPI { pub async fn get_project_with_http_info( &self, project_id: String, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.get_project"; @@ -1075,7 +1087,7 @@ impl CaseManagementAPI { let local_uri_str = format!( "{}/api/v2/cases/projects/{project_id}", local_configuration.get_operation_host(operation_id), - project_id = urlencode(project_id) + project_id = datadog::urlencode(project_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1091,7 +1103,7 @@ impl CaseManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1122,35 +1134,35 @@ impl CaseManagementAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// Get all projects. pub async fn get_projects( &self, - ) -> Result> { + ) -> Result> { match self.get_projects_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1162,8 +1174,10 @@ impl CaseManagementAPI { /// Get all projects. pub async fn get_projects_with_http_info( &self, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.get_projects"; @@ -1187,7 +1201,7 @@ impl CaseManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1219,22 +1233,22 @@ impl CaseManagementAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1242,13 +1256,13 @@ impl CaseManagementAPI { pub async fn search_cases( &self, params: SearchCasesOptionalParams, - ) -> Result> { + ) -> Result> { match self.search_cases_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1260,7 +1274,7 @@ impl CaseManagementAPI { pub fn search_cases_with_pagination( &self, mut params: SearchCasesOptionalParams, - ) -> impl Stream>> + '_ + ) -> impl Stream>> + '_ { try_stream! { let mut page_size: i64 = 10; @@ -1295,8 +1309,10 @@ impl CaseManagementAPI { pub async fn search_cases_with_http_info( &self, params: SearchCasesOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.search_cases"; @@ -1348,7 +1364,7 @@ impl CaseManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1379,22 +1395,22 @@ impl CaseManagementAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1403,13 +1419,13 @@ impl CaseManagementAPI { &self, case_id: String, body: crate::datadogV2::model::CaseEmptyRequest, - ) -> Result> { + ) -> Result> { match self.unarchive_case_with_http_info(case_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1423,8 +1439,10 @@ impl CaseManagementAPI { &self, case_id: String, body: crate::datadogV2::model::CaseEmptyRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.unarchive_case"; @@ -1433,7 +1451,7 @@ impl CaseManagementAPI { let local_uri_str = format!( "{}/api/v2/cases/{case_id}/unarchive", local_configuration.get_operation_host(operation_id), - case_id = urlencode(case_id) + case_id = datadog::urlencode(case_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -1450,7 +1468,7 @@ impl CaseManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1473,7 +1491,7 @@ impl CaseManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1484,7 +1502,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1494,7 +1512,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1504,7 +1522,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1526,23 +1544,23 @@ impl CaseManagementAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1551,13 +1569,13 @@ impl CaseManagementAPI { &self, case_id: String, body: crate::datadogV2::model::CaseEmptyRequest, - ) -> Result> { + ) -> Result> { match self.unassign_case_with_http_info(case_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1571,8 +1589,10 @@ impl CaseManagementAPI { &self, case_id: String, body: crate::datadogV2::model::CaseEmptyRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.unassign_case"; @@ -1581,7 +1601,7 @@ impl CaseManagementAPI { let local_uri_str = format!( "{}/api/v2/cases/{case_id}/unassign", local_configuration.get_operation_host(operation_id), - case_id = urlencode(case_id) + case_id = datadog::urlencode(case_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -1598,7 +1618,7 @@ impl CaseManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1621,7 +1641,7 @@ impl CaseManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1632,7 +1652,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1642,7 +1662,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1652,7 +1672,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1674,22 +1694,22 @@ impl CaseManagementAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1698,13 +1718,13 @@ impl CaseManagementAPI { &self, case_id: String, body: crate::datadogV2::model::CaseUpdatePriorityRequest, - ) -> Result> { + ) -> Result> { match self.update_priority_with_http_info(case_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1718,8 +1738,10 @@ impl CaseManagementAPI { &self, case_id: String, body: crate::datadogV2::model::CaseUpdatePriorityRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.update_priority"; @@ -1728,7 +1750,7 @@ impl CaseManagementAPI { let local_uri_str = format!( "{}/api/v2/cases/{case_id}/priority", local_configuration.get_operation_host(operation_id), - case_id = urlencode(case_id) + case_id = datadog::urlencode(case_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -1745,7 +1767,7 @@ impl CaseManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1768,7 +1790,7 @@ impl CaseManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1779,7 +1801,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1789,7 +1811,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1799,7 +1821,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1821,23 +1843,23 @@ impl CaseManagementAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1846,13 +1868,13 @@ impl CaseManagementAPI { &self, case_id: String, body: crate::datadogV2::model::CaseUpdateStatusRequest, - ) -> Result> { + ) -> Result> { match self.update_status_with_http_info(case_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1866,8 +1888,10 @@ impl CaseManagementAPI { &self, case_id: String, body: crate::datadogV2::model::CaseUpdateStatusRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.update_status"; @@ -1876,7 +1900,7 @@ impl CaseManagementAPI { let local_uri_str = format!( "{}/api/v2/cases/{case_id}/status", local_configuration.get_operation_host(operation_id), - case_id = urlencode(case_id) + case_id = datadog::urlencode(case_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -1893,7 +1917,7 @@ impl CaseManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1916,7 +1940,7 @@ impl CaseManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1927,7 +1951,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1937,7 +1961,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1947,7 +1971,7 @@ impl CaseManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1969,22 +1993,22 @@ impl CaseManagementAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_ci_visibility_pipelines.rs b/src/datadogV2/api/api_ci_visibility_pipelines.rs index aa9131468..3149e8c84 100644 --- a/src/datadogV2/api/api_ci_visibility_pipelines.rs +++ b/src/datadogV2/api/api_ci_visibility_pipelines.rs @@ -1,14 +1,13 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -125,13 +124,13 @@ pub enum SearchCIAppPipelineEventsError { #[derive(Debug, Clone)] pub struct CIVisibilityPipelinesAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for CIVisibilityPipelinesAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -139,7 +138,7 @@ impl CIVisibilityPipelinesAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -181,7 +180,7 @@ impl CIVisibilityPipelinesAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -193,7 +192,7 @@ impl CIVisibilityPipelinesAPI { body: crate::datadogV2::model::CIAppPipelinesAggregateRequest, ) -> Result< crate::datadogV2::model::CIAppPipelinesAnalyticsAggregateResponse, - Error, + datadog::Error, > { match self .aggregate_ci_app_pipeline_events_with_http_info(body) @@ -203,7 +202,7 @@ impl CIVisibilityPipelinesAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -217,8 +216,8 @@ impl CIVisibilityPipelinesAPI { &self, body: crate::datadogV2::model::CIAppPipelinesAggregateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.aggregate_ci_app_pipeline_events"; @@ -244,7 +243,7 @@ impl CIVisibilityPipelinesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -267,7 +266,7 @@ impl CIVisibilityPipelinesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -278,7 +277,7 @@ impl CIVisibilityPipelinesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -288,7 +287,7 @@ impl CIVisibilityPipelinesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -298,7 +297,7 @@ impl CIVisibilityPipelinesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -323,23 +322,23 @@ impl CIVisibilityPipelinesAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -351,14 +350,14 @@ impl CIVisibilityPipelinesAPI { body: crate::datadogV2::model::CIAppCreatePipelineEventRequest, ) -> Result< std::collections::BTreeMap, - Error, + datadog::Error, > { match self.create_ci_app_pipeline_event_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -374,8 +373,8 @@ impl CIVisibilityPipelinesAPI { &self, body: crate::datadogV2::model::CIAppCreatePipelineEventRequest, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_ci_app_pipeline_event"; @@ -401,7 +400,7 @@ impl CIVisibilityPipelinesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -417,7 +416,7 @@ impl CIVisibilityPipelinesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -428,7 +427,7 @@ impl CIVisibilityPipelinesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -438,7 +437,7 @@ impl CIVisibilityPipelinesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -448,7 +447,7 @@ impl CIVisibilityPipelinesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -472,23 +471,23 @@ impl CIVisibilityPipelinesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -501,7 +500,7 @@ impl CIVisibilityPipelinesAPI { params: ListCIAppPipelineEventsOptionalParams, ) -> Result< crate::datadogV2::model::CIAppPipelineEventsResponse, - Error, + datadog::Error, > { match self .list_ci_app_pipeline_events_with_http_info(params) @@ -511,7 +510,7 @@ impl CIVisibilityPipelinesAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -526,7 +525,7 @@ impl CIVisibilityPipelinesAPI { ) -> impl Stream< Item = Result< crate::datadogV2::model::CIAppPipelineEvent, - Error, + datadog::Error, >, > + '_ { try_stream! { @@ -566,8 +565,8 @@ impl CIVisibilityPipelinesAPI { &self, params: ListCIAppPipelineEventsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_ci_app_pipeline_events"; @@ -625,7 +624,7 @@ impl CIVisibilityPipelinesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -658,23 +657,23 @@ impl CIVisibilityPipelinesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -687,7 +686,7 @@ impl CIVisibilityPipelinesAPI { params: SearchCIAppPipelineEventsOptionalParams, ) -> Result< crate::datadogV2::model::CIAppPipelineEventsResponse, - Error, + datadog::Error, > { match self .search_ci_app_pipeline_events_with_http_info(params) @@ -697,7 +696,7 @@ impl CIVisibilityPipelinesAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -712,7 +711,7 @@ impl CIVisibilityPipelinesAPI { ) -> impl Stream< Item = Result< crate::datadogV2::model::CIAppPipelineEvent, - Error, + datadog::Error, >, > + '_ { try_stream! { @@ -758,8 +757,8 @@ impl CIVisibilityPipelinesAPI { &self, params: SearchCIAppPipelineEventsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.search_ci_app_pipeline_events"; @@ -788,7 +787,7 @@ impl CIVisibilityPipelinesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -811,7 +810,7 @@ impl CIVisibilityPipelinesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -822,7 +821,7 @@ impl CIVisibilityPipelinesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -832,7 +831,7 @@ impl CIVisibilityPipelinesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -842,7 +841,7 @@ impl CIVisibilityPipelinesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -866,23 +865,23 @@ impl CIVisibilityPipelinesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_ci_visibility_tests.rs b/src/datadogV2/api/api_ci_visibility_tests.rs index bdbfac9ca..09e6bc832 100644 --- a/src/datadogV2/api/api_ci_visibility_tests.rs +++ b/src/datadogV2/api/api_ci_visibility_tests.rs @@ -1,14 +1,13 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -110,13 +109,13 @@ pub enum SearchCIAppTestEventsError { #[derive(Debug, Clone)] pub struct CIVisibilityTestsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for CIVisibilityTestsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -124,7 +123,7 @@ impl CIVisibilityTestsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -166,7 +165,7 @@ impl CIVisibilityTestsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -178,14 +177,14 @@ impl CIVisibilityTestsAPI { body: crate::datadogV2::model::CIAppTestsAggregateRequest, ) -> Result< crate::datadogV2::model::CIAppTestsAnalyticsAggregateResponse, - Error, + datadog::Error, > { match self.aggregate_ci_app_test_events_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -199,8 +198,8 @@ impl CIVisibilityTestsAPI { &self, body: crate::datadogV2::model::CIAppTestsAggregateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.aggregate_ci_app_test_events"; @@ -226,7 +225,7 @@ impl CIVisibilityTestsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -249,7 +248,7 @@ impl CIVisibilityTestsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -260,7 +259,7 @@ impl CIVisibilityTestsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -270,7 +269,7 @@ impl CIVisibilityTestsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -280,7 +279,7 @@ impl CIVisibilityTestsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -305,23 +304,23 @@ impl CIVisibilityTestsAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -332,14 +331,16 @@ impl CIVisibilityTestsAPI { pub async fn list_ci_app_test_events( &self, params: ListCIAppTestEventsOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::CIAppTestEventsResponse, + datadog::Error, + > { match self.list_ci_app_test_events_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -352,7 +353,10 @@ impl CIVisibilityTestsAPI { &self, mut params: ListCIAppTestEventsOptionalParams, ) -> impl Stream< - Item = Result>, + Item = Result< + crate::datadogV2::model::CIAppTestEvent, + datadog::Error, + >, > + '_ { try_stream! { let mut page_size: i32 = 10; @@ -391,8 +395,8 @@ impl CIVisibilityTestsAPI { &self, params: ListCIAppTestEventsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_ci_app_test_events"; @@ -450,7 +454,7 @@ impl CIVisibilityTestsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -483,23 +487,23 @@ impl CIVisibilityTestsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -510,14 +514,16 @@ impl CIVisibilityTestsAPI { pub async fn search_ci_app_test_events( &self, params: SearchCIAppTestEventsOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::CIAppTestEventsResponse, + datadog::Error, + > { match self.search_ci_app_test_events_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -530,7 +536,10 @@ impl CIVisibilityTestsAPI { &self, mut params: SearchCIAppTestEventsOptionalParams, ) -> impl Stream< - Item = Result>, + Item = Result< + crate::datadogV2::model::CIAppTestEvent, + datadog::Error, + >, > + '_ { try_stream! { let mut page_size: i32 = 10; @@ -575,8 +584,8 @@ impl CIVisibilityTestsAPI { &self, params: SearchCIAppTestEventsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.search_ci_app_test_events"; @@ -605,7 +614,7 @@ impl CIVisibilityTestsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -628,7 +637,7 @@ impl CIVisibilityTestsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -639,7 +648,7 @@ impl CIVisibilityTestsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -649,7 +658,7 @@ impl CIVisibilityTestsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -659,7 +668,7 @@ impl CIVisibilityTestsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -683,23 +692,23 @@ impl CIVisibilityTestsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_cloud_cost_management.rs b/src/datadogV2/api/api_cloud_cost_management.rs index 5c0f91065..b14c800fc 100644 --- a/src/datadogV2/api/api_cloud_cost_management.rs +++ b/src/datadogV2/api/api_cloud_cost_management.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -109,13 +108,13 @@ pub enum UpdateCostAzureUCConfigsError { #[derive(Debug, Clone)] pub struct CloudCostManagementAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for CloudCostManagementAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -123,7 +122,7 @@ impl CloudCostManagementAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -165,7 +164,7 @@ impl CloudCostManagementAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -175,14 +174,16 @@ impl CloudCostManagementAPI { pub async fn create_cost_awscur_config( &self, body: crate::datadogV2::model::AwsCURConfigPostRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::AwsCURConfigResponse, + datadog::Error, + > { match self.create_cost_awscur_config_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -196,8 +197,8 @@ impl CloudCostManagementAPI { &self, body: crate::datadogV2::model::AwsCURConfigPostRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_cost_awscur_config"; @@ -223,7 +224,7 @@ impl CloudCostManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -246,7 +247,7 @@ impl CloudCostManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -257,7 +258,7 @@ impl CloudCostManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -267,7 +268,7 @@ impl CloudCostManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -277,7 +278,7 @@ impl CloudCostManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -301,23 +302,23 @@ impl CloudCostManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -327,14 +328,14 @@ impl CloudCostManagementAPI { body: crate::datadogV2::model::AzureUCConfigPostRequest, ) -> Result< crate::datadogV2::model::AzureUCConfigPairsResponse, - Error, + datadog::Error, > { match self.create_cost_azure_uc_configs_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -348,8 +349,8 @@ impl CloudCostManagementAPI { &self, body: crate::datadogV2::model::AzureUCConfigPostRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_cost_azure_uc_configs"; @@ -375,7 +376,7 @@ impl CloudCostManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -398,7 +399,7 @@ impl CloudCostManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -409,7 +410,7 @@ impl CloudCostManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -419,7 +420,7 @@ impl CloudCostManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -429,7 +430,7 @@ impl CloudCostManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -453,23 +454,23 @@ impl CloudCostManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -477,7 +478,7 @@ impl CloudCostManagementAPI { pub async fn delete_cost_awscur_config( &self, cloud_account_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_cost_awscur_config_with_http_info(cloud_account_id) .await @@ -491,7 +492,7 @@ impl CloudCostManagementAPI { pub async fn delete_cost_awscur_config_with_http_info( &self, cloud_account_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_cost_awscur_config"; @@ -500,7 +501,7 @@ impl CloudCostManagementAPI { let local_uri_str = format!( "{}/api/v2/cost/aws_cur_config/{cloud_account_id}", local_configuration.get_operation_host(operation_id), - cloud_account_id = urlencode(cloud_account_id) + cloud_account_id = datadog::urlencode(cloud_account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -516,7 +517,7 @@ impl CloudCostManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -545,7 +546,7 @@ impl CloudCostManagementAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -553,12 +554,12 @@ impl CloudCostManagementAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -566,7 +567,7 @@ impl CloudCostManagementAPI { pub async fn delete_cost_azure_uc_config( &self, cloud_account_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_cost_azure_uc_config_with_http_info(cloud_account_id) .await @@ -580,7 +581,7 @@ impl CloudCostManagementAPI { pub async fn delete_cost_azure_uc_config_with_http_info( &self, cloud_account_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_cost_azure_uc_config"; @@ -589,7 +590,7 @@ impl CloudCostManagementAPI { let local_uri_str = format!( "{}/api/v2/cost/azure_uc_config/{cloud_account_id}", local_configuration.get_operation_host(operation_id), - cloud_account_id = urlencode(cloud_account_id) + cloud_account_id = datadog::urlencode(cloud_account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -605,7 +606,7 @@ impl CloudCostManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -634,7 +635,7 @@ impl CloudCostManagementAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -642,26 +643,28 @@ impl CloudCostManagementAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// Get the Cloud Cost Management activity. pub async fn get_cloud_cost_activity( &self, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::CloudCostActivityResponse, + datadog::Error, + > { match self.get_cloud_cost_activity_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -674,8 +677,8 @@ impl CloudCostManagementAPI { pub async fn get_cloud_cost_activity_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_cloud_cost_activity"; @@ -700,7 +703,7 @@ impl CloudCostManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -733,23 +736,23 @@ impl CloudCostManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -759,7 +762,7 @@ impl CloudCostManagementAPI { filter_management_account_id: String, ) -> Result< crate::datadogV2::model::AWSRelatedAccountsResponse, - Error, + datadog::Error, > { match self .list_aws_related_accounts_with_http_info(filter_management_account_id) @@ -769,7 +772,7 @@ impl CloudCostManagementAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -783,8 +786,8 @@ impl CloudCostManagementAPI { &self, filter_management_account_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_aws_related_accounts"; @@ -814,7 +817,7 @@ impl CloudCostManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -847,37 +850,39 @@ impl CloudCostManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// List the AWS CUR configs. pub async fn list_cost_awscur_configs( &self, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::AwsCURConfigsResponse, + datadog::Error, + > { match self.list_cost_awscur_configs_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -890,8 +895,8 @@ impl CloudCostManagementAPI { pub async fn list_cost_awscur_configs_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_cost_awscur_configs"; @@ -916,7 +921,7 @@ impl CloudCostManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -949,37 +954,39 @@ impl CloudCostManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// List the Azure configs. pub async fn list_cost_azure_uc_configs( &self, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::AzureUCConfigsResponse, + datadog::Error, + > { match self.list_cost_azure_uc_configs_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -992,8 +999,8 @@ impl CloudCostManagementAPI { pub async fn list_cost_azure_uc_configs_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_cost_azure_uc_configs"; @@ -1018,7 +1025,7 @@ impl CloudCostManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1051,23 +1058,23 @@ impl CloudCostManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1076,8 +1083,10 @@ impl CloudCostManagementAPI { &self, cloud_account_id: String, body: crate::datadogV2::model::AwsCURConfigPatchRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::AwsCURConfigsResponse, + datadog::Error, + > { match self .update_cost_awscur_config_with_http_info(cloud_account_id, body) .await @@ -1086,7 +1095,7 @@ impl CloudCostManagementAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1101,8 +1110,8 @@ impl CloudCostManagementAPI { cloud_account_id: String, body: crate::datadogV2::model::AwsCURConfigPatchRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_cost_awscur_config"; @@ -1112,7 +1121,7 @@ impl CloudCostManagementAPI { let local_uri_str = format!( "{}/api/v2/cost/aws_cur_config/{cloud_account_id}", local_configuration.get_operation_host(operation_id), - cloud_account_id = urlencode(cloud_account_id) + cloud_account_id = datadog::urlencode(cloud_account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -1129,7 +1138,7 @@ impl CloudCostManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1152,7 +1161,7 @@ impl CloudCostManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1163,7 +1172,7 @@ impl CloudCostManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1173,7 +1182,7 @@ impl CloudCostManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1183,7 +1192,7 @@ impl CloudCostManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1207,23 +1216,23 @@ impl CloudCostManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1234,7 +1243,7 @@ impl CloudCostManagementAPI { body: crate::datadogV2::model::AzureUCConfigPatchRequest, ) -> Result< crate::datadogV2::model::AzureUCConfigPairsResponse, - Error, + datadog::Error, > { match self .update_cost_azure_uc_configs_with_http_info(cloud_account_id, body) @@ -1244,7 +1253,7 @@ impl CloudCostManagementAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1259,8 +1268,8 @@ impl CloudCostManagementAPI { cloud_account_id: String, body: crate::datadogV2::model::AzureUCConfigPatchRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_cost_azure_uc_configs"; @@ -1270,7 +1279,7 @@ impl CloudCostManagementAPI { let local_uri_str = format!( "{}/api/v2/cost/azure_uc_config/{cloud_account_id}", local_configuration.get_operation_host(operation_id), - cloud_account_id = urlencode(cloud_account_id) + cloud_account_id = datadog::urlencode(cloud_account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -1287,7 +1296,7 @@ impl CloudCostManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1310,7 +1319,7 @@ impl CloudCostManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1321,7 +1330,7 @@ impl CloudCostManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1331,7 +1340,7 @@ impl CloudCostManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1341,7 +1350,7 @@ impl CloudCostManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1365,23 +1374,23 @@ impl CloudCostManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_cloud_workload_security.rs b/src/datadogV2/api/api_cloud_workload_security.rs index fc2070aa9..f796b69a6 100644 --- a/src/datadogV2/api/api_cloud_workload_security.rs +++ b/src/datadogV2/api/api_cloud_workload_security.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -135,13 +134,13 @@ pub enum UpdateCloudWorkloadSecurityAgentRuleError { #[derive(Debug, Clone)] pub struct CloudWorkloadSecurityAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for CloudWorkloadSecurityAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -149,7 +148,7 @@ impl CloudWorkloadSecurityAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -191,7 +190,7 @@ impl CloudWorkloadSecurityAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -203,7 +202,7 @@ impl CloudWorkloadSecurityAPI { body: crate::datadogV2::model::CloudWorkloadSecurityAgentRuleCreateRequest, ) -> Result< crate::datadogV2::model::CloudWorkloadSecurityAgentRuleResponse, - Error, + datadog::Error, > { match self .create_csm_threats_agent_rule_with_http_info(body) @@ -213,7 +212,7 @@ impl CloudWorkloadSecurityAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -227,8 +226,8 @@ impl CloudWorkloadSecurityAPI { &self, body: crate::datadogV2::model::CloudWorkloadSecurityAgentRuleCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_csm_threats_agent_rule"; @@ -254,7 +253,7 @@ impl CloudWorkloadSecurityAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -277,7 +276,7 @@ impl CloudWorkloadSecurityAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -288,7 +287,7 @@ impl CloudWorkloadSecurityAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -298,7 +297,7 @@ impl CloudWorkloadSecurityAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -308,7 +307,7 @@ impl CloudWorkloadSecurityAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -333,23 +332,23 @@ impl CloudWorkloadSecurityAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -359,7 +358,7 @@ impl CloudWorkloadSecurityAPI { body: crate::datadogV2::model::CloudWorkloadSecurityAgentRuleCreateRequest, ) -> Result< crate::datadogV2::model::CloudWorkloadSecurityAgentRuleResponse, - Error, + datadog::Error, > { match self .create_cloud_workload_security_agent_rule_with_http_info(body) @@ -369,7 +368,7 @@ impl CloudWorkloadSecurityAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -383,8 +382,8 @@ impl CloudWorkloadSecurityAPI { &self, body: crate::datadogV2::model::CloudWorkloadSecurityAgentRuleCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_cloud_workload_security_agent_rule"; @@ -410,7 +409,7 @@ impl CloudWorkloadSecurityAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -433,7 +432,7 @@ impl CloudWorkloadSecurityAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -444,7 +443,7 @@ impl CloudWorkloadSecurityAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -454,7 +453,7 @@ impl CloudWorkloadSecurityAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -464,7 +463,7 @@ impl CloudWorkloadSecurityAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -489,23 +488,23 @@ impl CloudWorkloadSecurityAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -513,7 +512,7 @@ impl CloudWorkloadSecurityAPI { pub async fn delete_csm_threats_agent_rule( &self, agent_rule_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_csm_threats_agent_rule_with_http_info(agent_rule_id) .await @@ -527,7 +526,7 @@ impl CloudWorkloadSecurityAPI { pub async fn delete_csm_threats_agent_rule_with_http_info( &self, agent_rule_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_csm_threats_agent_rule"; @@ -536,7 +535,7 @@ impl CloudWorkloadSecurityAPI { let local_uri_str = format!( "{}/api/v2/remote_config/products/cws/agent_rules/{agent_rule_id}", local_configuration.get_operation_host(operation_id), - agent_rule_id = urlencode(agent_rule_id) + agent_rule_id = datadog::urlencode(agent_rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -552,7 +551,7 @@ impl CloudWorkloadSecurityAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -581,7 +580,7 @@ impl CloudWorkloadSecurityAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -589,12 +588,12 @@ impl CloudWorkloadSecurityAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -602,7 +601,7 @@ impl CloudWorkloadSecurityAPI { pub async fn delete_cloud_workload_security_agent_rule( &self, agent_rule_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_cloud_workload_security_agent_rule_with_http_info(agent_rule_id) .await @@ -616,7 +615,10 @@ impl CloudWorkloadSecurityAPI { pub async fn delete_cloud_workload_security_agent_rule_with_http_info( &self, agent_rule_id: String, - ) -> Result, Error> { + ) -> Result< + datadog::ResponseContent<()>, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.delete_cloud_workload_security_agent_rule"; @@ -625,7 +627,7 @@ impl CloudWorkloadSecurityAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/cloud_workload_security/agent_rules/{agent_rule_id}", local_configuration.get_operation_host(operation_id), - agent_rule_id = urlencode(agent_rule_id) + agent_rule_id = datadog::urlencode(agent_rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -641,7 +643,7 @@ impl CloudWorkloadSecurityAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -670,7 +672,7 @@ impl CloudWorkloadSecurityAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -678,12 +680,12 @@ impl CloudWorkloadSecurityAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -692,13 +694,13 @@ impl CloudWorkloadSecurityAPI { /// your Agents to update the policy running in your environment. pub async fn download_csm_threats_policy( &self, - ) -> Result, Error> { + ) -> Result, datadog::Error> { match self.download_csm_threats_policy_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -712,7 +714,8 @@ impl CloudWorkloadSecurityAPI { /// your Agents to update the policy running in your environment. pub async fn download_csm_threats_policy_with_http_info( &self, - ) -> Result>, Error> { + ) -> Result>, datadog::Error> + { let local_configuration = &self.config; let operation_id = "v2.download_csm_threats_policy"; @@ -736,7 +739,7 @@ impl CloudWorkloadSecurityAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -765,7 +768,7 @@ impl CloudWorkloadSecurityAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content.clone(), entity: Some(local_content.into_bytes()), @@ -773,12 +776,12 @@ impl CloudWorkloadSecurityAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -787,7 +790,7 @@ impl CloudWorkloadSecurityAPI { /// your Agents to update the policy running in your environment. pub async fn download_cloud_workload_policy_file( &self, - ) -> Result, Error> { + ) -> Result, datadog::Error> { match self .download_cloud_workload_policy_file_with_http_info() .await @@ -796,7 +799,7 @@ impl CloudWorkloadSecurityAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -810,7 +813,10 @@ impl CloudWorkloadSecurityAPI { /// your Agents to update the policy running in your environment. pub async fn download_cloud_workload_policy_file_with_http_info( &self, - ) -> Result>, Error> { + ) -> Result< + datadog::ResponseContent>, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.download_cloud_workload_policy_file"; @@ -834,7 +840,7 @@ impl CloudWorkloadSecurityAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -863,7 +869,7 @@ impl CloudWorkloadSecurityAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content.clone(), entity: Some(local_content.into_bytes()), @@ -871,12 +877,12 @@ impl CloudWorkloadSecurityAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -886,7 +892,7 @@ impl CloudWorkloadSecurityAPI { agent_rule_id: String, ) -> Result< crate::datadogV2::model::CloudWorkloadSecurityAgentRuleResponse, - Error, + datadog::Error, > { match self .get_csm_threats_agent_rule_with_http_info(agent_rule_id) @@ -896,7 +902,7 @@ impl CloudWorkloadSecurityAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -910,8 +916,8 @@ impl CloudWorkloadSecurityAPI { &self, agent_rule_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_csm_threats_agent_rule"; @@ -921,7 +927,7 @@ impl CloudWorkloadSecurityAPI { let local_uri_str = format!( "{}/api/v2/remote_config/products/cws/agent_rules/{agent_rule_id}", local_configuration.get_operation_host(operation_id), - agent_rule_id = urlencode(agent_rule_id) + agent_rule_id = datadog::urlencode(agent_rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -937,7 +943,7 @@ impl CloudWorkloadSecurityAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -971,23 +977,23 @@ impl CloudWorkloadSecurityAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -997,7 +1003,7 @@ impl CloudWorkloadSecurityAPI { agent_rule_id: String, ) -> Result< crate::datadogV2::model::CloudWorkloadSecurityAgentRuleResponse, - Error, + datadog::Error, > { match self .get_cloud_workload_security_agent_rule_with_http_info(agent_rule_id) @@ -1007,7 +1013,7 @@ impl CloudWorkloadSecurityAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1021,8 +1027,8 @@ impl CloudWorkloadSecurityAPI { &self, agent_rule_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_cloud_workload_security_agent_rule"; @@ -1032,7 +1038,7 @@ impl CloudWorkloadSecurityAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/cloud_workload_security/agent_rules/{agent_rule_id}", local_configuration.get_operation_host(operation_id), - agent_rule_id = urlencode(agent_rule_id) + agent_rule_id = datadog::urlencode(agent_rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1048,7 +1054,7 @@ impl CloudWorkloadSecurityAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1082,23 +1088,23 @@ impl CloudWorkloadSecurityAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1107,14 +1113,14 @@ impl CloudWorkloadSecurityAPI { &self, ) -> Result< crate::datadogV2::model::CloudWorkloadSecurityAgentRulesListResponse, - Error, + datadog::Error, > { match self.list_csm_threats_agent_rules_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1127,8 +1133,10 @@ impl CloudWorkloadSecurityAPI { pub async fn list_csm_threats_agent_rules_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent< + crate::datadogV2::model::CloudWorkloadSecurityAgentRulesListResponse, + >, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_csm_threats_agent_rules"; @@ -1153,7 +1161,7 @@ impl CloudWorkloadSecurityAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1187,23 +1195,23 @@ impl CloudWorkloadSecurityAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1212,7 +1220,7 @@ impl CloudWorkloadSecurityAPI { &self, ) -> Result< crate::datadogV2::model::CloudWorkloadSecurityAgentRulesListResponse, - Error, + datadog::Error, > { match self .list_cloud_workload_security_agent_rules_with_http_info() @@ -1222,7 +1230,7 @@ impl CloudWorkloadSecurityAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1235,8 +1243,10 @@ impl CloudWorkloadSecurityAPI { pub async fn list_cloud_workload_security_agent_rules_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent< + crate::datadogV2::model::CloudWorkloadSecurityAgentRulesListResponse, + >, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_cloud_workload_security_agent_rules"; @@ -1261,7 +1271,7 @@ impl CloudWorkloadSecurityAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1295,23 +1305,23 @@ impl CloudWorkloadSecurityAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1323,7 +1333,7 @@ impl CloudWorkloadSecurityAPI { body: crate::datadogV2::model::CloudWorkloadSecurityAgentRuleUpdateRequest, ) -> Result< crate::datadogV2::model::CloudWorkloadSecurityAgentRuleResponse, - Error, + datadog::Error, > { match self .update_csm_threats_agent_rule_with_http_info(agent_rule_id, body) @@ -1333,7 +1343,7 @@ impl CloudWorkloadSecurityAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1349,8 +1359,8 @@ impl CloudWorkloadSecurityAPI { agent_rule_id: String, body: crate::datadogV2::model::CloudWorkloadSecurityAgentRuleUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_csm_threats_agent_rule"; @@ -1360,7 +1370,7 @@ impl CloudWorkloadSecurityAPI { let local_uri_str = format!( "{}/api/v2/remote_config/products/cws/agent_rules/{agent_rule_id}", local_configuration.get_operation_host(operation_id), - agent_rule_id = urlencode(agent_rule_id) + agent_rule_id = datadog::urlencode(agent_rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -1377,7 +1387,7 @@ impl CloudWorkloadSecurityAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1400,7 +1410,7 @@ impl CloudWorkloadSecurityAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1411,7 +1421,7 @@ impl CloudWorkloadSecurityAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1421,7 +1431,7 @@ impl CloudWorkloadSecurityAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1431,7 +1441,7 @@ impl CloudWorkloadSecurityAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1456,23 +1466,23 @@ impl CloudWorkloadSecurityAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1484,7 +1494,7 @@ impl CloudWorkloadSecurityAPI { body: crate::datadogV2::model::CloudWorkloadSecurityAgentRuleUpdateRequest, ) -> Result< crate::datadogV2::model::CloudWorkloadSecurityAgentRuleResponse, - Error, + datadog::Error, > { match self .update_cloud_workload_security_agent_rule_with_http_info(agent_rule_id, body) @@ -1494,7 +1504,7 @@ impl CloudWorkloadSecurityAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1510,8 +1520,8 @@ impl CloudWorkloadSecurityAPI { agent_rule_id: String, body: crate::datadogV2::model::CloudWorkloadSecurityAgentRuleUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_cloud_workload_security_agent_rule"; @@ -1521,7 +1531,7 @@ impl CloudWorkloadSecurityAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/cloud_workload_security/agent_rules/{agent_rule_id}", local_configuration.get_operation_host(operation_id), - agent_rule_id = urlencode(agent_rule_id) + agent_rule_id = datadog::urlencode(agent_rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -1538,7 +1548,7 @@ impl CloudWorkloadSecurityAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1561,7 +1571,7 @@ impl CloudWorkloadSecurityAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1572,7 +1582,7 @@ impl CloudWorkloadSecurityAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1582,7 +1592,7 @@ impl CloudWorkloadSecurityAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1592,7 +1602,7 @@ impl CloudWorkloadSecurityAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1617,23 +1627,23 @@ impl CloudWorkloadSecurityAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_cloudflare_integration.rs b/src/datadogV2/api/api_cloudflare_integration.rs index 32570baba..e4185e38d 100644 --- a/src/datadogV2/api/api_cloudflare_integration.rs +++ b/src/datadogV2/api/api_cloudflare_integration.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -68,13 +67,13 @@ pub enum UpdateCloudflareAccountError { #[derive(Debug, Clone)] pub struct CloudflareIntegrationAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for CloudflareIntegrationAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -82,7 +81,7 @@ impl CloudflareIntegrationAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -124,7 +123,7 @@ impl CloudflareIntegrationAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -136,14 +135,14 @@ impl CloudflareIntegrationAPI { body: crate::datadogV2::model::CloudflareAccountCreateRequest, ) -> Result< crate::datadogV2::model::CloudflareAccountResponse, - Error, + datadog::Error, > { match self.create_cloudflare_account_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -157,8 +156,8 @@ impl CloudflareIntegrationAPI { &self, body: crate::datadogV2::model::CloudflareAccountCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_cloudflare_account"; @@ -184,7 +183,7 @@ impl CloudflareIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -207,7 +206,7 @@ impl CloudflareIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -218,7 +217,7 @@ impl CloudflareIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -228,7 +227,7 @@ impl CloudflareIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -238,7 +237,7 @@ impl CloudflareIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -262,23 +261,23 @@ impl CloudflareIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -286,7 +285,7 @@ impl CloudflareIntegrationAPI { pub async fn delete_cloudflare_account( &self, account_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_cloudflare_account_with_http_info(account_id) .await @@ -300,7 +299,7 @@ impl CloudflareIntegrationAPI { pub async fn delete_cloudflare_account_with_http_info( &self, account_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_cloudflare_account"; @@ -309,7 +308,7 @@ impl CloudflareIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/cloudflare/accounts/{account_id}", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id) + account_id = datadog::urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -325,7 +324,7 @@ impl CloudflareIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -354,7 +353,7 @@ impl CloudflareIntegrationAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -362,12 +361,12 @@ impl CloudflareIntegrationAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -375,14 +374,16 @@ impl CloudflareIntegrationAPI { pub async fn get_cloudflare_account( &self, account_id: String, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::CloudflareAccountResponse, + datadog::Error, + > { match self.get_cloudflare_account_with_http_info(account_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -396,8 +397,8 @@ impl CloudflareIntegrationAPI { &self, account_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_cloudflare_account"; @@ -407,7 +408,7 @@ impl CloudflareIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/cloudflare/accounts/{account_id}", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id) + account_id = datadog::urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -423,7 +424,7 @@ impl CloudflareIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -456,23 +457,23 @@ impl CloudflareIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -481,14 +482,14 @@ impl CloudflareIntegrationAPI { &self, ) -> Result< crate::datadogV2::model::CloudflareAccountsResponse, - Error, + datadog::Error, > { match self.list_cloudflare_accounts_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -501,8 +502,8 @@ impl CloudflareIntegrationAPI { pub async fn list_cloudflare_accounts_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_cloudflare_accounts"; @@ -527,7 +528,7 @@ impl CloudflareIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -560,23 +561,23 @@ impl CloudflareIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -587,7 +588,7 @@ impl CloudflareIntegrationAPI { body: crate::datadogV2::model::CloudflareAccountUpdateRequest, ) -> Result< crate::datadogV2::model::CloudflareAccountResponse, - Error, + datadog::Error, > { match self .update_cloudflare_account_with_http_info(account_id, body) @@ -597,7 +598,7 @@ impl CloudflareIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -612,8 +613,8 @@ impl CloudflareIntegrationAPI { account_id: String, body: crate::datadogV2::model::CloudflareAccountUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_cloudflare_account"; @@ -623,7 +624,7 @@ impl CloudflareIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/cloudflare/accounts/{account_id}", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id) + account_id = datadog::urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -640,7 +641,7 @@ impl CloudflareIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -663,7 +664,7 @@ impl CloudflareIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -674,7 +675,7 @@ impl CloudflareIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -684,7 +685,7 @@ impl CloudflareIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -694,7 +695,7 @@ impl CloudflareIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -718,23 +719,23 @@ impl CloudflareIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_confluent_cloud.rs b/src/datadogV2/api/api_confluent_cloud.rs index 5effdc1a7..597b5e4b1 100644 --- a/src/datadogV2/api/api_confluent_cloud.rs +++ b/src/datadogV2/api/api_confluent_cloud.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -123,13 +122,13 @@ pub enum UpdateConfluentResourceError { #[derive(Debug, Clone)] pub struct ConfluentCloudAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for ConfluentCloudAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -137,7 +136,7 @@ impl ConfluentCloudAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -179,7 +178,7 @@ impl ConfluentCloudAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -189,14 +188,16 @@ impl ConfluentCloudAPI { pub async fn create_confluent_account( &self, body: crate::datadogV2::model::ConfluentAccountCreateRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::ConfluentAccountResponse, + datadog::Error, + > { match self.create_confluent_account_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -210,8 +211,8 @@ impl ConfluentCloudAPI { &self, body: crate::datadogV2::model::ConfluentAccountCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_confluent_account"; @@ -237,7 +238,7 @@ impl ConfluentCloudAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -260,7 +261,7 @@ impl ConfluentCloudAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -271,7 +272,7 @@ impl ConfluentCloudAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -281,7 +282,7 @@ impl ConfluentCloudAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -291,7 +292,7 @@ impl ConfluentCloudAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -315,23 +316,23 @@ impl ConfluentCloudAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -342,7 +343,7 @@ impl ConfluentCloudAPI { body: crate::datadogV2::model::ConfluentResourceRequest, ) -> Result< crate::datadogV2::model::ConfluentResourceResponse, - Error, + datadog::Error, > { match self .create_confluent_resource_with_http_info(account_id, body) @@ -352,7 +353,7 @@ impl ConfluentCloudAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -367,8 +368,8 @@ impl ConfluentCloudAPI { account_id: String, body: crate::datadogV2::model::ConfluentResourceRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_confluent_resource"; @@ -378,7 +379,7 @@ impl ConfluentCloudAPI { let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id) + account_id = datadog::urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -395,7 +396,7 @@ impl ConfluentCloudAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -418,7 +419,7 @@ impl ConfluentCloudAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -429,7 +430,7 @@ impl ConfluentCloudAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -439,7 +440,7 @@ impl ConfluentCloudAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -449,7 +450,7 @@ impl ConfluentCloudAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -473,23 +474,23 @@ impl ConfluentCloudAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -497,7 +498,7 @@ impl ConfluentCloudAPI { pub async fn delete_confluent_account( &self, account_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_confluent_account_with_http_info(account_id) .await @@ -511,7 +512,7 @@ impl ConfluentCloudAPI { pub async fn delete_confluent_account_with_http_info( &self, account_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_confluent_account"; @@ -520,7 +521,7 @@ impl ConfluentCloudAPI { let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id) + account_id = datadog::urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -536,7 +537,7 @@ impl ConfluentCloudAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -565,7 +566,7 @@ impl ConfluentCloudAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -573,12 +574,12 @@ impl ConfluentCloudAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -587,7 +588,7 @@ impl ConfluentCloudAPI { &self, account_id: String, resource_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_confluent_resource_with_http_info(account_id, resource_id) .await @@ -602,7 +603,7 @@ impl ConfluentCloudAPI { &self, account_id: String, resource_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_confluent_resource"; @@ -611,8 +612,8 @@ impl ConfluentCloudAPI { let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources/{resource_id}", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id), - resource_id = urlencode(resource_id) + account_id = datadog::urlencode(account_id), + resource_id = datadog::urlencode(resource_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -628,7 +629,7 @@ impl ConfluentCloudAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -657,7 +658,7 @@ impl ConfluentCloudAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -665,12 +666,12 @@ impl ConfluentCloudAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -678,14 +679,16 @@ impl ConfluentCloudAPI { pub async fn get_confluent_account( &self, account_id: String, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::ConfluentAccountResponse, + datadog::Error, + > { match self.get_confluent_account_with_http_info(account_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -699,8 +702,8 @@ impl ConfluentCloudAPI { &self, account_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_confluent_account"; @@ -710,7 +713,7 @@ impl ConfluentCloudAPI { let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id) + account_id = datadog::urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -726,7 +729,7 @@ impl ConfluentCloudAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -759,23 +762,23 @@ impl ConfluentCloudAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -784,8 +787,10 @@ impl ConfluentCloudAPI { &self, account_id: String, resource_id: String, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::ConfluentResourceResponse, + datadog::Error, + > { match self .get_confluent_resource_with_http_info(account_id, resource_id) .await @@ -794,7 +799,7 @@ impl ConfluentCloudAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -809,8 +814,8 @@ impl ConfluentCloudAPI { account_id: String, resource_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_confluent_resource"; @@ -820,8 +825,8 @@ impl ConfluentCloudAPI { let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources/{resource_id}", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id), - resource_id = urlencode(resource_id) + account_id = datadog::urlencode(account_id), + resource_id = datadog::urlencode(resource_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -837,7 +842,7 @@ impl ConfluentCloudAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -870,37 +875,39 @@ impl ConfluentCloudAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// List Confluent accounts. pub async fn list_confluent_account( &self, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::ConfluentAccountsResponse, + datadog::Error, + > { match self.list_confluent_account_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -913,8 +920,8 @@ impl ConfluentCloudAPI { pub async fn list_confluent_account_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_confluent_account"; @@ -939,7 +946,7 @@ impl ConfluentCloudAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -972,23 +979,23 @@ impl ConfluentCloudAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -998,7 +1005,7 @@ impl ConfluentCloudAPI { account_id: String, ) -> Result< crate::datadogV2::model::ConfluentResourcesResponse, - Error, + datadog::Error, > { match self .list_confluent_resource_with_http_info(account_id) @@ -1008,7 +1015,7 @@ impl ConfluentCloudAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1022,8 +1029,8 @@ impl ConfluentCloudAPI { &self, account_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_confluent_resource"; @@ -1033,7 +1040,7 @@ impl ConfluentCloudAPI { let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id) + account_id = datadog::urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1049,7 +1056,7 @@ impl ConfluentCloudAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1082,23 +1089,23 @@ impl ConfluentCloudAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1107,8 +1114,10 @@ impl ConfluentCloudAPI { &self, account_id: String, body: crate::datadogV2::model::ConfluentAccountUpdateRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::ConfluentAccountResponse, + datadog::Error, + > { match self .update_confluent_account_with_http_info(account_id, body) .await @@ -1117,7 +1126,7 @@ impl ConfluentCloudAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1132,8 +1141,8 @@ impl ConfluentCloudAPI { account_id: String, body: crate::datadogV2::model::ConfluentAccountUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_confluent_account"; @@ -1143,7 +1152,7 @@ impl ConfluentCloudAPI { let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id) + account_id = datadog::urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -1160,7 +1169,7 @@ impl ConfluentCloudAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1183,7 +1192,7 @@ impl ConfluentCloudAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1194,7 +1203,7 @@ impl ConfluentCloudAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1204,7 +1213,7 @@ impl ConfluentCloudAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1214,7 +1223,7 @@ impl ConfluentCloudAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1238,23 +1247,23 @@ impl ConfluentCloudAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1266,7 +1275,7 @@ impl ConfluentCloudAPI { body: crate::datadogV2::model::ConfluentResourceRequest, ) -> Result< crate::datadogV2::model::ConfluentResourceResponse, - Error, + datadog::Error, > { match self .update_confluent_resource_with_http_info(account_id, resource_id, body) @@ -1276,7 +1285,7 @@ impl ConfluentCloudAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1292,8 +1301,8 @@ impl ConfluentCloudAPI { resource_id: String, body: crate::datadogV2::model::ConfluentResourceRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_confluent_resource"; @@ -1303,8 +1312,8 @@ impl ConfluentCloudAPI { let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources/{resource_id}", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id), - resource_id = urlencode(resource_id) + account_id = datadog::urlencode(account_id), + resource_id = datadog::urlencode(resource_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -1321,7 +1330,7 @@ impl ConfluentCloudAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1344,7 +1353,7 @@ impl ConfluentCloudAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1355,7 +1364,7 @@ impl ConfluentCloudAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1365,7 +1374,7 @@ impl ConfluentCloudAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1375,7 +1384,7 @@ impl ConfluentCloudAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1399,23 +1408,23 @@ impl ConfluentCloudAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_container_images.rs b/src/datadogV2/api/api_container_images.rs index 81362314e..6c1d1623f 100644 --- a/src/datadogV2/api/api_container_images.rs +++ b/src/datadogV2/api/api_container_images.rs @@ -1,10 +1,9 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; @@ -66,13 +65,13 @@ pub enum ListContainerImagesError { #[derive(Debug, Clone)] pub struct ContainerImagesAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for ContainerImagesAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -80,7 +79,7 @@ impl ContainerImagesAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -122,7 +121,7 @@ impl ContainerImagesAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -132,14 +131,16 @@ impl ContainerImagesAPI { pub async fn list_container_images( &self, params: ListContainerImagesOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::ContainerImagesResponse, + datadog::Error, + > { match self.list_container_images_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -152,7 +153,10 @@ impl ContainerImagesAPI { &self, mut params: ListContainerImagesOptionalParams, ) -> impl Stream< - Item = Result>, + Item = Result< + crate::datadogV2::model::ContainerImageItem, + datadog::Error, + >, > + '_ { try_stream! { let mut page_size: i32 = 1000; @@ -188,8 +192,8 @@ impl ContainerImagesAPI { &self, params: ListContainerImagesOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_container_images"; @@ -242,7 +246,7 @@ impl ContainerImagesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -275,23 +279,23 @@ impl ContainerImagesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_containers.rs b/src/datadogV2/api/api_containers.rs index 38abaf6b0..25bb800c8 100644 --- a/src/datadogV2/api/api_containers.rs +++ b/src/datadogV2/api/api_containers.rs @@ -1,10 +1,9 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; @@ -66,13 +65,13 @@ pub enum ListContainersError { #[derive(Debug, Clone)] pub struct ContainersAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for ContainersAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -80,7 +79,7 @@ impl ContainersAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -122,7 +121,7 @@ impl ContainersAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -132,13 +131,14 @@ impl ContainersAPI { pub async fn list_containers( &self, params: ListContainersOptionalParams, - ) -> Result> { + ) -> Result> + { match self.list_containers_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -150,8 +150,9 @@ impl ContainersAPI { pub fn list_containers_with_pagination( &self, mut params: ListContainersOptionalParams, - ) -> impl Stream>> - + '_ { + ) -> impl Stream< + Item = Result>, + > + '_ { try_stream! { let mut page_size: i32 = 1000; if params.page_size.is_none() { @@ -186,8 +187,8 @@ impl ContainersAPI { &self, params: ListContainersOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_containers"; @@ -240,7 +241,7 @@ impl ContainersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -273,23 +274,23 @@ impl ContainersAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_dashboard_lists.rs b/src/datadogV2/api/api_dashboard_lists.rs index 0b083475f..4bf858006 100644 --- a/src/datadogV2/api/api_dashboard_lists.rs +++ b/src/datadogV2/api/api_dashboard_lists.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -56,13 +55,13 @@ pub enum UpdateDashboardListItemsError { #[derive(Debug, Clone)] pub struct DashboardListsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for DashboardListsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -70,7 +69,7 @@ impl DashboardListsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -112,7 +111,7 @@ impl DashboardListsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -125,7 +124,7 @@ impl DashboardListsAPI { body: crate::datadogV2::model::DashboardListAddItemsRequest, ) -> Result< crate::datadogV2::model::DashboardListAddItemsResponse, - Error, + datadog::Error, > { match self .create_dashboard_list_items_with_http_info(dashboard_list_id, body) @@ -135,7 +134,7 @@ impl DashboardListsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -150,8 +149,8 @@ impl DashboardListsAPI { dashboard_list_id: i64, body: crate::datadogV2::model::DashboardListAddItemsRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_dashboard_list_items"; @@ -178,7 +177,7 @@ impl DashboardListsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -201,7 +200,7 @@ impl DashboardListsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -212,7 +211,7 @@ impl DashboardListsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -222,7 +221,7 @@ impl DashboardListsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -232,7 +231,7 @@ impl DashboardListsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -256,23 +255,23 @@ impl DashboardListsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -283,7 +282,7 @@ impl DashboardListsAPI { body: crate::datadogV2::model::DashboardListDeleteItemsRequest, ) -> Result< crate::datadogV2::model::DashboardListDeleteItemsResponse, - Error, + datadog::Error, > { match self .delete_dashboard_list_items_with_http_info(dashboard_list_id, body) @@ -293,7 +292,7 @@ impl DashboardListsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -308,8 +307,8 @@ impl DashboardListsAPI { dashboard_list_id: i64, body: crate::datadogV2::model::DashboardListDeleteItemsRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.delete_dashboard_list_items"; @@ -336,7 +335,7 @@ impl DashboardListsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -359,7 +358,7 @@ impl DashboardListsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -370,7 +369,7 @@ impl DashboardListsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -380,7 +379,7 @@ impl DashboardListsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -390,7 +389,7 @@ impl DashboardListsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -414,23 +413,23 @@ impl DashboardListsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -438,8 +437,10 @@ impl DashboardListsAPI { pub async fn get_dashboard_list_items( &self, dashboard_list_id: i64, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::DashboardListItems, + datadog::Error, + > { match self .get_dashboard_list_items_with_http_info(dashboard_list_id) .await @@ -448,7 +449,7 @@ impl DashboardListsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -462,8 +463,8 @@ impl DashboardListsAPI { &self, dashboard_list_id: i64, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_dashboard_list_items"; @@ -489,7 +490,7 @@ impl DashboardListsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -522,23 +523,23 @@ impl DashboardListsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -549,7 +550,7 @@ impl DashboardListsAPI { body: crate::datadogV2::model::DashboardListUpdateItemsRequest, ) -> Result< crate::datadogV2::model::DashboardListUpdateItemsResponse, - Error, + datadog::Error, > { match self .update_dashboard_list_items_with_http_info(dashboard_list_id, body) @@ -559,7 +560,7 @@ impl DashboardListsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -574,8 +575,8 @@ impl DashboardListsAPI { dashboard_list_id: i64, body: crate::datadogV2::model::DashboardListUpdateItemsRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_dashboard_list_items"; @@ -602,7 +603,7 @@ impl DashboardListsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -625,7 +626,7 @@ impl DashboardListsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -636,7 +637,7 @@ impl DashboardListsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -646,7 +647,7 @@ impl DashboardListsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -656,7 +657,7 @@ impl DashboardListsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -680,23 +681,23 @@ impl DashboardListsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_dora_metrics.rs b/src/datadogV2/api/api_dora_metrics.rs index 3f1754fc3..f602d5f26 100644 --- a/src/datadogV2/api/api_dora_metrics.rs +++ b/src/datadogV2/api/api_dora_metrics.rs @@ -1,13 +1,12 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use log::warn; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -34,13 +33,13 @@ pub enum CreateDORAIncidentError { #[derive(Debug, Clone)] pub struct DORAMetricsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for DORAMetricsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -48,7 +47,7 @@ impl DORAMetricsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -90,7 +89,7 @@ impl DORAMetricsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -105,14 +104,16 @@ impl DORAMetricsAPI { pub async fn create_dora_deployment( &self, body: crate::datadogV2::model::DORADeploymentRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::DORADeploymentResponse, + datadog::Error, + > { match self.create_dora_deployment_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -131,18 +132,18 @@ impl DORAMetricsAPI { &self, body: crate::datadogV2::model::DORADeploymentRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_dora_deployment"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.create_dora_deployment' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -166,7 +167,7 @@ impl DORAMetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -182,7 +183,7 @@ impl DORAMetricsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -193,7 +194,7 @@ impl DORAMetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -203,7 +204,7 @@ impl DORAMetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -213,7 +214,7 @@ impl DORAMetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -237,23 +238,23 @@ impl DORAMetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -265,13 +266,16 @@ impl DORAMetricsAPI { pub async fn create_dora_incident( &self, body: crate::datadogV2::model::DORAIncidentRequest, - ) -> Result> { + ) -> Result< + crate::datadogV2::model::DORAIncidentResponse, + datadog::Error, + > { match self.create_dora_incident_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -289,18 +293,18 @@ impl DORAMetricsAPI { &self, body: crate::datadogV2::model::DORAIncidentRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_dora_incident"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.create_dora_incident' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -324,7 +328,7 @@ impl DORAMetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -340,7 +344,7 @@ impl DORAMetricsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -351,7 +355,7 @@ impl DORAMetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -361,7 +365,7 @@ impl DORAMetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -371,7 +375,7 @@ impl DORAMetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -395,23 +399,23 @@ impl DORAMetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_downtimes.rs b/src/datadogV2/api/api_downtimes.rs index 2de712565..109a2558c 100644 --- a/src/datadogV2/api/api_downtimes.rs +++ b/src/datadogV2/api/api_downtimes.rs @@ -1,14 +1,13 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -155,13 +154,13 @@ pub enum UpdateDowntimeError { #[derive(Debug, Clone)] pub struct DowntimesAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for DowntimesAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -169,7 +168,7 @@ impl DowntimesAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -211,7 +210,7 @@ impl DowntimesAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -221,7 +220,7 @@ impl DowntimesAPI { pub async fn cancel_downtime( &self, downtime_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.cancel_downtime_with_http_info(downtime_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -232,7 +231,7 @@ impl DowntimesAPI { pub async fn cancel_downtime_with_http_info( &self, downtime_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.cancel_downtime"; @@ -241,7 +240,7 @@ impl DowntimesAPI { let local_uri_str = format!( "{}/api/v2/downtime/{downtime_id}", local_configuration.get_operation_host(operation_id), - downtime_id = urlencode(downtime_id) + downtime_id = datadog::urlencode(downtime_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -257,7 +256,7 @@ impl DowntimesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -286,7 +285,7 @@ impl DowntimesAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -294,12 +293,12 @@ impl DowntimesAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -307,13 +306,14 @@ impl DowntimesAPI { pub async fn create_downtime( &self, body: crate::datadogV2::model::DowntimeCreateRequest, - ) -> Result> { + ) -> Result> + { match self.create_downtime_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -327,8 +327,8 @@ impl DowntimesAPI { &self, body: crate::datadogV2::model::DowntimeCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_downtime"; @@ -354,7 +354,7 @@ impl DowntimesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -377,7 +377,7 @@ impl DowntimesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -388,7 +388,7 @@ impl DowntimesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -398,7 +398,7 @@ impl DowntimesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -408,7 +408,7 @@ impl DowntimesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -431,23 +431,23 @@ impl DowntimesAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -456,13 +456,13 @@ impl DowntimesAPI { &self, downtime_id: String, params: GetDowntimeOptionalParams, - ) -> Result> { + ) -> Result> { match self.get_downtime_with_http_info(downtime_id, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -476,8 +476,10 @@ impl DowntimesAPI { &self, downtime_id: String, params: GetDowntimeOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.get_downtime"; @@ -489,7 +491,7 @@ impl DowntimesAPI { let local_uri_str = format!( "{}/api/v2/downtime/{downtime_id}", local_configuration.get_operation_host(operation_id), - downtime_id = urlencode(downtime_id) + downtime_id = datadog::urlencode(downtime_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -510,7 +512,7 @@ impl DowntimesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -542,22 +544,22 @@ impl DowntimesAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -565,13 +567,14 @@ impl DowntimesAPI { pub async fn list_downtimes( &self, params: ListDowntimesOptionalParams, - ) -> Result> { + ) -> Result> + { match self.list_downtimes_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -584,7 +587,10 @@ impl DowntimesAPI { &self, mut params: ListDowntimesOptionalParams, ) -> impl Stream< - Item = Result>, + Item = Result< + crate::datadogV2::model::DowntimeResponseData, + datadog::Error, + >, > + '_ { try_stream! { let mut page_size: i64 = 30; @@ -620,8 +626,8 @@ impl DowntimesAPI { &self, params: ListDowntimesOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_downtimes"; @@ -669,7 +675,7 @@ impl DowntimesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -702,23 +708,23 @@ impl DowntimesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -729,7 +735,7 @@ impl DowntimesAPI { params: ListMonitorDowntimesOptionalParams, ) -> Result< crate::datadogV2::model::MonitorDowntimeMatchResponse, - Error, + datadog::Error, > { match self .list_monitor_downtimes_with_http_info(monitor_id, params) @@ -739,7 +745,7 @@ impl DowntimesAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -755,7 +761,7 @@ impl DowntimesAPI { ) -> impl Stream< Item = Result< crate::datadogV2::model::MonitorDowntimeMatchResponseData, - Error, + datadog::Error, >, > + '_ { try_stream! { @@ -793,8 +799,8 @@ impl DowntimesAPI { monitor_id: i64, params: ListMonitorDowntimesOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_monitor_downtimes"; @@ -833,7 +839,7 @@ impl DowntimesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -866,23 +872,23 @@ impl DowntimesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -891,13 +897,14 @@ impl DowntimesAPI { &self, downtime_id: String, body: crate::datadogV2::model::DowntimeUpdateRequest, - ) -> Result> { + ) -> Result> + { match self.update_downtime_with_http_info(downtime_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -912,8 +919,8 @@ impl DowntimesAPI { downtime_id: String, body: crate::datadogV2::model::DowntimeUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_downtime"; @@ -923,7 +930,7 @@ impl DowntimesAPI { let local_uri_str = format!( "{}/api/v2/downtime/{downtime_id}", local_configuration.get_operation_host(operation_id), - downtime_id = urlencode(downtime_id) + downtime_id = datadog::urlencode(downtime_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -940,7 +947,7 @@ impl DowntimesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -963,7 +970,7 @@ impl DowntimesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -974,7 +981,7 @@ impl DowntimesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -984,7 +991,7 @@ impl DowntimesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -994,7 +1001,7 @@ impl DowntimesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1017,23 +1024,23 @@ impl DowntimesAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_events.rs b/src/datadogV2/api/api_events.rs index 4dcaa0072..e2481b65a 100644 --- a/src/datadogV2/api/api_events.rs +++ b/src/datadogV2/api/api_events.rs @@ -1,14 +1,13 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -100,13 +99,13 @@ pub enum SearchEventsError { #[derive(Debug, Clone)] pub struct EventsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for EventsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -114,7 +113,7 @@ impl EventsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -156,7 +155,7 @@ impl EventsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -169,13 +168,13 @@ impl EventsAPI { pub async fn list_events( &self, params: ListEventsOptionalParams, - ) -> Result> { + ) -> Result> { match self.list_events_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -187,8 +186,9 @@ impl EventsAPI { pub fn list_events_with_pagination( &self, mut params: ListEventsOptionalParams, - ) -> impl Stream>> + '_ - { + ) -> impl Stream< + Item = Result>, + > + '_ { try_stream! { let mut page_size: i32 = 10; if params.page_limit.is_none() { @@ -225,8 +225,10 @@ impl EventsAPI { pub async fn list_events_with_http_info( &self, params: ListEventsOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.list_events"; @@ -283,7 +285,7 @@ impl EventsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -316,22 +318,22 @@ impl EventsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -342,13 +344,14 @@ impl EventsAPI { pub async fn search_events( &self, params: SearchEventsOptionalParams, - ) -> Result> { + ) -> Result> + { match self.search_events_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -360,8 +363,9 @@ impl EventsAPI { pub fn search_events_with_pagination( &self, mut params: SearchEventsOptionalParams, - ) -> impl Stream>> + '_ - { + ) -> impl Stream< + Item = Result>, + > + '_ { try_stream! { let mut page_size: i32 = 10; if params.body.is_none() { @@ -405,8 +409,8 @@ impl EventsAPI { &self, params: SearchEventsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.search_events"; @@ -435,7 +439,7 @@ impl EventsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -458,7 +462,7 @@ impl EventsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -469,7 +473,7 @@ impl EventsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -479,7 +483,7 @@ impl EventsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -489,7 +493,7 @@ impl EventsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -513,22 +517,22 @@ impl EventsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_fastly_integration.rs b/src/datadogV2/api/api_fastly_integration.rs index 9c41c6c44..35a580d11 100644 --- a/src/datadogV2/api/api_fastly_integration.rs +++ b/src/datadogV2/api/api_fastly_integration.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -123,13 +122,13 @@ pub enum UpdateFastlyServiceError { #[derive(Debug, Clone)] pub struct FastlyIntegrationAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for FastlyIntegrationAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -137,7 +136,7 @@ impl FastlyIntegrationAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -179,7 +178,7 @@ impl FastlyIntegrationAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -189,14 +188,16 @@ impl FastlyIntegrationAPI { pub async fn create_fastly_account( &self, body: crate::datadogV2::model::FastlyAccountCreateRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::FastlyAccountResponse, + datadog::Error, + > { match self.create_fastly_account_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -210,8 +211,8 @@ impl FastlyIntegrationAPI { &self, body: crate::datadogV2::model::FastlyAccountCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_fastly_account"; @@ -237,7 +238,7 @@ impl FastlyIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -260,7 +261,7 @@ impl FastlyIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -271,7 +272,7 @@ impl FastlyIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -281,7 +282,7 @@ impl FastlyIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -291,7 +292,7 @@ impl FastlyIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -315,23 +316,23 @@ impl FastlyIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -340,8 +341,10 @@ impl FastlyIntegrationAPI { &self, account_id: String, body: crate::datadogV2::model::FastlyServiceRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::FastlyServiceResponse, + datadog::Error, + > { match self .create_fastly_service_with_http_info(account_id, body) .await @@ -350,7 +353,7 @@ impl FastlyIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -365,8 +368,8 @@ impl FastlyIntegrationAPI { account_id: String, body: crate::datadogV2::model::FastlyServiceRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_fastly_service"; @@ -376,7 +379,7 @@ impl FastlyIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}/services", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id) + account_id = datadog::urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -393,7 +396,7 @@ impl FastlyIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -416,7 +419,7 @@ impl FastlyIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -427,7 +430,7 @@ impl FastlyIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -437,7 +440,7 @@ impl FastlyIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -447,7 +450,7 @@ impl FastlyIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -471,23 +474,23 @@ impl FastlyIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -495,7 +498,7 @@ impl FastlyIntegrationAPI { pub async fn delete_fastly_account( &self, account_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.delete_fastly_account_with_http_info(account_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -506,7 +509,7 @@ impl FastlyIntegrationAPI { pub async fn delete_fastly_account_with_http_info( &self, account_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_fastly_account"; @@ -515,7 +518,7 @@ impl FastlyIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id) + account_id = datadog::urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -531,7 +534,7 @@ impl FastlyIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -560,7 +563,7 @@ impl FastlyIntegrationAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -568,12 +571,12 @@ impl FastlyIntegrationAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -582,7 +585,7 @@ impl FastlyIntegrationAPI { &self, account_id: String, service_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_fastly_service_with_http_info(account_id, service_id) .await @@ -597,7 +600,7 @@ impl FastlyIntegrationAPI { &self, account_id: String, service_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_fastly_service"; @@ -606,8 +609,8 @@ impl FastlyIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id), - service_id = urlencode(service_id) + account_id = datadog::urlencode(account_id), + service_id = datadog::urlencode(service_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -623,7 +626,7 @@ impl FastlyIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -652,7 +655,7 @@ impl FastlyIntegrationAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -660,12 +663,12 @@ impl FastlyIntegrationAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -673,13 +676,14 @@ impl FastlyIntegrationAPI { pub async fn get_fastly_account( &self, account_id: String, - ) -> Result> { + ) -> Result> + { match self.get_fastly_account_with_http_info(account_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -693,8 +697,8 @@ impl FastlyIntegrationAPI { &self, account_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_fastly_account"; @@ -704,7 +708,7 @@ impl FastlyIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id) + account_id = datadog::urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -720,7 +724,7 @@ impl FastlyIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -753,23 +757,23 @@ impl FastlyIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -778,7 +782,8 @@ impl FastlyIntegrationAPI { &self, account_id: String, service_id: String, - ) -> Result> { + ) -> Result> + { match self .get_fastly_service_with_http_info(account_id, service_id) .await @@ -787,7 +792,7 @@ impl FastlyIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -802,8 +807,8 @@ impl FastlyIntegrationAPI { account_id: String, service_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_fastly_service"; @@ -813,8 +818,8 @@ impl FastlyIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id), - service_id = urlencode(service_id) + account_id = datadog::urlencode(account_id), + service_id = datadog::urlencode(service_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -830,7 +835,7 @@ impl FastlyIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -863,37 +868,39 @@ impl FastlyIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// List Fastly accounts. pub async fn list_fastly_accounts( &self, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::FastlyAccountsResponse, + datadog::Error, + > { match self.list_fastly_accounts_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -906,8 +913,8 @@ impl FastlyIntegrationAPI { pub async fn list_fastly_accounts_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_fastly_accounts"; @@ -932,7 +939,7 @@ impl FastlyIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -965,23 +972,23 @@ impl FastlyIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -989,14 +996,16 @@ impl FastlyIntegrationAPI { pub async fn list_fastly_services( &self, account_id: String, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::FastlyServicesResponse, + datadog::Error, + > { match self.list_fastly_services_with_http_info(account_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1010,8 +1019,8 @@ impl FastlyIntegrationAPI { &self, account_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_fastly_services"; @@ -1021,7 +1030,7 @@ impl FastlyIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}/services", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id) + account_id = datadog::urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1037,7 +1046,7 @@ impl FastlyIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1070,23 +1079,23 @@ impl FastlyIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1095,8 +1104,10 @@ impl FastlyIntegrationAPI { &self, account_id: String, body: crate::datadogV2::model::FastlyAccountUpdateRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::FastlyAccountResponse, + datadog::Error, + > { match self .update_fastly_account_with_http_info(account_id, body) .await @@ -1105,7 +1116,7 @@ impl FastlyIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1120,8 +1131,8 @@ impl FastlyIntegrationAPI { account_id: String, body: crate::datadogV2::model::FastlyAccountUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_fastly_account"; @@ -1131,7 +1142,7 @@ impl FastlyIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id) + account_id = datadog::urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -1148,7 +1159,7 @@ impl FastlyIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1171,7 +1182,7 @@ impl FastlyIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1182,7 +1193,7 @@ impl FastlyIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1192,7 +1203,7 @@ impl FastlyIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1202,7 +1213,7 @@ impl FastlyIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1226,23 +1237,23 @@ impl FastlyIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1252,8 +1263,10 @@ impl FastlyIntegrationAPI { account_id: String, service_id: String, body: crate::datadogV2::model::FastlyServiceRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::FastlyServiceResponse, + datadog::Error, + > { match self .update_fastly_service_with_http_info(account_id, service_id, body) .await @@ -1262,7 +1275,7 @@ impl FastlyIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1278,8 +1291,8 @@ impl FastlyIntegrationAPI { service_id: String, body: crate::datadogV2::model::FastlyServiceRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_fastly_service"; @@ -1289,8 +1302,8 @@ impl FastlyIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id), - service_id = urlencode(service_id) + account_id = datadog::urlencode(account_id), + service_id = datadog::urlencode(service_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -1307,7 +1320,7 @@ impl FastlyIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1330,7 +1343,7 @@ impl FastlyIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1341,7 +1354,7 @@ impl FastlyIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1351,7 +1364,7 @@ impl FastlyIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1361,7 +1374,7 @@ impl FastlyIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1385,23 +1398,23 @@ impl FastlyIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_gcp_integration.rs b/src/datadogV2/api/api_gcp_integration.rs index 387a75472..30b07ee27 100644 --- a/src/datadogV2/api/api_gcp_integration.rs +++ b/src/datadogV2/api/api_gcp_integration.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -91,13 +90,13 @@ pub enum UpdateGCPSTSAccountError { #[derive(Debug, Clone)] pub struct GCPIntegrationAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for GCPIntegrationAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -105,7 +104,7 @@ impl GCPIntegrationAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -147,7 +146,7 @@ impl GCPIntegrationAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -159,14 +158,14 @@ impl GCPIntegrationAPI { body: crate::datadogV2::model::GCPSTSServiceAccountCreateRequest, ) -> Result< crate::datadogV2::model::GCPSTSServiceAccountResponse, - Error, + datadog::Error, > { match self.create_gcpsts_account_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -180,8 +179,8 @@ impl GCPIntegrationAPI { &self, body: crate::datadogV2::model::GCPSTSServiceAccountCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_gcpsts_account"; @@ -207,7 +206,7 @@ impl GCPIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -230,7 +229,7 @@ impl GCPIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -241,7 +240,7 @@ impl GCPIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -251,7 +250,7 @@ impl GCPIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -261,7 +260,7 @@ impl GCPIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -285,23 +284,23 @@ impl GCPIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -309,7 +308,7 @@ impl GCPIntegrationAPI { pub async fn delete_gcpsts_account( &self, account_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.delete_gcpsts_account_with_http_info(account_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -320,7 +319,7 @@ impl GCPIntegrationAPI { pub async fn delete_gcpsts_account_with_http_info( &self, account_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_gcpsts_account"; @@ -329,7 +328,7 @@ impl GCPIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integration/gcp/accounts/{account_id}", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id) + account_id = datadog::urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -345,7 +344,7 @@ impl GCPIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -374,7 +373,7 @@ impl GCPIntegrationAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -382,26 +381,28 @@ impl GCPIntegrationAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// List your Datadog-GCP STS delegate account configured in your Datadog account. pub async fn get_gcpsts_delegate( &self, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::GCPSTSDelegateAccountResponse, + datadog::Error, + > { match self.get_gcpsts_delegate_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -414,8 +415,8 @@ impl GCPIntegrationAPI { pub async fn get_gcpsts_delegate_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_gcpsts_delegate"; @@ -440,7 +441,7 @@ impl GCPIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -473,23 +474,23 @@ impl GCPIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -498,14 +499,14 @@ impl GCPIntegrationAPI { &self, ) -> Result< crate::datadogV2::model::GCPSTSServiceAccountsResponse, - Error, + datadog::Error, > { match self.list_gcpsts_accounts_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -518,8 +519,8 @@ impl GCPIntegrationAPI { pub async fn list_gcpsts_accounts_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_gcpsts_accounts"; @@ -544,7 +545,7 @@ impl GCPIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -577,23 +578,23 @@ impl GCPIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -603,14 +604,14 @@ impl GCPIntegrationAPI { params: MakeGCPSTSDelegateOptionalParams, ) -> Result< crate::datadogV2::model::GCPSTSDelegateAccountResponse, - Error, + datadog::Error, > { match self.make_gcpsts_delegate_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -624,8 +625,8 @@ impl GCPIntegrationAPI { &self, params: MakeGCPSTSDelegateOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.make_gcpsts_delegate"; @@ -654,7 +655,7 @@ impl GCPIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -677,7 +678,7 @@ impl GCPIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -688,7 +689,7 @@ impl GCPIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -698,7 +699,7 @@ impl GCPIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -708,7 +709,7 @@ impl GCPIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -732,23 +733,23 @@ impl GCPIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -759,7 +760,7 @@ impl GCPIntegrationAPI { body: crate::datadogV2::model::GCPSTSServiceAccountUpdateRequest, ) -> Result< crate::datadogV2::model::GCPSTSServiceAccountResponse, - Error, + datadog::Error, > { match self .update_gcpsts_account_with_http_info(account_id, body) @@ -769,7 +770,7 @@ impl GCPIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -784,8 +785,8 @@ impl GCPIntegrationAPI { account_id: String, body: crate::datadogV2::model::GCPSTSServiceAccountUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_gcpsts_account"; @@ -795,7 +796,7 @@ impl GCPIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integration/gcp/accounts/{account_id}", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id) + account_id = datadog::urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -812,7 +813,7 @@ impl GCPIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -835,7 +836,7 @@ impl GCPIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -846,7 +847,7 @@ impl GCPIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -856,7 +857,7 @@ impl GCPIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -866,7 +867,7 @@ impl GCPIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -890,23 +891,23 @@ impl GCPIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_incident_services.rs b/src/datadogV2/api/api_incident_services.rs index 3c5f42914..d9e2050eb 100644 --- a/src/datadogV2/api/api_incident_services.rs +++ b/src/datadogV2/api/api_incident_services.rs @@ -1,13 +1,12 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use log::warn; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -127,13 +126,13 @@ pub enum UpdateIncidentServiceError { #[derive(Debug, Clone)] pub struct IncidentServicesAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for IncidentServicesAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -141,7 +140,7 @@ impl IncidentServicesAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -183,7 +182,7 @@ impl IncidentServicesAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -193,14 +192,16 @@ impl IncidentServicesAPI { pub async fn create_incident_service( &self, body: crate::datadogV2::model::IncidentServiceCreateRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::IncidentServiceResponse, + datadog::Error, + > { match self.create_incident_service_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -214,18 +215,18 @@ impl IncidentServicesAPI { &self, body: crate::datadogV2::model::IncidentServiceCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_incident_service"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.create_incident_service' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -249,7 +250,7 @@ impl IncidentServicesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -272,7 +273,7 @@ impl IncidentServicesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -283,7 +284,7 @@ impl IncidentServicesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -293,7 +294,7 @@ impl IncidentServicesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -303,7 +304,7 @@ impl IncidentServicesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -327,23 +328,23 @@ impl IncidentServicesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -351,7 +352,7 @@ impl IncidentServicesAPI { pub async fn delete_incident_service( &self, service_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_incident_service_with_http_info(service_id) .await @@ -365,16 +366,16 @@ impl IncidentServicesAPI { pub async fn delete_incident_service_with_http_info( &self, service_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_incident_service"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.delete_incident_service' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -382,7 +383,7 @@ impl IncidentServicesAPI { let local_uri_str = format!( "{}/api/v2/services/{service_id}", local_configuration.get_operation_host(operation_id), - service_id = urlencode(service_id) + service_id = datadog::urlencode(service_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -398,7 +399,7 @@ impl IncidentServicesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -427,7 +428,7 @@ impl IncidentServicesAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -435,12 +436,12 @@ impl IncidentServicesAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -450,8 +451,10 @@ impl IncidentServicesAPI { &self, service_id: String, params: GetIncidentServiceOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::IncidentServiceResponse, + datadog::Error, + > { match self .get_incident_service_with_http_info(service_id, params) .await @@ -460,7 +463,7 @@ impl IncidentServicesAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -476,18 +479,18 @@ impl IncidentServicesAPI { service_id: String, params: GetIncidentServiceOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_incident_service"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.get_incident_service' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } // unbox and build optional parameters @@ -498,7 +501,7 @@ impl IncidentServicesAPI { let local_uri_str = format!( "{}/api/v2/services/{service_id}", local_configuration.get_operation_host(operation_id), - service_id = urlencode(service_id) + service_id = datadog::urlencode(service_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -519,7 +522,7 @@ impl IncidentServicesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -552,23 +555,23 @@ impl IncidentServicesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -576,14 +579,16 @@ impl IncidentServicesAPI { pub async fn list_incident_services( &self, params: ListIncidentServicesOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::IncidentServicesResponse, + datadog::Error, + > { match self.list_incident_services_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -597,18 +602,18 @@ impl IncidentServicesAPI { &self, params: ListIncidentServicesOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_incident_services"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.list_incident_services' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } // unbox and build optional parameters @@ -654,7 +659,7 @@ impl IncidentServicesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -687,23 +692,23 @@ impl IncidentServicesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -712,8 +717,10 @@ impl IncidentServicesAPI { &self, service_id: String, body: crate::datadogV2::model::IncidentServiceUpdateRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::IncidentServiceResponse, + datadog::Error, + > { match self .update_incident_service_with_http_info(service_id, body) .await @@ -722,7 +729,7 @@ impl IncidentServicesAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -737,18 +744,18 @@ impl IncidentServicesAPI { service_id: String, body: crate::datadogV2::model::IncidentServiceUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_incident_service"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.update_incident_service' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -756,7 +763,7 @@ impl IncidentServicesAPI { let local_uri_str = format!( "{}/api/v2/services/{service_id}", local_configuration.get_operation_host(operation_id), - service_id = urlencode(service_id) + service_id = datadog::urlencode(service_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -773,7 +780,7 @@ impl IncidentServicesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -796,7 +803,7 @@ impl IncidentServicesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -807,7 +814,7 @@ impl IncidentServicesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -817,7 +824,7 @@ impl IncidentServicesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -827,7 +834,7 @@ impl IncidentServicesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -851,23 +858,23 @@ impl IncidentServicesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_incident_teams.rs b/src/datadogV2/api/api_incident_teams.rs index 7c28f8f80..d96c87871 100644 --- a/src/datadogV2/api/api_incident_teams.rs +++ b/src/datadogV2/api/api_incident_teams.rs @@ -1,13 +1,12 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use log::warn; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -127,13 +126,13 @@ pub enum UpdateIncidentTeamError { #[derive(Debug, Clone)] pub struct IncidentTeamsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for IncidentTeamsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -141,7 +140,7 @@ impl IncidentTeamsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -183,7 +182,7 @@ impl IncidentTeamsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -193,13 +192,16 @@ impl IncidentTeamsAPI { pub async fn create_incident_team( &self, body: crate::datadogV2::model::IncidentTeamCreateRequest, - ) -> Result> { + ) -> Result< + crate::datadogV2::model::IncidentTeamResponse, + datadog::Error, + > { match self.create_incident_team_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -213,18 +215,18 @@ impl IncidentTeamsAPI { &self, body: crate::datadogV2::model::IncidentTeamCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_incident_team"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.create_incident_team' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -248,7 +250,7 @@ impl IncidentTeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -271,7 +273,7 @@ impl IncidentTeamsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -282,7 +284,7 @@ impl IncidentTeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -292,7 +294,7 @@ impl IncidentTeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -302,7 +304,7 @@ impl IncidentTeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -326,23 +328,23 @@ impl IncidentTeamsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -350,7 +352,7 @@ impl IncidentTeamsAPI { pub async fn delete_incident_team( &self, team_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.delete_incident_team_with_http_info(team_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -361,16 +363,16 @@ impl IncidentTeamsAPI { pub async fn delete_incident_team_with_http_info( &self, team_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_incident_team"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.delete_incident_team' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -378,7 +380,7 @@ impl IncidentTeamsAPI { let local_uri_str = format!( "{}/api/v2/teams/{team_id}", local_configuration.get_operation_host(operation_id), - team_id = urlencode(team_id) + team_id = datadog::urlencode(team_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -394,7 +396,7 @@ impl IncidentTeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -423,7 +425,7 @@ impl IncidentTeamsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -431,12 +433,12 @@ impl IncidentTeamsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -446,13 +448,14 @@ impl IncidentTeamsAPI { &self, team_id: String, params: GetIncidentTeamOptionalParams, - ) -> Result> { + ) -> Result> + { match self.get_incident_team_with_http_info(team_id, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -468,18 +471,18 @@ impl IncidentTeamsAPI { team_id: String, params: GetIncidentTeamOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_incident_team"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.get_incident_team' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } // unbox and build optional parameters @@ -490,7 +493,7 @@ impl IncidentTeamsAPI { let local_uri_str = format!( "{}/api/v2/teams/{team_id}", local_configuration.get_operation_host(operation_id), - team_id = urlencode(team_id) + team_id = datadog::urlencode(team_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -511,7 +514,7 @@ impl IncidentTeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -544,23 +547,23 @@ impl IncidentTeamsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -568,13 +571,16 @@ impl IncidentTeamsAPI { pub async fn list_incident_teams( &self, params: ListIncidentTeamsOptionalParams, - ) -> Result> { + ) -> Result< + crate::datadogV2::model::IncidentTeamsResponse, + datadog::Error, + > { match self.list_incident_teams_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -588,18 +594,18 @@ impl IncidentTeamsAPI { &self, params: ListIncidentTeamsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_incident_teams"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.list_incident_teams' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } // unbox and build optional parameters @@ -645,7 +651,7 @@ impl IncidentTeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -678,23 +684,23 @@ impl IncidentTeamsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -703,7 +709,10 @@ impl IncidentTeamsAPI { &self, team_id: String, body: crate::datadogV2::model::IncidentTeamUpdateRequest, - ) -> Result> { + ) -> Result< + crate::datadogV2::model::IncidentTeamResponse, + datadog::Error, + > { match self .update_incident_team_with_http_info(team_id, body) .await @@ -712,7 +721,7 @@ impl IncidentTeamsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -727,18 +736,18 @@ impl IncidentTeamsAPI { team_id: String, body: crate::datadogV2::model::IncidentTeamUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_incident_team"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.update_incident_team' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -746,7 +755,7 @@ impl IncidentTeamsAPI { let local_uri_str = format!( "{}/api/v2/teams/{team_id}", local_configuration.get_operation_host(operation_id), - team_id = urlencode(team_id) + team_id = datadog::urlencode(team_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -763,7 +772,7 @@ impl IncidentTeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -786,7 +795,7 @@ impl IncidentTeamsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -797,7 +806,7 @@ impl IncidentTeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -807,7 +816,7 @@ impl IncidentTeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -817,7 +826,7 @@ impl IncidentTeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -841,23 +850,23 @@ impl IncidentTeamsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_incidents.rs b/src/datadogV2/api/api_incidents.rs index 2f7325498..d99ce5498 100644 --- a/src/datadogV2/api/api_incidents.rs +++ b/src/datadogV2/api/api_incidents.rs @@ -1,7 +1,7 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, @@ -9,7 +9,6 @@ use flate2::{ }; use futures_core::stream::Stream; use log::warn; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -380,13 +379,13 @@ pub enum UpdateIncidentTodoError { #[derive(Debug, Clone)] pub struct IncidentsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for IncidentsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -394,7 +393,7 @@ impl IncidentsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -436,7 +435,7 @@ impl IncidentsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -446,13 +445,14 @@ impl IncidentsAPI { pub async fn create_incident( &self, body: crate::datadogV2::model::IncidentCreateRequest, - ) -> Result> { + ) -> Result> + { match self.create_incident_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -466,18 +466,18 @@ impl IncidentsAPI { &self, body: crate::datadogV2::model::IncidentCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_incident"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.create_incident' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -501,7 +501,7 @@ impl IncidentsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -524,7 +524,7 @@ impl IncidentsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -535,7 +535,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -545,7 +545,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -555,7 +555,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -578,23 +578,23 @@ impl IncidentsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -605,7 +605,7 @@ impl IncidentsAPI { body: crate::datadogV2::model::IncidentIntegrationMetadataCreateRequest, ) -> Result< crate::datadogV2::model::IncidentIntegrationMetadataResponse, - Error, + datadog::Error, > { match self .create_incident_integration_with_http_info(incident_id, body) @@ -615,7 +615,7 @@ impl IncidentsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -630,18 +630,18 @@ impl IncidentsAPI { incident_id: String, body: crate::datadogV2::model::IncidentIntegrationMetadataCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_incident_integration"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.create_incident_integration' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -649,7 +649,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/integrations", local_configuration.get_operation_host(operation_id), - incident_id = urlencode(incident_id) + incident_id = datadog::urlencode(incident_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -666,7 +666,7 @@ impl IncidentsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -689,7 +689,7 @@ impl IncidentsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -700,7 +700,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -710,7 +710,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -720,7 +720,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -744,23 +744,23 @@ impl IncidentsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -769,7 +769,10 @@ impl IncidentsAPI { &self, incident_id: String, body: crate::datadogV2::model::IncidentTodoCreateRequest, - ) -> Result> { + ) -> Result< + crate::datadogV2::model::IncidentTodoResponse, + datadog::Error, + > { match self .create_incident_todo_with_http_info(incident_id, body) .await @@ -778,7 +781,7 @@ impl IncidentsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -793,18 +796,18 @@ impl IncidentsAPI { incident_id: String, body: crate::datadogV2::model::IncidentTodoCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_incident_todo"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.create_incident_todo' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -812,7 +815,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/todos", local_configuration.get_operation_host(operation_id), - incident_id = urlencode(incident_id) + incident_id = datadog::urlencode(incident_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -829,7 +832,7 @@ impl IncidentsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -852,7 +855,7 @@ impl IncidentsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -863,7 +866,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -873,7 +876,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -883,7 +886,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -907,23 +910,23 @@ impl IncidentsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -931,7 +934,7 @@ impl IncidentsAPI { pub async fn delete_incident( &self, incident_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.delete_incident_with_http_info(incident_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -942,16 +945,16 @@ impl IncidentsAPI { pub async fn delete_incident_with_http_info( &self, incident_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_incident"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.delete_incident' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -959,7 +962,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}", local_configuration.get_operation_host(operation_id), - incident_id = urlencode(incident_id) + incident_id = datadog::urlencode(incident_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -975,7 +978,7 @@ impl IncidentsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1004,7 +1007,7 @@ impl IncidentsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -1012,12 +1015,12 @@ impl IncidentsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1026,7 +1029,7 @@ impl IncidentsAPI { &self, incident_id: String, integration_metadata_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_incident_integration_with_http_info(incident_id, integration_metadata_id) .await @@ -1041,16 +1044,16 @@ impl IncidentsAPI { &self, incident_id: String, integration_metadata_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_incident_integration"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.delete_incident_integration' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -1058,9 +1061,9 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}", local_configuration.get_operation_host(operation_id), incident_id= - urlencode(incident_id) + datadog::urlencode(incident_id) , integration_metadata_id= - urlencode(integration_metadata_id) + datadog::urlencode(integration_metadata_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -1076,7 +1079,7 @@ impl IncidentsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1105,7 +1108,7 @@ impl IncidentsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -1113,12 +1116,12 @@ impl IncidentsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1127,7 +1130,7 @@ impl IncidentsAPI { &self, incident_id: String, todo_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_incident_todo_with_http_info(incident_id, todo_id) .await @@ -1142,16 +1145,16 @@ impl IncidentsAPI { &self, incident_id: String, todo_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_incident_todo"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.delete_incident_todo' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -1159,8 +1162,8 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}", local_configuration.get_operation_host(operation_id), - incident_id = urlencode(incident_id), - todo_id = urlencode(todo_id) + incident_id = datadog::urlencode(incident_id), + todo_id = datadog::urlencode(todo_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -1176,7 +1179,7 @@ impl IncidentsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1205,7 +1208,7 @@ impl IncidentsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -1213,12 +1216,12 @@ impl IncidentsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1227,13 +1230,13 @@ impl IncidentsAPI { &self, incident_id: String, params: GetIncidentOptionalParams, - ) -> Result> { + ) -> Result> { match self.get_incident_with_http_info(incident_id, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1247,17 +1250,19 @@ impl IncidentsAPI { &self, incident_id: String, params: GetIncidentOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.get_incident"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.get_incident' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } // unbox and build optional parameters @@ -1268,7 +1273,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}", local_configuration.get_operation_host(operation_id), - incident_id = urlencode(incident_id) + incident_id = datadog::urlencode(incident_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1296,7 +1301,7 @@ impl IncidentsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1328,22 +1333,22 @@ impl IncidentsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1354,7 +1359,7 @@ impl IncidentsAPI { integration_metadata_id: String, ) -> Result< crate::datadogV2::model::IncidentIntegrationMetadataResponse, - Error, + datadog::Error, > { match self .get_incident_integration_with_http_info(incident_id, integration_metadata_id) @@ -1364,7 +1369,7 @@ impl IncidentsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1379,18 +1384,18 @@ impl IncidentsAPI { incident_id: String, integration_metadata_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_incident_integration"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.get_incident_integration' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -1398,9 +1403,9 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}", local_configuration.get_operation_host(operation_id), incident_id= - urlencode(incident_id) + datadog::urlencode(incident_id) , integration_metadata_id= - urlencode(integration_metadata_id) + datadog::urlencode(integration_metadata_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1416,7 +1421,7 @@ impl IncidentsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1449,23 +1454,23 @@ impl IncidentsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1474,7 +1479,8 @@ impl IncidentsAPI { &self, incident_id: String, todo_id: String, - ) -> Result> { + ) -> Result> + { match self .get_incident_todo_with_http_info(incident_id, todo_id) .await @@ -1483,7 +1489,7 @@ impl IncidentsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1498,18 +1504,18 @@ impl IncidentsAPI { incident_id: String, todo_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_incident_todo"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.get_incident_todo' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -1517,8 +1523,8 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}", local_configuration.get_operation_host(operation_id), - incident_id = urlencode(incident_id), - todo_id = urlencode(todo_id) + incident_id = datadog::urlencode(incident_id), + todo_id = datadog::urlencode(todo_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1534,7 +1540,7 @@ impl IncidentsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1567,23 +1573,23 @@ impl IncidentsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1594,7 +1600,7 @@ impl IncidentsAPI { params: ListIncidentAttachmentsOptionalParams, ) -> Result< crate::datadogV2::model::IncidentAttachmentsResponse, - Error, + datadog::Error, > { match self .list_incident_attachments_with_http_info(incident_id, params) @@ -1604,7 +1610,7 @@ impl IncidentsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1619,18 +1625,18 @@ impl IncidentsAPI { incident_id: String, params: ListIncidentAttachmentsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_incident_attachments"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.list_incident_attachments' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } // unbox and build optional parameters @@ -1642,7 +1648,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/attachments", local_configuration.get_operation_host(operation_id), - incident_id = urlencode(incident_id) + incident_id = datadog::urlencode(incident_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1681,7 +1687,7 @@ impl IncidentsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1714,23 +1720,23 @@ impl IncidentsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1740,7 +1746,7 @@ impl IncidentsAPI { incident_id: String, ) -> Result< crate::datadogV2::model::IncidentIntegrationMetadataListResponse, - Error, + datadog::Error, > { match self .list_incident_integrations_with_http_info(incident_id) @@ -1750,7 +1756,7 @@ impl IncidentsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1764,18 +1770,18 @@ impl IncidentsAPI { &self, incident_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_incident_integrations"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.list_incident_integrations' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -1783,7 +1789,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/integrations", local_configuration.get_operation_host(operation_id), - incident_id = urlencode(incident_id) + incident_id = datadog::urlencode(incident_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1799,7 +1805,7 @@ impl IncidentsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1833,23 +1839,23 @@ impl IncidentsAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1857,14 +1863,16 @@ impl IncidentsAPI { pub async fn list_incident_todos( &self, incident_id: String, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::IncidentTodoListResponse, + datadog::Error, + > { match self.list_incident_todos_with_http_info(incident_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1878,18 +1886,18 @@ impl IncidentsAPI { &self, incident_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_incident_todos"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.list_incident_todos' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -1897,7 +1905,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/todos", local_configuration.get_operation_host(operation_id), - incident_id = urlencode(incident_id) + incident_id = datadog::urlencode(incident_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1913,7 +1921,7 @@ impl IncidentsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1946,23 +1954,23 @@ impl IncidentsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1970,13 +1978,14 @@ impl IncidentsAPI { pub async fn list_incidents( &self, params: ListIncidentsOptionalParams, - ) -> Result> { + ) -> Result> + { match self.list_incidents_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1989,7 +1998,10 @@ impl IncidentsAPI { &self, mut params: ListIncidentsOptionalParams, ) -> impl Stream< - Item = Result>, + Item = Result< + crate::datadogV2::model::IncidentResponseData, + datadog::Error, + >, > + '_ { try_stream! { let mut page_size: i64 = 10; @@ -2024,18 +2036,18 @@ impl IncidentsAPI { &self, params: ListIncidentsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_incidents"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.list_incidents' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } // unbox and build optional parameters @@ -2083,7 +2095,7 @@ impl IncidentsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2115,23 +2127,23 @@ impl IncidentsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2140,13 +2152,14 @@ impl IncidentsAPI { &self, query: String, params: SearchIncidentsOptionalParams, - ) -> Result> { + ) -> Result> + { match self.search_incidents_with_http_info(query, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2162,7 +2175,7 @@ impl IncidentsAPI { ) -> impl Stream< Item = Result< crate::datadogV2::model::IncidentSearchResponseIncidentsData, - Error, + datadog::Error, >, > + '_ { try_stream! { @@ -2200,18 +2213,18 @@ impl IncidentsAPI { query: String, params: SearchIncidentsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.search_incidents"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.search_incidents' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } // unbox and build optional parameters @@ -2258,7 +2271,7 @@ impl IncidentsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2291,23 +2304,23 @@ impl IncidentsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2317,7 +2330,8 @@ impl IncidentsAPI { incident_id: String, body: crate::datadogV2::model::IncidentUpdateRequest, params: UpdateIncidentOptionalParams, - ) -> Result> { + ) -> Result> + { match self .update_incident_with_http_info(incident_id, body, params) .await @@ -2326,7 +2340,7 @@ impl IncidentsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2342,18 +2356,18 @@ impl IncidentsAPI { body: crate::datadogV2::model::IncidentUpdateRequest, params: UpdateIncidentOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_incident"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.update_incident' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } // unbox and build optional parameters @@ -2364,7 +2378,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}", local_configuration.get_operation_host(operation_id), - incident_id = urlencode(incident_id) + incident_id = datadog::urlencode(incident_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -2393,7 +2407,7 @@ impl IncidentsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2416,7 +2430,7 @@ impl IncidentsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -2427,7 +2441,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -2437,7 +2451,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -2447,7 +2461,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -2470,23 +2484,23 @@ impl IncidentsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2498,7 +2512,7 @@ impl IncidentsAPI { params: UpdateIncidentAttachmentsOptionalParams, ) -> Result< crate::datadogV2::model::IncidentAttachmentUpdateResponse, - Error, + datadog::Error, > { match self .update_incident_attachments_with_http_info(incident_id, body, params) @@ -2508,7 +2522,7 @@ impl IncidentsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2524,18 +2538,18 @@ impl IncidentsAPI { body: crate::datadogV2::model::IncidentAttachmentUpdateRequest, params: UpdateIncidentAttachmentsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_incident_attachments"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.update_incident_attachments' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } // unbox and build optional parameters @@ -2546,7 +2560,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/attachments", local_configuration.get_operation_host(operation_id), - incident_id = urlencode(incident_id) + incident_id = datadog::urlencode(incident_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -2575,7 +2589,7 @@ impl IncidentsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2598,7 +2612,7 @@ impl IncidentsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -2609,7 +2623,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -2619,7 +2633,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -2629,7 +2643,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -2653,23 +2667,23 @@ impl IncidentsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2681,7 +2695,7 @@ impl IncidentsAPI { body: crate::datadogV2::model::IncidentIntegrationMetadataPatchRequest, ) -> Result< crate::datadogV2::model::IncidentIntegrationMetadataResponse, - Error, + datadog::Error, > { match self .update_incident_integration_with_http_info(incident_id, integration_metadata_id, body) @@ -2691,7 +2705,7 @@ impl IncidentsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2707,18 +2721,18 @@ impl IncidentsAPI { integration_metadata_id: String, body: crate::datadogV2::model::IncidentIntegrationMetadataPatchRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_incident_integration"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.update_incident_integration' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -2726,9 +2740,9 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}", local_configuration.get_operation_host(operation_id), incident_id= - urlencode(incident_id) + datadog::urlencode(incident_id) , integration_metadata_id= - urlencode(integration_metadata_id) + datadog::urlencode(integration_metadata_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -2745,7 +2759,7 @@ impl IncidentsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2768,7 +2782,7 @@ impl IncidentsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -2779,7 +2793,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -2789,7 +2803,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -2799,7 +2813,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -2823,23 +2837,23 @@ impl IncidentsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2849,7 +2863,10 @@ impl IncidentsAPI { incident_id: String, todo_id: String, body: crate::datadogV2::model::IncidentTodoPatchRequest, - ) -> Result> { + ) -> Result< + crate::datadogV2::model::IncidentTodoResponse, + datadog::Error, + > { match self .update_incident_todo_with_http_info(incident_id, todo_id, body) .await @@ -2858,7 +2875,7 @@ impl IncidentsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2874,18 +2891,18 @@ impl IncidentsAPI { todo_id: String, body: crate::datadogV2::model::IncidentTodoPatchRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_incident_todo"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.update_incident_todo' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -2893,8 +2910,8 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}", local_configuration.get_operation_host(operation_id), - incident_id = urlencode(incident_id), - todo_id = urlencode(todo_id) + incident_id = datadog::urlencode(incident_id), + todo_id = datadog::urlencode(todo_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -2911,7 +2928,7 @@ impl IncidentsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2934,7 +2951,7 @@ impl IncidentsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -2945,7 +2962,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -2955,7 +2972,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -2965,7 +2982,7 @@ impl IncidentsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -2989,23 +3006,23 @@ impl IncidentsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_ip_allowlist.rs b/src/datadogV2/api/api_ip_allowlist.rs index 2f2ca1c3d..c8ba4c0bb 100644 --- a/src/datadogV2/api/api_ip_allowlist.rs +++ b/src/datadogV2/api/api_ip_allowlist.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -34,13 +33,13 @@ pub enum UpdateIPAllowlistError { #[derive(Debug, Clone)] pub struct IPAllowlistAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for IPAllowlistAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -48,7 +47,7 @@ impl IPAllowlistAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -90,7 +89,7 @@ impl IPAllowlistAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -99,13 +98,14 @@ impl IPAllowlistAPI { /// Returns the IP allowlist and its enabled or disabled state. pub async fn get_ip_allowlist( &self, - ) -> Result> { + ) -> Result> + { match self.get_ip_allowlist_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -118,8 +118,8 @@ impl IPAllowlistAPI { pub async fn get_ip_allowlist_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_ip_allowlist"; @@ -144,7 +144,7 @@ impl IPAllowlistAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -177,23 +177,23 @@ impl IPAllowlistAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -201,13 +201,14 @@ impl IPAllowlistAPI { pub async fn update_ip_allowlist( &self, body: crate::datadogV2::model::IPAllowlistUpdateRequest, - ) -> Result> { + ) -> Result> + { match self.update_ip_allowlist_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -221,8 +222,8 @@ impl IPAllowlistAPI { &self, body: crate::datadogV2::model::IPAllowlistUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_ip_allowlist"; @@ -248,7 +249,7 @@ impl IPAllowlistAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -271,7 +272,7 @@ impl IPAllowlistAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -282,7 +283,7 @@ impl IPAllowlistAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -292,7 +293,7 @@ impl IPAllowlistAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -302,7 +303,7 @@ impl IPAllowlistAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -326,23 +327,23 @@ impl IPAllowlistAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_key_management.rs b/src/datadogV2/api/api_key_management.rs index 3af0d810f..01545f426 100644 --- a/src/datadogV2/api/api_key_management.rs +++ b/src/datadogV2/api/api_key_management.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -405,13 +404,13 @@ pub enum UpdateCurrentUserApplicationKeyError { #[derive(Debug, Clone)] pub struct KeyManagementAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for KeyManagementAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -419,7 +418,7 @@ impl KeyManagementAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -461,7 +460,7 @@ impl KeyManagementAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -471,13 +470,13 @@ impl KeyManagementAPI { pub async fn create_api_key( &self, body: crate::datadogV2::model::APIKeyCreateRequest, - ) -> Result> { + ) -> Result> { match self.create_api_key_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -490,8 +489,10 @@ impl KeyManagementAPI { pub async fn create_api_key_with_http_info( &self, body: crate::datadogV2::model::APIKeyCreateRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.create_api_key"; @@ -516,7 +517,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -539,7 +540,7 @@ impl KeyManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -550,7 +551,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -560,7 +561,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -570,7 +571,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -592,22 +593,22 @@ impl KeyManagementAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -617,7 +618,7 @@ impl KeyManagementAPI { body: crate::datadogV2::model::ApplicationKeyCreateRequest, ) -> Result< crate::datadogV2::model::ApplicationKeyResponse, - Error, + datadog::Error, > { match self .create_current_user_application_key_with_http_info(body) @@ -627,7 +628,7 @@ impl KeyManagementAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -641,8 +642,8 @@ impl KeyManagementAPI { &self, body: crate::datadogV2::model::ApplicationKeyCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_current_user_application_key"; @@ -668,7 +669,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -691,7 +692,7 @@ impl KeyManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -702,7 +703,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -712,7 +713,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -722,7 +723,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -746,28 +747,31 @@ impl KeyManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// Delete an API key. - pub async fn delete_api_key(&self, api_key_id: String) -> Result<(), Error> { + pub async fn delete_api_key( + &self, + api_key_id: String, + ) -> Result<(), datadog::Error> { match self.delete_api_key_with_http_info(api_key_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -778,7 +782,7 @@ impl KeyManagementAPI { pub async fn delete_api_key_with_http_info( &self, api_key_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_api_key"; @@ -787,7 +791,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/api_keys/{api_key_id}", local_configuration.get_operation_host(operation_id), - api_key_id = urlencode(api_key_id) + api_key_id = datadog::urlencode(api_key_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -803,7 +807,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -832,19 +836,19 @@ impl KeyManagementAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, }) } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -852,7 +856,7 @@ impl KeyManagementAPI { pub async fn delete_application_key( &self, app_key_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.delete_application_key_with_http_info(app_key_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -863,7 +867,7 @@ impl KeyManagementAPI { pub async fn delete_application_key_with_http_info( &self, app_key_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_application_key"; @@ -872,7 +876,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/application_keys/{app_key_id}", local_configuration.get_operation_host(operation_id), - app_key_id = urlencode(app_key_id) + app_key_id = datadog::urlencode(app_key_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -888,7 +892,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -917,7 +921,7 @@ impl KeyManagementAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -925,12 +929,12 @@ impl KeyManagementAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -938,7 +942,7 @@ impl KeyManagementAPI { pub async fn delete_current_user_application_key( &self, app_key_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_current_user_application_key_with_http_info(app_key_id) .await @@ -952,7 +956,8 @@ impl KeyManagementAPI { pub async fn delete_current_user_application_key_with_http_info( &self, app_key_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> + { let local_configuration = &self.config; let operation_id = "v2.delete_current_user_application_key"; @@ -961,7 +966,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/current_user/application_keys/{app_key_id}", local_configuration.get_operation_host(operation_id), - app_key_id = urlencode(app_key_id) + app_key_id = datadog::urlencode(app_key_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -977,7 +982,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1006,7 +1011,7 @@ impl KeyManagementAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -1014,12 +1019,12 @@ impl KeyManagementAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1028,13 +1033,13 @@ impl KeyManagementAPI { &self, api_key_id: String, params: GetAPIKeyOptionalParams, - ) -> Result> { + ) -> Result> { match self.get_api_key_with_http_info(api_key_id, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1048,8 +1053,10 @@ impl KeyManagementAPI { &self, api_key_id: String, params: GetAPIKeyOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.get_api_key"; @@ -1061,7 +1068,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/api_keys/{api_key_id}", local_configuration.get_operation_host(operation_id), - api_key_id = urlencode(api_key_id) + api_key_id = datadog::urlencode(api_key_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1082,7 +1089,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1113,22 +1120,22 @@ impl KeyManagementAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1137,8 +1144,10 @@ impl KeyManagementAPI { &self, app_key_id: String, params: GetApplicationKeyOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::ApplicationKeyResponse, + datadog::Error, + > { match self .get_application_key_with_http_info(app_key_id, params) .await @@ -1147,7 +1156,7 @@ impl KeyManagementAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1162,8 +1171,8 @@ impl KeyManagementAPI { app_key_id: String, params: GetApplicationKeyOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_application_key"; @@ -1176,7 +1185,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/application_keys/{app_key_id}", local_configuration.get_operation_host(operation_id), - app_key_id = urlencode(app_key_id) + app_key_id = datadog::urlencode(app_key_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1197,7 +1206,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1230,23 +1239,23 @@ impl KeyManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1256,7 +1265,7 @@ impl KeyManagementAPI { app_key_id: String, ) -> Result< crate::datadogV2::model::ApplicationKeyResponse, - Error, + datadog::Error, > { match self .get_current_user_application_key_with_http_info(app_key_id) @@ -1266,7 +1275,7 @@ impl KeyManagementAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1280,8 +1289,8 @@ impl KeyManagementAPI { &self, app_key_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_current_user_application_key"; @@ -1291,7 +1300,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/current_user/application_keys/{app_key_id}", local_configuration.get_operation_host(operation_id), - app_key_id = urlencode(app_key_id) + app_key_id = datadog::urlencode(app_key_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1307,7 +1316,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1340,23 +1349,23 @@ impl KeyManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1364,13 +1373,13 @@ impl KeyManagementAPI { pub async fn list_api_keys( &self, params: ListAPIKeysOptionalParams, - ) -> Result> { + ) -> Result> { match self.list_api_keys_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1383,8 +1392,10 @@ impl KeyManagementAPI { pub async fn list_api_keys_with_http_info( &self, params: ListAPIKeysOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.list_api_keys"; @@ -1468,7 +1479,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1499,22 +1510,22 @@ impl KeyManagementAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1522,14 +1533,16 @@ impl KeyManagementAPI { pub async fn list_application_keys( &self, params: ListApplicationKeysOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::ListApplicationKeysResponse, + datadog::Error, + > { match self.list_application_keys_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1543,8 +1556,8 @@ impl KeyManagementAPI { &self, params: ListApplicationKeysOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_application_keys"; @@ -1607,7 +1620,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1640,23 +1653,23 @@ impl KeyManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1666,7 +1679,7 @@ impl KeyManagementAPI { params: ListCurrentUserApplicationKeysOptionalParams, ) -> Result< crate::datadogV2::model::ListApplicationKeysResponse, - Error, + datadog::Error, > { match self .list_current_user_application_keys_with_http_info(params) @@ -1676,7 +1689,7 @@ impl KeyManagementAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1690,8 +1703,8 @@ impl KeyManagementAPI { &self, params: ListCurrentUserApplicationKeysOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_current_user_application_keys"; @@ -1754,7 +1767,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1787,23 +1800,23 @@ impl KeyManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1812,13 +1825,13 @@ impl KeyManagementAPI { &self, api_key_id: String, body: crate::datadogV2::model::APIKeyUpdateRequest, - ) -> Result> { + ) -> Result> { match self.update_api_key_with_http_info(api_key_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1832,8 +1845,10 @@ impl KeyManagementAPI { &self, api_key_id: String, body: crate::datadogV2::model::APIKeyUpdateRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.update_api_key"; @@ -1842,7 +1857,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/api_keys/{api_key_id}", local_configuration.get_operation_host(operation_id), - api_key_id = urlencode(api_key_id) + api_key_id = datadog::urlencode(api_key_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -1859,7 +1874,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1882,7 +1897,7 @@ impl KeyManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1893,7 +1908,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1903,7 +1918,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1913,7 +1928,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1935,22 +1950,22 @@ impl KeyManagementAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1959,8 +1974,10 @@ impl KeyManagementAPI { &self, app_key_id: String, body: crate::datadogV2::model::ApplicationKeyUpdateRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::ApplicationKeyResponse, + datadog::Error, + > { match self .update_application_key_with_http_info(app_key_id, body) .await @@ -1969,7 +1986,7 @@ impl KeyManagementAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1984,8 +2001,8 @@ impl KeyManagementAPI { app_key_id: String, body: crate::datadogV2::model::ApplicationKeyUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_application_key"; @@ -1995,7 +2012,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/application_keys/{app_key_id}", local_configuration.get_operation_host(operation_id), - app_key_id = urlencode(app_key_id) + app_key_id = datadog::urlencode(app_key_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -2012,7 +2029,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2035,7 +2052,7 @@ impl KeyManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -2046,7 +2063,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -2056,7 +2073,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -2066,7 +2083,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -2090,23 +2107,23 @@ impl KeyManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2117,7 +2134,7 @@ impl KeyManagementAPI { body: crate::datadogV2::model::ApplicationKeyUpdateRequest, ) -> Result< crate::datadogV2::model::ApplicationKeyResponse, - Error, + datadog::Error, > { match self .update_current_user_application_key_with_http_info(app_key_id, body) @@ -2127,7 +2144,7 @@ impl KeyManagementAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2142,8 +2159,8 @@ impl KeyManagementAPI { app_key_id: String, body: crate::datadogV2::model::ApplicationKeyUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_current_user_application_key"; @@ -2153,7 +2170,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/current_user/application_keys/{app_key_id}", local_configuration.get_operation_host(operation_id), - app_key_id = urlencode(app_key_id) + app_key_id = datadog::urlencode(app_key_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -2170,7 +2187,7 @@ impl KeyManagementAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2193,7 +2210,7 @@ impl KeyManagementAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -2204,7 +2221,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -2214,7 +2231,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -2224,7 +2241,7 @@ impl KeyManagementAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -2248,23 +2265,23 @@ impl KeyManagementAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_logs.rs b/src/datadogV2/api/api_logs.rs index dd9179da4..0bb198719 100644 --- a/src/datadogV2/api/api_logs.rs +++ b/src/datadogV2/api/api_logs.rs @@ -1,14 +1,13 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -164,13 +163,13 @@ pub enum SubmitLogError { #[derive(Debug, Clone)] pub struct LogsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for LogsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -178,7 +177,7 @@ impl LogsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -220,7 +219,7 @@ impl LogsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -230,13 +229,14 @@ impl LogsAPI { pub async fn aggregate_logs( &self, body: crate::datadogV2::model::LogsAggregateRequest, - ) -> Result> { + ) -> Result> + { match self.aggregate_logs_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -250,8 +250,8 @@ impl LogsAPI { &self, body: crate::datadogV2::model::LogsAggregateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.aggregate_logs"; @@ -277,7 +277,7 @@ impl LogsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -300,7 +300,7 @@ impl LogsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -311,7 +311,7 @@ impl LogsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -321,7 +321,7 @@ impl LogsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -331,7 +331,7 @@ impl LogsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -355,23 +355,23 @@ impl LogsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -389,13 +389,13 @@ impl LogsAPI { pub async fn list_logs( &self, params: ListLogsOptionalParams, - ) -> Result> { + ) -> Result> { match self.list_logs_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -407,7 +407,8 @@ impl LogsAPI { pub fn list_logs_with_pagination( &self, mut params: ListLogsOptionalParams, - ) -> impl Stream>> + '_ { + ) -> impl Stream>> + '_ + { try_stream! { let mut page_size: i32 = 10; if params.body.is_none() { @@ -457,8 +458,10 @@ impl LogsAPI { pub async fn list_logs_with_http_info( &self, params: ListLogsOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.list_logs"; @@ -486,7 +489,7 @@ impl LogsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -509,7 +512,7 @@ impl LogsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -520,7 +523,7 @@ impl LogsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -530,7 +533,7 @@ impl LogsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -540,7 +543,7 @@ impl LogsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -563,22 +566,22 @@ impl LogsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -596,13 +599,13 @@ impl LogsAPI { pub async fn list_logs_get( &self, params: ListLogsGetOptionalParams, - ) -> Result> { + ) -> Result> { match self.list_logs_get_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -614,7 +617,7 @@ impl LogsAPI { pub fn list_logs_get_with_pagination( &self, mut params: ListLogsGetOptionalParams, - ) -> impl Stream>> + '_ + ) -> impl Stream>> + '_ { try_stream! { let mut page_size: i32 = 10; @@ -659,8 +662,10 @@ impl LogsAPI { pub async fn list_logs_get_with_http_info( &self, params: ListLogsGetOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.list_logs_get"; @@ -734,7 +739,7 @@ impl LogsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -766,22 +771,22 @@ impl LogsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -813,13 +818,14 @@ impl LogsAPI { &self, body: Vec, params: SubmitLogOptionalParams, - ) -> Result, Error> { + ) -> Result, datadog::Error> + { match self.submit_log_with_http_info(body, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -857,8 +863,8 @@ impl LogsAPI { body: Vec, params: SubmitLogOptionalParams, ) -> Result< - ResponseContent>, - Error, + datadog::ResponseContent>, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.submit_log"; @@ -903,7 +909,7 @@ impl LogsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -919,7 +925,7 @@ impl LogsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -930,7 +936,7 @@ impl LogsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -940,7 +946,7 @@ impl LogsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -950,7 +956,7 @@ impl LogsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -974,22 +980,22 @@ impl LogsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_logs_archives.rs b/src/datadogV2/api/api_logs_archives.rs index 72a88a94c..b102e99cb 100644 --- a/src/datadogV2/api/api_logs_archives.rs +++ b/src/datadogV2/api/api_logs_archives.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -118,13 +117,13 @@ pub enum UpdateLogsArchiveOrderError { #[derive(Debug, Clone)] pub struct LogsArchivesAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for LogsArchivesAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -132,7 +131,7 @@ impl LogsArchivesAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -174,7 +173,7 @@ impl LogsArchivesAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -185,7 +184,7 @@ impl LogsArchivesAPI { &self, archive_id: String, body: crate::datadogV2::model::RelationshipToRole, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .add_read_role_to_archive_with_http_info(archive_id, body) .await @@ -200,7 +199,7 @@ impl LogsArchivesAPI { &self, archive_id: String, body: crate::datadogV2::model::RelationshipToRole, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.add_read_role_to_archive"; @@ -209,7 +208,7 @@ impl LogsArchivesAPI { let local_uri_str = format!( "{}/api/v2/logs/config/archives/{archive_id}/readers", local_configuration.get_operation_host(operation_id), - archive_id = urlencode(archive_id) + archive_id = datadog::urlencode(archive_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -226,7 +225,7 @@ impl LogsArchivesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -249,7 +248,7 @@ impl LogsArchivesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -260,7 +259,7 @@ impl LogsArchivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -270,7 +269,7 @@ impl LogsArchivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -280,7 +279,7 @@ impl LogsArchivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -300,7 +299,7 @@ impl LogsArchivesAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -308,12 +307,12 @@ impl LogsArchivesAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -321,13 +320,13 @@ impl LogsArchivesAPI { pub async fn create_logs_archive( &self, body: crate::datadogV2::model::LogsArchiveCreateRequest, - ) -> Result> { + ) -> Result> { match self.create_logs_archive_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -340,8 +339,10 @@ impl LogsArchivesAPI { pub async fn create_logs_archive_with_http_info( &self, body: crate::datadogV2::model::LogsArchiveCreateRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.create_logs_archive"; @@ -366,7 +367,7 @@ impl LogsArchivesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -389,7 +390,7 @@ impl LogsArchivesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -400,7 +401,7 @@ impl LogsArchivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -410,7 +411,7 @@ impl LogsArchivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -420,7 +421,7 @@ impl LogsArchivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -442,23 +443,23 @@ impl LogsArchivesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -466,7 +467,7 @@ impl LogsArchivesAPI { pub async fn delete_logs_archive( &self, archive_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.delete_logs_archive_with_http_info(archive_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -477,7 +478,7 @@ impl LogsArchivesAPI { pub async fn delete_logs_archive_with_http_info( &self, archive_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_logs_archive"; @@ -486,7 +487,7 @@ impl LogsArchivesAPI { let local_uri_str = format!( "{}/api/v2/logs/config/archives/{archive_id}", local_configuration.get_operation_host(operation_id), - archive_id = urlencode(archive_id) + archive_id = datadog::urlencode(archive_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -502,7 +503,7 @@ impl LogsArchivesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -531,7 +532,7 @@ impl LogsArchivesAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -539,12 +540,12 @@ impl LogsArchivesAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -552,13 +553,13 @@ impl LogsArchivesAPI { pub async fn get_logs_archive( &self, archive_id: String, - ) -> Result> { + ) -> Result> { match self.get_logs_archive_with_http_info(archive_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -571,8 +572,10 @@ impl LogsArchivesAPI { pub async fn get_logs_archive_with_http_info( &self, archive_id: String, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.get_logs_archive"; @@ -581,7 +584,7 @@ impl LogsArchivesAPI { let local_uri_str = format!( "{}/api/v2/logs/config/archives/{archive_id}", local_configuration.get_operation_host(operation_id), - archive_id = urlencode(archive_id) + archive_id = datadog::urlencode(archive_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -597,7 +600,7 @@ impl LogsArchivesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -628,23 +631,23 @@ impl LogsArchivesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -652,13 +655,14 @@ impl LogsArchivesAPI { /// This endpoint takes no JSON arguments. pub async fn get_logs_archive_order( &self, - ) -> Result> { + ) -> Result> + { match self.get_logs_archive_order_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -672,8 +676,8 @@ impl LogsArchivesAPI { pub async fn get_logs_archive_order_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_logs_archive_order"; @@ -698,7 +702,7 @@ impl LogsArchivesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -730,23 +734,23 @@ impl LogsArchivesAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -754,7 +758,8 @@ impl LogsArchivesAPI { pub async fn list_archive_read_roles( &self, archive_id: String, - ) -> Result> { + ) -> Result> + { match self .list_archive_read_roles_with_http_info(archive_id) .await @@ -763,7 +768,7 @@ impl LogsArchivesAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -777,8 +782,8 @@ impl LogsArchivesAPI { &self, archive_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_archive_read_roles"; @@ -788,7 +793,7 @@ impl LogsArchivesAPI { let local_uri_str = format!( "{}/api/v2/logs/config/archives/{archive_id}/readers", local_configuration.get_operation_host(operation_id), - archive_id = urlencode(archive_id) + archive_id = datadog::urlencode(archive_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -804,7 +809,7 @@ impl LogsArchivesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -835,36 +840,36 @@ impl LogsArchivesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// Get the list of configured logs archives with their definitions. pub async fn list_logs_archives( &self, - ) -> Result> { + ) -> Result> { match self.list_logs_archives_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -876,8 +881,10 @@ impl LogsArchivesAPI { /// Get the list of configured logs archives with their definitions. pub async fn list_logs_archives_with_http_info( &self, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.list_logs_archives"; @@ -901,7 +908,7 @@ impl LogsArchivesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -932,23 +939,23 @@ impl LogsArchivesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -957,7 +964,7 @@ impl LogsArchivesAPI { &self, archive_id: String, body: crate::datadogV2::model::RelationshipToRole, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .remove_role_from_archive_with_http_info(archive_id, body) .await @@ -972,7 +979,7 @@ impl LogsArchivesAPI { &self, archive_id: String, body: crate::datadogV2::model::RelationshipToRole, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.remove_role_from_archive"; @@ -981,7 +988,7 @@ impl LogsArchivesAPI { let local_uri_str = format!( "{}/api/v2/logs/config/archives/{archive_id}/readers", local_configuration.get_operation_host(operation_id), - archive_id = urlencode(archive_id) + archive_id = datadog::urlencode(archive_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -998,7 +1005,7 @@ impl LogsArchivesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1021,7 +1028,7 @@ impl LogsArchivesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1032,7 +1039,7 @@ impl LogsArchivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1042,7 +1049,7 @@ impl LogsArchivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1052,7 +1059,7 @@ impl LogsArchivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1072,7 +1079,7 @@ impl LogsArchivesAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -1080,12 +1087,12 @@ impl LogsArchivesAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1097,7 +1104,7 @@ impl LogsArchivesAPI { &self, archive_id: String, body: crate::datadogV2::model::LogsArchiveCreateRequest, - ) -> Result> { + ) -> Result> { match self .update_logs_archive_with_http_info(archive_id, body) .await @@ -1106,7 +1113,7 @@ impl LogsArchivesAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1123,8 +1130,10 @@ impl LogsArchivesAPI { &self, archive_id: String, body: crate::datadogV2::model::LogsArchiveCreateRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.update_logs_archive"; @@ -1133,7 +1142,7 @@ impl LogsArchivesAPI { let local_uri_str = format!( "{}/api/v2/logs/config/archives/{archive_id}", local_configuration.get_operation_host(operation_id), - archive_id = urlencode(archive_id) + archive_id = datadog::urlencode(archive_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -1150,7 +1159,7 @@ impl LogsArchivesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1173,7 +1182,7 @@ impl LogsArchivesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1184,7 +1193,7 @@ impl LogsArchivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1194,7 +1203,7 @@ impl LogsArchivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1204,7 +1213,7 @@ impl LogsArchivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1226,23 +1235,23 @@ impl LogsArchivesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1254,13 +1263,16 @@ impl LogsArchivesAPI { pub async fn update_logs_archive_order( &self, body: crate::datadogV2::model::LogsArchiveOrder, - ) -> Result> { + ) -> Result< + crate::datadogV2::model::LogsArchiveOrder, + datadog::Error, + > { match self.update_logs_archive_order_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1278,8 +1290,8 @@ impl LogsArchivesAPI { &self, body: crate::datadogV2::model::LogsArchiveOrder, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_logs_archive_order"; @@ -1305,7 +1317,7 @@ impl LogsArchivesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1328,7 +1340,7 @@ impl LogsArchivesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1339,7 +1351,7 @@ impl LogsArchivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1349,7 +1361,7 @@ impl LogsArchivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1359,7 +1371,7 @@ impl LogsArchivesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1382,23 +1394,23 @@ impl LogsArchivesAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_logs_custom_destinations.rs b/src/datadogV2/api/api_logs_custom_destinations.rs index ab89f4a59..6e2880e40 100644 --- a/src/datadogV2/api/api_logs_custom_destinations.rs +++ b/src/datadogV2/api/api_logs_custom_destinations.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -67,13 +66,13 @@ pub enum UpdateLogsCustomDestinationError { #[derive(Debug, Clone)] pub struct LogsCustomDestinationsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for LogsCustomDestinationsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -81,7 +80,7 @@ impl LogsCustomDestinationsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -123,7 +122,7 @@ impl LogsCustomDestinationsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -135,7 +134,7 @@ impl LogsCustomDestinationsAPI { body: crate::datadogV2::model::CustomDestinationCreateRequest, ) -> Result< crate::datadogV2::model::CustomDestinationResponse, - Error, + datadog::Error, > { match self .create_logs_custom_destination_with_http_info(body) @@ -145,7 +144,7 @@ impl LogsCustomDestinationsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -159,8 +158,8 @@ impl LogsCustomDestinationsAPI { &self, body: crate::datadogV2::model::CustomDestinationCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_logs_custom_destination"; @@ -186,7 +185,7 @@ impl LogsCustomDestinationsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -209,7 +208,7 @@ impl LogsCustomDestinationsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -220,7 +219,7 @@ impl LogsCustomDestinationsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -230,7 +229,7 @@ impl LogsCustomDestinationsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -240,7 +239,7 @@ impl LogsCustomDestinationsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -264,23 +263,23 @@ impl LogsCustomDestinationsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -288,7 +287,7 @@ impl LogsCustomDestinationsAPI { pub async fn delete_logs_custom_destination( &self, custom_destination_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_logs_custom_destination_with_http_info(custom_destination_id) .await @@ -302,7 +301,8 @@ impl LogsCustomDestinationsAPI { pub async fn delete_logs_custom_destination_with_http_info( &self, custom_destination_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> + { let local_configuration = &self.config; let operation_id = "v2.delete_logs_custom_destination"; @@ -311,7 +311,7 @@ impl LogsCustomDestinationsAPI { let local_uri_str = format!( "{}/api/v2/logs/config/custom-destinations/{custom_destination_id}", local_configuration.get_operation_host(operation_id), - custom_destination_id = urlencode(custom_destination_id) + custom_destination_id = datadog::urlencode(custom_destination_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -327,7 +327,7 @@ impl LogsCustomDestinationsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -356,7 +356,7 @@ impl LogsCustomDestinationsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -364,12 +364,12 @@ impl LogsCustomDestinationsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -379,7 +379,7 @@ impl LogsCustomDestinationsAPI { custom_destination_id: String, ) -> Result< crate::datadogV2::model::CustomDestinationResponse, - Error, + datadog::Error, > { match self .get_logs_custom_destination_with_http_info(custom_destination_id) @@ -389,7 +389,7 @@ impl LogsCustomDestinationsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -403,8 +403,8 @@ impl LogsCustomDestinationsAPI { &self, custom_destination_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_logs_custom_destination"; @@ -414,7 +414,7 @@ impl LogsCustomDestinationsAPI { let local_uri_str = format!( "{}/api/v2/logs/config/custom-destinations/{custom_destination_id}", local_configuration.get_operation_host(operation_id), - custom_destination_id = urlencode(custom_destination_id) + custom_destination_id = datadog::urlencode(custom_destination_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -430,7 +430,7 @@ impl LogsCustomDestinationsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -463,23 +463,23 @@ impl LogsCustomDestinationsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -488,14 +488,14 @@ impl LogsCustomDestinationsAPI { &self, ) -> Result< crate::datadogV2::model::CustomDestinationsResponse, - Error, + datadog::Error, > { match self.list_logs_custom_destinations_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -508,8 +508,8 @@ impl LogsCustomDestinationsAPI { pub async fn list_logs_custom_destinations_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_logs_custom_destinations"; @@ -534,7 +534,7 @@ impl LogsCustomDestinationsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -567,23 +567,23 @@ impl LogsCustomDestinationsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -594,7 +594,7 @@ impl LogsCustomDestinationsAPI { body: crate::datadogV2::model::CustomDestinationUpdateRequest, ) -> Result< crate::datadogV2::model::CustomDestinationResponse, - Error, + datadog::Error, > { match self .update_logs_custom_destination_with_http_info(custom_destination_id, body) @@ -604,7 +604,7 @@ impl LogsCustomDestinationsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -619,8 +619,8 @@ impl LogsCustomDestinationsAPI { custom_destination_id: String, body: crate::datadogV2::model::CustomDestinationUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_logs_custom_destination"; @@ -630,7 +630,7 @@ impl LogsCustomDestinationsAPI { let local_uri_str = format!( "{}/api/v2/logs/config/custom-destinations/{custom_destination_id}", local_configuration.get_operation_host(operation_id), - custom_destination_id = urlencode(custom_destination_id) + custom_destination_id = datadog::urlencode(custom_destination_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -647,7 +647,7 @@ impl LogsCustomDestinationsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -670,7 +670,7 @@ impl LogsCustomDestinationsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -681,7 +681,7 @@ impl LogsCustomDestinationsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -691,7 +691,7 @@ impl LogsCustomDestinationsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -701,7 +701,7 @@ impl LogsCustomDestinationsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -725,23 +725,23 @@ impl LogsCustomDestinationsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_logs_metrics.rs b/src/datadogV2/api/api_logs_metrics.rs index aee2dd7ff..3cc12aeb7 100644 --- a/src/datadogV2/api/api_logs_metrics.rs +++ b/src/datadogV2/api/api_logs_metrics.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -64,13 +63,13 @@ pub enum UpdateLogsMetricError { #[derive(Debug, Clone)] pub struct LogsMetricsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for LogsMetricsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -78,7 +77,7 @@ impl LogsMetricsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -120,7 +119,7 @@ impl LogsMetricsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -131,13 +130,14 @@ impl LogsMetricsAPI { pub async fn create_logs_metric( &self, body: crate::datadogV2::model::LogsMetricCreateRequest, - ) -> Result> { + ) -> Result> + { match self.create_logs_metric_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -152,8 +152,8 @@ impl LogsMetricsAPI { &self, body: crate::datadogV2::model::LogsMetricCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_logs_metric"; @@ -179,7 +179,7 @@ impl LogsMetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -202,7 +202,7 @@ impl LogsMetricsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -213,7 +213,7 @@ impl LogsMetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -223,7 +223,7 @@ impl LogsMetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -233,7 +233,7 @@ impl LogsMetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -257,23 +257,23 @@ impl LogsMetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -281,7 +281,7 @@ impl LogsMetricsAPI { pub async fn delete_logs_metric( &self, metric_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.delete_logs_metric_with_http_info(metric_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -292,7 +292,7 @@ impl LogsMetricsAPI { pub async fn delete_logs_metric_with_http_info( &self, metric_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_logs_metric"; @@ -301,7 +301,7 @@ impl LogsMetricsAPI { let local_uri_str = format!( "{}/api/v2/logs/config/metrics/{metric_id}", local_configuration.get_operation_host(operation_id), - metric_id = urlencode(metric_id) + metric_id = datadog::urlencode(metric_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -317,7 +317,7 @@ impl LogsMetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -346,7 +346,7 @@ impl LogsMetricsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -354,12 +354,12 @@ impl LogsMetricsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -367,13 +367,14 @@ impl LogsMetricsAPI { pub async fn get_logs_metric( &self, metric_id: String, - ) -> Result> { + ) -> Result> + { match self.get_logs_metric_with_http_info(metric_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -387,8 +388,8 @@ impl LogsMetricsAPI { &self, metric_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_logs_metric"; @@ -398,7 +399,7 @@ impl LogsMetricsAPI { let local_uri_str = format!( "{}/api/v2/logs/config/metrics/{metric_id}", local_configuration.get_operation_host(operation_id), - metric_id = urlencode(metric_id) + metric_id = datadog::urlencode(metric_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -414,7 +415,7 @@ impl LogsMetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -447,36 +448,37 @@ impl LogsMetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// Get the list of configured log-based metrics with their definitions. pub async fn list_logs_metrics( &self, - ) -> Result> { + ) -> Result> + { match self.list_logs_metrics_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -489,8 +491,8 @@ impl LogsMetricsAPI { pub async fn list_logs_metrics_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_logs_metrics"; @@ -515,7 +517,7 @@ impl LogsMetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -548,23 +550,23 @@ impl LogsMetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -574,7 +576,8 @@ impl LogsMetricsAPI { &self, metric_id: String, body: crate::datadogV2::model::LogsMetricUpdateRequest, - ) -> Result> { + ) -> Result> + { match self .update_logs_metric_with_http_info(metric_id, body) .await @@ -583,7 +586,7 @@ impl LogsMetricsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -599,8 +602,8 @@ impl LogsMetricsAPI { metric_id: String, body: crate::datadogV2::model::LogsMetricUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_logs_metric"; @@ -610,7 +613,7 @@ impl LogsMetricsAPI { let local_uri_str = format!( "{}/api/v2/logs/config/metrics/{metric_id}", local_configuration.get_operation_host(operation_id), - metric_id = urlencode(metric_id) + metric_id = datadog::urlencode(metric_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -627,7 +630,7 @@ impl LogsMetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -650,7 +653,7 @@ impl LogsMetricsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -661,7 +664,7 @@ impl LogsMetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -671,7 +674,7 @@ impl LogsMetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -681,7 +684,7 @@ impl LogsMetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -705,23 +708,23 @@ impl LogsMetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_metrics.rs b/src/datadogV2/api/api_metrics.rs index 7db2c01f8..7d3cf4509 100644 --- a/src/datadogV2/api/api_metrics.rs +++ b/src/datadogV2/api/api_metrics.rs @@ -1,13 +1,12 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use log::warn; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -327,13 +326,13 @@ pub enum UpdateTagConfigurationError { #[derive(Debug, Clone)] pub struct MetricsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for MetricsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -341,7 +340,7 @@ impl MetricsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -383,7 +382,7 @@ impl MetricsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -401,7 +400,7 @@ impl MetricsAPI { body: crate::datadogV2::model::MetricBulkTagConfigCreateRequest, ) -> Result< crate::datadogV2::model::MetricBulkTagConfigResponse, - Error, + datadog::Error, > { match self .create_bulk_tags_metrics_configuration_with_http_info(body) @@ -411,7 +410,7 @@ impl MetricsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -431,8 +430,8 @@ impl MetricsAPI { &self, body: crate::datadogV2::model::MetricBulkTagConfigCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_bulk_tags_metrics_configuration"; @@ -458,7 +457,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -481,7 +480,7 @@ impl MetricsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -492,7 +491,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -502,7 +501,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -512,7 +511,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -536,23 +535,23 @@ impl MetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -567,7 +566,7 @@ impl MetricsAPI { body: crate::datadogV2::model::MetricTagConfigurationCreateRequest, ) -> Result< crate::datadogV2::model::MetricTagConfigurationResponse, - Error, + datadog::Error, > { match self .create_tag_configuration_with_http_info(metric_name, body) @@ -577,7 +576,7 @@ impl MetricsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -596,8 +595,8 @@ impl MetricsAPI { metric_name: String, body: crate::datadogV2::model::MetricTagConfigurationCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_tag_configuration"; @@ -607,7 +606,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/tags", local_configuration.get_operation_host(operation_id), - metric_name = urlencode(metric_name) + metric_name = datadog::urlencode(metric_name) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -624,7 +623,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -647,7 +646,7 @@ impl MetricsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -658,7 +657,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -668,7 +667,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -678,7 +677,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -702,23 +701,23 @@ impl MetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -731,7 +730,7 @@ impl MetricsAPI { body: crate::datadogV2::model::MetricBulkTagConfigDeleteRequest, ) -> Result< crate::datadogV2::model::MetricBulkTagConfigResponse, - Error, + datadog::Error, > { match self .delete_bulk_tags_metrics_configuration_with_http_info(body) @@ -741,7 +740,7 @@ impl MetricsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -758,8 +757,8 @@ impl MetricsAPI { &self, body: crate::datadogV2::model::MetricBulkTagConfigDeleteRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.delete_bulk_tags_metrics_configuration"; @@ -785,7 +784,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -808,7 +807,7 @@ impl MetricsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -819,7 +818,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -829,7 +828,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -839,7 +838,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -863,23 +862,23 @@ impl MetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -888,7 +887,7 @@ impl MetricsAPI { pub async fn delete_tag_configuration( &self, metric_name: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_tag_configuration_with_http_info(metric_name) .await @@ -903,7 +902,7 @@ impl MetricsAPI { pub async fn delete_tag_configuration_with_http_info( &self, metric_name: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_tag_configuration"; @@ -912,7 +911,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/tags", local_configuration.get_operation_host(operation_id), - metric_name = urlencode(metric_name) + metric_name = datadog::urlencode(metric_name) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -928,7 +927,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -957,7 +956,7 @@ impl MetricsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -965,12 +964,12 @@ impl MetricsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -981,7 +980,7 @@ impl MetricsAPI { params: EstimateMetricsOutputSeriesOptionalParams, ) -> Result< crate::datadogV2::model::MetricEstimateResponse, - Error, + datadog::Error, > { match self .estimate_metrics_output_series_with_http_info(metric_name, params) @@ -991,7 +990,7 @@ impl MetricsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1006,8 +1005,8 @@ impl MetricsAPI { metric_name: String, params: EstimateMetricsOutputSeriesOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.estimate_metrics_output_series"; @@ -1024,7 +1023,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/estimate", local_configuration.get_operation_host(operation_id), - metric_name = urlencode(metric_name) + metric_name = datadog::urlencode(metric_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1061,7 +1060,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1094,23 +1093,23 @@ impl MetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1121,7 +1120,7 @@ impl MetricsAPI { params: ListActiveMetricConfigurationsOptionalParams, ) -> Result< crate::datadogV2::model::MetricSuggestedTagsAndAggregationsResponse, - Error, + datadog::Error, > { match self .list_active_metric_configurations_with_http_info(metric_name, params) @@ -1131,7 +1130,7 @@ impl MetricsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1146,8 +1145,10 @@ impl MetricsAPI { metric_name: String, params: ListActiveMetricConfigurationsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent< + crate::datadogV2::model::MetricSuggestedTagsAndAggregationsResponse, + >, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_active_metric_configurations"; @@ -1160,7 +1161,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/active-configurations", local_configuration.get_operation_host(operation_id), - metric_name = urlencode(metric_name) + metric_name = datadog::urlencode(metric_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1181,7 +1182,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1215,23 +1216,23 @@ impl MetricsAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1239,13 +1240,14 @@ impl MetricsAPI { pub async fn list_metric_assets( &self, metric_name: String, - ) -> Result> { + ) -> Result> + { match self.list_metric_assets_with_http_info(metric_name).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1259,8 +1261,8 @@ impl MetricsAPI { &self, metric_name: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_metric_assets"; @@ -1270,7 +1272,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/assets", local_configuration.get_operation_host(operation_id), - metric_name = urlencode(metric_name) + metric_name = datadog::urlencode(metric_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1286,7 +1288,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1319,23 +1321,23 @@ impl MetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1345,7 +1347,7 @@ impl MetricsAPI { metric_name: String, ) -> Result< crate::datadogV2::model::MetricTagConfigurationResponse, - Error, + datadog::Error, > { match self .list_tag_configuration_by_name_with_http_info(metric_name) @@ -1355,7 +1357,7 @@ impl MetricsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1369,8 +1371,8 @@ impl MetricsAPI { &self, metric_name: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_tag_configuration_by_name"; @@ -1380,7 +1382,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/tags", local_configuration.get_operation_host(operation_id), - metric_name = urlencode(metric_name) + metric_name = datadog::urlencode(metric_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1396,7 +1398,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1429,23 +1431,23 @@ impl MetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1455,14 +1457,14 @@ impl MetricsAPI { params: ListTagConfigurationsOptionalParams, ) -> Result< crate::datadogV2::model::MetricsAndMetricTagConfigurationsResponse, - Error, + datadog::Error, > { match self.list_tag_configurations_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1476,8 +1478,10 @@ impl MetricsAPI { &self, params: ListTagConfigurationsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent< + crate::datadogV2::model::MetricsAndMetricTagConfigurationsResponse, + >, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_tag_configurations"; @@ -1542,7 +1546,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1576,23 +1580,23 @@ impl MetricsAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1600,8 +1604,10 @@ impl MetricsAPI { pub async fn list_tags_by_metric_name( &self, metric_name: String, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::MetricAllTagsResponse, + datadog::Error, + > { match self .list_tags_by_metric_name_with_http_info(metric_name) .await @@ -1610,7 +1616,7 @@ impl MetricsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1624,8 +1630,8 @@ impl MetricsAPI { &self, metric_name: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_tags_by_metric_name"; @@ -1635,7 +1641,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/all-tags", local_configuration.get_operation_host(operation_id), - metric_name = urlencode(metric_name) + metric_name = datadog::urlencode(metric_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1651,7 +1657,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1684,23 +1690,23 @@ impl MetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1710,8 +1716,10 @@ impl MetricsAPI { pub async fn list_volumes_by_metric_name( &self, metric_name: String, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::MetricVolumesResponse, + datadog::Error, + > { match self .list_volumes_by_metric_name_with_http_info(metric_name) .await @@ -1720,7 +1728,7 @@ impl MetricsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1736,8 +1744,8 @@ impl MetricsAPI { &self, metric_name: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_volumes_by_metric_name"; @@ -1747,7 +1755,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/volumes", local_configuration.get_operation_host(operation_id), - metric_name = urlencode(metric_name) + metric_name = datadog::urlencode(metric_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1763,7 +1771,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1796,23 +1804,23 @@ impl MetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1822,14 +1830,16 @@ impl MetricsAPI { pub async fn query_scalar_data( &self, body: crate::datadogV2::model::ScalarFormulaQueryRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::ScalarFormulaQueryResponse, + datadog::Error, + > { match self.query_scalar_data_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1845,18 +1855,18 @@ impl MetricsAPI { &self, body: crate::datadogV2::model::ScalarFormulaQueryRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.query_scalar_data"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.query_scalar_data' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -1880,7 +1890,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1903,7 +1913,7 @@ impl MetricsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1914,7 +1924,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1924,7 +1934,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1934,7 +1944,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1958,23 +1968,23 @@ impl MetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1985,14 +1995,14 @@ impl MetricsAPI { body: crate::datadogV2::model::TimeseriesFormulaQueryRequest, ) -> Result< crate::datadogV2::model::TimeseriesFormulaQueryResponse, - Error, + datadog::Error, > { match self.query_timeseries_data_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2007,18 +2017,18 @@ impl MetricsAPI { &self, body: crate::datadogV2::model::TimeseriesFormulaQueryRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.query_timeseries_data"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.query_timeseries_data' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -2042,7 +2052,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2065,7 +2075,7 @@ impl MetricsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -2076,7 +2086,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -2086,7 +2096,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -2096,7 +2106,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -2120,23 +2130,23 @@ impl MetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2156,13 +2166,14 @@ impl MetricsAPI { &self, body: crate::datadogV2::model::MetricPayload, params: SubmitMetricsOptionalParams, - ) -> Result> { + ) -> Result> + { match self.submit_metrics_with_http_info(body, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2188,8 +2199,8 @@ impl MetricsAPI { body: crate::datadogV2::model::MetricPayload, params: SubmitMetricsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.submit_metrics"; @@ -2228,7 +2239,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2244,7 +2255,7 @@ impl MetricsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -2255,7 +2266,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -2265,7 +2276,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -2275,7 +2286,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -2299,23 +2310,23 @@ impl MetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2330,7 +2341,7 @@ impl MetricsAPI { body: crate::datadogV2::model::MetricTagConfigurationUpdateRequest, ) -> Result< crate::datadogV2::model::MetricTagConfigurationResponse, - Error, + datadog::Error, > { match self .update_tag_configuration_with_http_info(metric_name, body) @@ -2340,7 +2351,7 @@ impl MetricsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2359,8 +2370,8 @@ impl MetricsAPI { metric_name: String, body: crate::datadogV2::model::MetricTagConfigurationUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_tag_configuration"; @@ -2370,7 +2381,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/tags", local_configuration.get_operation_host(operation_id), - metric_name = urlencode(metric_name) + metric_name = datadog::urlencode(metric_name) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -2387,7 +2398,7 @@ impl MetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2410,7 +2421,7 @@ impl MetricsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -2421,7 +2432,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -2431,7 +2442,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -2441,7 +2452,7 @@ impl MetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -2465,23 +2476,23 @@ impl MetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_monitors.rs b/src/datadogV2/api/api_monitors.rs index dbc9b8ad8..84fde8f98 100644 --- a/src/datadogV2/api/api_monitors.rs +++ b/src/datadogV2/api/api_monitors.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -64,13 +63,13 @@ pub enum UpdateMonitorConfigPolicyError { #[derive(Debug, Clone)] pub struct MonitorsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for MonitorsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -78,7 +77,7 @@ impl MonitorsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -120,7 +119,7 @@ impl MonitorsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -132,14 +131,14 @@ impl MonitorsAPI { body: crate::datadogV2::model::MonitorConfigPolicyCreateRequest, ) -> Result< crate::datadogV2::model::MonitorConfigPolicyResponse, - Error, + datadog::Error, > { match self.create_monitor_config_policy_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -153,8 +152,8 @@ impl MonitorsAPI { &self, body: crate::datadogV2::model::MonitorConfigPolicyCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_monitor_config_policy"; @@ -180,7 +179,7 @@ impl MonitorsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -203,7 +202,7 @@ impl MonitorsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -214,7 +213,7 @@ impl MonitorsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -224,7 +223,7 @@ impl MonitorsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -234,7 +233,7 @@ impl MonitorsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -258,23 +257,23 @@ impl MonitorsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -282,7 +281,7 @@ impl MonitorsAPI { pub async fn delete_monitor_config_policy( &self, policy_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_monitor_config_policy_with_http_info(policy_id) .await @@ -296,7 +295,7 @@ impl MonitorsAPI { pub async fn delete_monitor_config_policy_with_http_info( &self, policy_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_monitor_config_policy"; @@ -305,7 +304,7 @@ impl MonitorsAPI { let local_uri_str = format!( "{}/api/v2/monitor/policy/{policy_id}", local_configuration.get_operation_host(operation_id), - policy_id = urlencode(policy_id) + policy_id = datadog::urlencode(policy_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -321,7 +320,7 @@ impl MonitorsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -350,7 +349,7 @@ impl MonitorsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -358,12 +357,12 @@ impl MonitorsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -373,7 +372,7 @@ impl MonitorsAPI { policy_id: String, ) -> Result< crate::datadogV2::model::MonitorConfigPolicyResponse, - Error, + datadog::Error, > { match self .get_monitor_config_policy_with_http_info(policy_id) @@ -383,7 +382,7 @@ impl MonitorsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -397,8 +396,8 @@ impl MonitorsAPI { &self, policy_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_monitor_config_policy"; @@ -408,7 +407,7 @@ impl MonitorsAPI { let local_uri_str = format!( "{}/api/v2/monitor/policy/{policy_id}", local_configuration.get_operation_host(operation_id), - policy_id = urlencode(policy_id) + policy_id = datadog::urlencode(policy_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -424,7 +423,7 @@ impl MonitorsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -457,23 +456,23 @@ impl MonitorsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -482,14 +481,14 @@ impl MonitorsAPI { &self, ) -> Result< crate::datadogV2::model::MonitorConfigPolicyListResponse, - Error, + datadog::Error, > { match self.list_monitor_config_policies_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -502,8 +501,8 @@ impl MonitorsAPI { pub async fn list_monitor_config_policies_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_monitor_config_policies"; @@ -528,7 +527,7 @@ impl MonitorsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -561,23 +560,23 @@ impl MonitorsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -588,7 +587,7 @@ impl MonitorsAPI { body: crate::datadogV2::model::MonitorConfigPolicyEditRequest, ) -> Result< crate::datadogV2::model::MonitorConfigPolicyResponse, - Error, + datadog::Error, > { match self .update_monitor_config_policy_with_http_info(policy_id, body) @@ -598,7 +597,7 @@ impl MonitorsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -613,8 +612,8 @@ impl MonitorsAPI { policy_id: String, body: crate::datadogV2::model::MonitorConfigPolicyEditRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_monitor_config_policy"; @@ -624,7 +623,7 @@ impl MonitorsAPI { let local_uri_str = format!( "{}/api/v2/monitor/policy/{policy_id}", local_configuration.get_operation_host(operation_id), - policy_id = urlencode(policy_id) + policy_id = datadog::urlencode(policy_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -641,7 +640,7 @@ impl MonitorsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -664,7 +663,7 @@ impl MonitorsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -675,7 +674,7 @@ impl MonitorsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -685,7 +684,7 @@ impl MonitorsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -695,7 +694,7 @@ impl MonitorsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -719,23 +718,23 @@ impl MonitorsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_okta_integration.rs b/src/datadogV2/api/api_okta_integration.rs index 486d1a1ad..5216f02ac 100644 --- a/src/datadogV2/api/api_okta_integration.rs +++ b/src/datadogV2/api/api_okta_integration.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -68,13 +67,13 @@ pub enum UpdateOktaAccountError { #[derive(Debug, Clone)] pub struct OktaIntegrationAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for OktaIntegrationAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -82,7 +81,7 @@ impl OktaIntegrationAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -124,7 +123,7 @@ impl OktaIntegrationAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -134,13 +133,14 @@ impl OktaIntegrationAPI { pub async fn create_okta_account( &self, body: crate::datadogV2::model::OktaAccountRequest, - ) -> Result> { + ) -> Result> + { match self.create_okta_account_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -154,8 +154,8 @@ impl OktaIntegrationAPI { &self, body: crate::datadogV2::model::OktaAccountRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_okta_account"; @@ -181,7 +181,7 @@ impl OktaIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -204,7 +204,7 @@ impl OktaIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -215,7 +215,7 @@ impl OktaIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -225,7 +225,7 @@ impl OktaIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -235,7 +235,7 @@ impl OktaIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -259,23 +259,23 @@ impl OktaIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -283,7 +283,7 @@ impl OktaIntegrationAPI { pub async fn delete_okta_account( &self, account_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.delete_okta_account_with_http_info(account_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -294,7 +294,7 @@ impl OktaIntegrationAPI { pub async fn delete_okta_account_with_http_info( &self, account_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_okta_account"; @@ -303,7 +303,7 @@ impl OktaIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/okta/accounts/{account_id}", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id) + account_id = datadog::urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -319,7 +319,7 @@ impl OktaIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -348,7 +348,7 @@ impl OktaIntegrationAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -356,12 +356,12 @@ impl OktaIntegrationAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -369,13 +369,14 @@ impl OktaIntegrationAPI { pub async fn get_okta_account( &self, account_id: String, - ) -> Result> { + ) -> Result> + { match self.get_okta_account_with_http_info(account_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -389,8 +390,8 @@ impl OktaIntegrationAPI { &self, account_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_okta_account"; @@ -400,7 +401,7 @@ impl OktaIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/okta/accounts/{account_id}", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id) + account_id = datadog::urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -416,7 +417,7 @@ impl OktaIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -449,36 +450,37 @@ impl OktaIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// List Okta accounts. pub async fn list_okta_accounts( &self, - ) -> Result> { + ) -> Result> + { match self.list_okta_accounts_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -491,8 +493,8 @@ impl OktaIntegrationAPI { pub async fn list_okta_accounts_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_okta_accounts"; @@ -517,7 +519,7 @@ impl OktaIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -550,23 +552,23 @@ impl OktaIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -575,7 +577,8 @@ impl OktaIntegrationAPI { &self, account_id: String, body: crate::datadogV2::model::OktaAccountUpdateRequest, - ) -> Result> { + ) -> Result> + { match self .update_okta_account_with_http_info(account_id, body) .await @@ -584,7 +587,7 @@ impl OktaIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -599,8 +602,8 @@ impl OktaIntegrationAPI { account_id: String, body: crate::datadogV2::model::OktaAccountUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_okta_account"; @@ -610,7 +613,7 @@ impl OktaIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/okta/accounts/{account_id}", local_configuration.get_operation_host(operation_id), - account_id = urlencode(account_id) + account_id = datadog::urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -627,7 +630,7 @@ impl OktaIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -650,7 +653,7 @@ impl OktaIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -661,7 +664,7 @@ impl OktaIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -671,7 +674,7 @@ impl OktaIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -681,7 +684,7 @@ impl OktaIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -705,23 +708,23 @@ impl OktaIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_opsgenie_integration.rs b/src/datadogV2/api/api_opsgenie_integration.rs index 6c83ed354..05f8cc5fe 100644 --- a/src/datadogV2/api/api_opsgenie_integration.rs +++ b/src/datadogV2/api/api_opsgenie_integration.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -68,13 +67,13 @@ pub enum UpdateOpsgenieServiceError { #[derive(Debug, Clone)] pub struct OpsgenieIntegrationAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for OpsgenieIntegrationAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -82,7 +81,7 @@ impl OpsgenieIntegrationAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -124,7 +123,7 @@ impl OpsgenieIntegrationAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -134,14 +133,16 @@ impl OpsgenieIntegrationAPI { pub async fn create_opsgenie_service( &self, body: crate::datadogV2::model::OpsgenieServiceCreateRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::OpsgenieServiceResponse, + datadog::Error, + > { match self.create_opsgenie_service_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -155,8 +156,8 @@ impl OpsgenieIntegrationAPI { &self, body: crate::datadogV2::model::OpsgenieServiceCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_opsgenie_service"; @@ -182,7 +183,7 @@ impl OpsgenieIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -205,7 +206,7 @@ impl OpsgenieIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -216,7 +217,7 @@ impl OpsgenieIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -226,7 +227,7 @@ impl OpsgenieIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -236,7 +237,7 @@ impl OpsgenieIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -260,23 +261,23 @@ impl OpsgenieIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -284,7 +285,7 @@ impl OpsgenieIntegrationAPI { pub async fn delete_opsgenie_service( &self, integration_service_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_opsgenie_service_with_http_info(integration_service_id) .await @@ -298,7 +299,7 @@ impl OpsgenieIntegrationAPI { pub async fn delete_opsgenie_service_with_http_info( &self, integration_service_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_opsgenie_service"; @@ -307,7 +308,7 @@ impl OpsgenieIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integration/opsgenie/services/{integration_service_id}", local_configuration.get_operation_host(operation_id), - integration_service_id = urlencode(integration_service_id) + integration_service_id = datadog::urlencode(integration_service_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -323,7 +324,7 @@ impl OpsgenieIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -352,7 +353,7 @@ impl OpsgenieIntegrationAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -360,12 +361,12 @@ impl OpsgenieIntegrationAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -373,8 +374,10 @@ impl OpsgenieIntegrationAPI { pub async fn get_opsgenie_service( &self, integration_service_id: String, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::OpsgenieServiceResponse, + datadog::Error, + > { match self .get_opsgenie_service_with_http_info(integration_service_id) .await @@ -383,7 +386,7 @@ impl OpsgenieIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -397,8 +400,8 @@ impl OpsgenieIntegrationAPI { &self, integration_service_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_opsgenie_service"; @@ -408,7 +411,7 @@ impl OpsgenieIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integration/opsgenie/services/{integration_service_id}", local_configuration.get_operation_host(operation_id), - integration_service_id = urlencode(integration_service_id) + integration_service_id = datadog::urlencode(integration_service_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -424,7 +427,7 @@ impl OpsgenieIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -457,37 +460,39 @@ impl OpsgenieIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// Get a list of all services from the Datadog Opsgenie integration. pub async fn list_opsgenie_services( &self, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::OpsgenieServicesResponse, + datadog::Error, + > { match self.list_opsgenie_services_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -500,8 +505,8 @@ impl OpsgenieIntegrationAPI { pub async fn list_opsgenie_services_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_opsgenie_services"; @@ -526,7 +531,7 @@ impl OpsgenieIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -559,23 +564,23 @@ impl OpsgenieIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -584,8 +589,10 @@ impl OpsgenieIntegrationAPI { &self, integration_service_id: String, body: crate::datadogV2::model::OpsgenieServiceUpdateRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::OpsgenieServiceResponse, + datadog::Error, + > { match self .update_opsgenie_service_with_http_info(integration_service_id, body) .await @@ -594,7 +601,7 @@ impl OpsgenieIntegrationAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -609,8 +616,8 @@ impl OpsgenieIntegrationAPI { integration_service_id: String, body: crate::datadogV2::model::OpsgenieServiceUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_opsgenie_service"; @@ -620,7 +627,7 @@ impl OpsgenieIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integration/opsgenie/services/{integration_service_id}", local_configuration.get_operation_host(operation_id), - integration_service_id = urlencode(integration_service_id) + integration_service_id = datadog::urlencode(integration_service_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -637,7 +644,7 @@ impl OpsgenieIntegrationAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -660,7 +667,7 @@ impl OpsgenieIntegrationAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -671,7 +678,7 @@ impl OpsgenieIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -681,7 +688,7 @@ impl OpsgenieIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -691,7 +698,7 @@ impl OpsgenieIntegrationAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -715,23 +722,23 @@ impl OpsgenieIntegrationAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_organizations.rs b/src/datadogV2/api/api_organizations.rs index b117b6f76..2a49870a0 100644 --- a/src/datadogV2/api/api_organizations.rs +++ b/src/datadogV2/api/api_organizations.rs @@ -1,8 +1,7 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; -use reqwest; +use crate::datadog; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; @@ -34,13 +33,13 @@ pub enum UploadIdPMetadataError { #[derive(Debug, Clone)] pub struct OrganizationsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for OrganizationsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -48,7 +47,7 @@ impl OrganizationsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -90,7 +89,7 @@ impl OrganizationsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -102,7 +101,7 @@ impl OrganizationsAPI { pub async fn upload_idp_metadata( &self, params: UploadIdPMetadataOptionalParams, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.upload_idp_metadata_with_http_info(params).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -115,7 +114,7 @@ impl OrganizationsAPI { pub async fn upload_idp_metadata_with_http_info( &self, params: UploadIdPMetadataOptionalParams, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.upload_idp_metadata"; @@ -146,7 +145,7 @@ impl OrganizationsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -198,7 +197,7 @@ impl OrganizationsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -206,12 +205,12 @@ impl OrganizationsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_powerpack.rs b/src/datadogV2/api/api_powerpack.rs index 787c40243..45adde9ad 100644 --- a/src/datadogV2/api/api_powerpack.rs +++ b/src/datadogV2/api/api_powerpack.rs @@ -1,14 +1,13 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -83,13 +82,13 @@ pub enum UpdatePowerpackError { #[derive(Debug, Clone)] pub struct PowerpackAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for PowerpackAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -97,7 +96,7 @@ impl PowerpackAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -139,7 +138,7 @@ impl PowerpackAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -149,13 +148,14 @@ impl PowerpackAPI { pub async fn create_powerpack( &self, body: crate::datadogV2::model::Powerpack, - ) -> Result> { + ) -> Result> + { match self.create_powerpack_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -169,8 +169,8 @@ impl PowerpackAPI { &self, body: crate::datadogV2::model::Powerpack, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_powerpack"; @@ -196,7 +196,7 @@ impl PowerpackAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -219,7 +219,7 @@ impl PowerpackAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -230,7 +230,7 @@ impl PowerpackAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -240,7 +240,7 @@ impl PowerpackAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -250,7 +250,7 @@ impl PowerpackAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -273,23 +273,23 @@ impl PowerpackAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -297,7 +297,7 @@ impl PowerpackAPI { pub async fn delete_powerpack( &self, powerpack_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.delete_powerpack_with_http_info(powerpack_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -308,7 +308,7 @@ impl PowerpackAPI { pub async fn delete_powerpack_with_http_info( &self, powerpack_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_powerpack"; @@ -317,7 +317,7 @@ impl PowerpackAPI { let local_uri_str = format!( "{}/api/v2/powerpacks/{powerpack_id}", local_configuration.get_operation_host(operation_id), - powerpack_id = urlencode(powerpack_id) + powerpack_id = datadog::urlencode(powerpack_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -333,7 +333,7 @@ impl PowerpackAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -362,7 +362,7 @@ impl PowerpackAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -370,12 +370,12 @@ impl PowerpackAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -383,13 +383,13 @@ impl PowerpackAPI { pub async fn get_powerpack( &self, powerpack_id: String, - ) -> Result> { + ) -> Result> { match self.get_powerpack_with_http_info(powerpack_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -402,8 +402,10 @@ impl PowerpackAPI { pub async fn get_powerpack_with_http_info( &self, powerpack_id: String, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.get_powerpack"; @@ -412,7 +414,7 @@ impl PowerpackAPI { let local_uri_str = format!( "{}/api/v2/powerpacks/{powerpack_id}", local_configuration.get_operation_host(operation_id), - powerpack_id = urlencode(powerpack_id) + powerpack_id = datadog::urlencode(powerpack_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -428,7 +430,7 @@ impl PowerpackAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -460,22 +462,22 @@ impl PowerpackAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -483,13 +485,14 @@ impl PowerpackAPI { pub async fn list_powerpacks( &self, params: ListPowerpacksOptionalParams, - ) -> Result> { + ) -> Result> + { match self.list_powerpacks_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -501,8 +504,9 @@ impl PowerpackAPI { pub fn list_powerpacks_with_pagination( &self, mut params: ListPowerpacksOptionalParams, - ) -> impl Stream>> - + '_ { + ) -> impl Stream< + Item = Result>, + > + '_ { try_stream! { let mut page_size: i64 = 25; if params.page_limit.is_none() { @@ -537,8 +541,8 @@ impl PowerpackAPI { &self, params: ListPowerpacksOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_powerpacks"; @@ -576,7 +580,7 @@ impl PowerpackAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -609,23 +613,23 @@ impl PowerpackAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -634,7 +638,8 @@ impl PowerpackAPI { &self, powerpack_id: String, body: crate::datadogV2::model::Powerpack, - ) -> Result> { + ) -> Result> + { match self .update_powerpack_with_http_info(powerpack_id, body) .await @@ -643,7 +648,7 @@ impl PowerpackAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -658,8 +663,8 @@ impl PowerpackAPI { powerpack_id: String, body: crate::datadogV2::model::Powerpack, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_powerpack"; @@ -669,7 +674,7 @@ impl PowerpackAPI { let local_uri_str = format!( "{}/api/v2/powerpacks/{powerpack_id}", local_configuration.get_operation_host(operation_id), - powerpack_id = urlencode(powerpack_id) + powerpack_id = datadog::urlencode(powerpack_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -686,7 +691,7 @@ impl PowerpackAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -709,7 +714,7 @@ impl PowerpackAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -720,7 +725,7 @@ impl PowerpackAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -730,7 +735,7 @@ impl PowerpackAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -740,7 +745,7 @@ impl PowerpackAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -763,23 +768,23 @@ impl PowerpackAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_processes.rs b/src/datadogV2/api/api_processes.rs index f22326f70..b63d744a8 100644 --- a/src/datadogV2/api/api_processes.rs +++ b/src/datadogV2/api/api_processes.rs @@ -1,10 +1,9 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; @@ -81,13 +80,13 @@ pub enum ListProcessesError { #[derive(Debug, Clone)] pub struct ProcessesAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for ProcessesAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -95,7 +94,7 @@ impl ProcessesAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -137,7 +136,7 @@ impl ProcessesAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -147,13 +146,14 @@ impl ProcessesAPI { pub async fn list_processes( &self, params: ListProcessesOptionalParams, - ) -> Result> { + ) -> Result> + { match self.list_processes_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -165,8 +165,9 @@ impl ProcessesAPI { pub fn list_processes_with_pagination( &self, mut params: ListProcessesOptionalParams, - ) -> impl Stream>> - + '_ { + ) -> impl Stream< + Item = Result>, + > + '_ { try_stream! { let mut page_size: i32 = 1000; if params.page_limit.is_none() { @@ -201,8 +202,8 @@ impl ProcessesAPI { &self, params: ListProcessesOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_processes"; @@ -259,7 +260,7 @@ impl ProcessesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -292,23 +293,23 @@ impl ProcessesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_restriction_policies.rs b/src/datadogV2/api/api_restriction_policies.rs index 340635907..12292f31d 100644 --- a/src/datadogV2/api/api_restriction_policies.rs +++ b/src/datadogV2/api/api_restriction_policies.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -43,13 +42,13 @@ pub enum UpdateRestrictionPolicyError { #[derive(Debug, Clone)] pub struct RestrictionPoliciesAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for RestrictionPoliciesAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -57,7 +56,7 @@ impl RestrictionPoliciesAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -99,7 +98,7 @@ impl RestrictionPoliciesAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -109,7 +108,7 @@ impl RestrictionPoliciesAPI { pub async fn delete_restriction_policy( &self, resource_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_restriction_policy_with_http_info(resource_id) .await @@ -123,7 +122,7 @@ impl RestrictionPoliciesAPI { pub async fn delete_restriction_policy_with_http_info( &self, resource_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_restriction_policy"; @@ -132,7 +131,7 @@ impl RestrictionPoliciesAPI { let local_uri_str = format!( "{}/api/v2/restriction_policy/{resource_id}", local_configuration.get_operation_host(operation_id), - resource_id = urlencode(resource_id) + resource_id = datadog::urlencode(resource_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -148,7 +147,7 @@ impl RestrictionPoliciesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -177,7 +176,7 @@ impl RestrictionPoliciesAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -185,12 +184,12 @@ impl RestrictionPoliciesAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -198,8 +197,10 @@ impl RestrictionPoliciesAPI { pub async fn get_restriction_policy( &self, resource_id: String, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::RestrictionPolicyResponse, + datadog::Error, + > { match self .get_restriction_policy_with_http_info(resource_id) .await @@ -208,7 +209,7 @@ impl RestrictionPoliciesAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -222,8 +223,8 @@ impl RestrictionPoliciesAPI { &self, resource_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_restriction_policy"; @@ -233,7 +234,7 @@ impl RestrictionPoliciesAPI { let local_uri_str = format!( "{}/api/v2/restriction_policy/{resource_id}", local_configuration.get_operation_host(operation_id), - resource_id = urlencode(resource_id) + resource_id = datadog::urlencode(resource_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -249,7 +250,7 @@ impl RestrictionPoliciesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -282,23 +283,23 @@ impl RestrictionPoliciesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -326,7 +327,7 @@ impl RestrictionPoliciesAPI { body: crate::datadogV2::model::RestrictionPolicyUpdateRequest, ) -> Result< crate::datadogV2::model::RestrictionPolicyResponse, - Error, + datadog::Error, > { match self .update_restriction_policy_with_http_info(resource_id, body) @@ -336,7 +337,7 @@ impl RestrictionPoliciesAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -368,8 +369,8 @@ impl RestrictionPoliciesAPI { resource_id: String, body: crate::datadogV2::model::RestrictionPolicyUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_restriction_policy"; @@ -379,7 +380,7 @@ impl RestrictionPoliciesAPI { let local_uri_str = format!( "{}/api/v2/restriction_policy/{resource_id}", local_configuration.get_operation_host(operation_id), - resource_id = urlencode(resource_id) + resource_id = datadog::urlencode(resource_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -396,7 +397,7 @@ impl RestrictionPoliciesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -419,7 +420,7 @@ impl RestrictionPoliciesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -430,7 +431,7 @@ impl RestrictionPoliciesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -440,7 +441,7 @@ impl RestrictionPoliciesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -450,7 +451,7 @@ impl RestrictionPoliciesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -474,23 +475,23 @@ impl RestrictionPoliciesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_roles.rs b/src/datadogV2/api/api_roles.rs index 71aa4d15a..cdfeb7acc 100644 --- a/src/datadogV2/api/api_roles.rs +++ b/src/datadogV2/api/api_roles.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -239,13 +238,13 @@ pub enum UpdateRoleError { #[derive(Debug, Clone)] pub struct RolesAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for RolesAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -253,7 +252,7 @@ impl RolesAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -295,7 +294,7 @@ impl RolesAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -306,7 +305,10 @@ impl RolesAPI { &self, role_id: String, body: crate::datadogV2::model::RelationshipToPermission, - ) -> Result> { + ) -> Result< + crate::datadogV2::model::PermissionsResponse, + datadog::Error, + > { match self .add_permission_to_role_with_http_info(role_id, body) .await @@ -315,7 +317,7 @@ impl RolesAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -330,8 +332,8 @@ impl RolesAPI { role_id: String, body: crate::datadogV2::model::RelationshipToPermission, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.add_permission_to_role"; @@ -341,7 +343,7 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}/permissions", local_configuration.get_operation_host(operation_id), - role_id = urlencode(role_id) + role_id = datadog::urlencode(role_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -358,7 +360,7 @@ impl RolesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -381,7 +383,7 @@ impl RolesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -392,7 +394,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -402,7 +404,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -412,7 +414,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -436,23 +438,23 @@ impl RolesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -461,13 +463,13 @@ impl RolesAPI { &self, role_id: String, body: crate::datadogV2::model::RelationshipToUser, - ) -> Result> { + ) -> Result> { match self.add_user_to_role_with_http_info(role_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -481,8 +483,10 @@ impl RolesAPI { &self, role_id: String, body: crate::datadogV2::model::RelationshipToUser, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.add_user_to_role"; @@ -491,7 +495,7 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}/users", local_configuration.get_operation_host(operation_id), - role_id = urlencode(role_id) + role_id = datadog::urlencode(role_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -508,7 +512,7 @@ impl RolesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -531,7 +535,7 @@ impl RolesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -542,7 +546,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -552,7 +556,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -562,7 +566,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -584,23 +588,23 @@ impl RolesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -609,13 +613,13 @@ impl RolesAPI { &self, role_id: String, body: crate::datadogV2::model::RoleCloneRequest, - ) -> Result> { + ) -> Result> { match self.clone_role_with_http_info(role_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -629,7 +633,10 @@ impl RolesAPI { &self, role_id: String, body: crate::datadogV2::model::RoleCloneRequest, - ) -> Result, Error> { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.clone_role"; @@ -638,7 +645,7 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}/clone", local_configuration.get_operation_host(operation_id), - role_id = urlencode(role_id) + role_id = datadog::urlencode(role_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -655,7 +662,7 @@ impl RolesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -678,7 +685,7 @@ impl RolesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -689,7 +696,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -699,7 +706,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -709,7 +716,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -731,22 +738,22 @@ impl RolesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -754,13 +761,13 @@ impl RolesAPI { pub async fn create_role( &self, body: crate::datadogV2::model::RoleCreateRequest, - ) -> Result> { + ) -> Result> { match self.create_role_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -773,8 +780,10 @@ impl RolesAPI { pub async fn create_role_with_http_info( &self, body: crate::datadogV2::model::RoleCreateRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.create_role"; @@ -799,7 +808,7 @@ impl RolesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -822,7 +831,7 @@ impl RolesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -833,7 +842,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -843,7 +852,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -853,7 +862,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -877,27 +886,30 @@ impl RolesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// Disables a role. - pub async fn delete_role(&self, role_id: String) -> Result<(), Error> { + pub async fn delete_role( + &self, + role_id: String, + ) -> Result<(), datadog::Error> { match self.delete_role_with_http_info(role_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -908,7 +920,7 @@ impl RolesAPI { pub async fn delete_role_with_http_info( &self, role_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_role"; @@ -917,7 +929,7 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}", local_configuration.get_operation_host(operation_id), - role_id = urlencode(role_id) + role_id = datadog::urlencode(role_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -933,7 +945,7 @@ impl RolesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -962,19 +974,19 @@ impl RolesAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, }) } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -982,13 +994,13 @@ impl RolesAPI { pub async fn get_role( &self, role_id: String, - ) -> Result> { + ) -> Result> { match self.get_role_with_http_info(role_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1001,7 +1013,10 @@ impl RolesAPI { pub async fn get_role_with_http_info( &self, role_id: String, - ) -> Result, Error> { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.get_role"; @@ -1010,7 +1025,7 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}", local_configuration.get_operation_host(operation_id), - role_id = urlencode(role_id) + role_id = datadog::urlencode(role_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1026,7 +1041,7 @@ impl RolesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1057,35 +1072,36 @@ impl RolesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// Returns a list of all permissions, including name, description, and ID. pub async fn list_permissions( &self, - ) -> Result> { + ) -> Result> + { match self.list_permissions_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1098,8 +1114,8 @@ impl RolesAPI { pub async fn list_permissions_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_permissions"; @@ -1124,7 +1140,7 @@ impl RolesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1157,23 +1173,23 @@ impl RolesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1181,13 +1197,16 @@ impl RolesAPI { pub async fn list_role_permissions( &self, role_id: String, - ) -> Result> { + ) -> Result< + crate::datadogV2::model::PermissionsResponse, + datadog::Error, + > { match self.list_role_permissions_with_http_info(role_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1201,8 +1220,8 @@ impl RolesAPI { &self, role_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_role_permissions"; @@ -1212,7 +1231,7 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}/permissions", local_configuration.get_operation_host(operation_id), - role_id = urlencode(role_id) + role_id = datadog::urlencode(role_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1228,7 +1247,7 @@ impl RolesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1261,23 +1280,23 @@ impl RolesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1286,13 +1305,13 @@ impl RolesAPI { &self, role_id: String, params: ListRoleUsersOptionalParams, - ) -> Result> { + ) -> Result> { match self.list_role_users_with_http_info(role_id, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1306,8 +1325,10 @@ impl RolesAPI { &self, role_id: String, params: ListRoleUsersOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.list_role_users"; @@ -1322,7 +1343,7 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}/users", local_configuration.get_operation_host(operation_id), - role_id = urlencode(role_id) + role_id = datadog::urlencode(role_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1355,7 +1376,7 @@ impl RolesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1386,23 +1407,23 @@ impl RolesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1410,13 +1431,13 @@ impl RolesAPI { pub async fn list_roles( &self, params: ListRolesOptionalParams, - ) -> Result> { + ) -> Result> { match self.list_roles_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1429,8 +1450,10 @@ impl RolesAPI { pub async fn list_roles_with_http_info( &self, params: ListRolesOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.list_roles"; @@ -1482,7 +1505,7 @@ impl RolesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1513,22 +1536,22 @@ impl RolesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1537,8 +1560,10 @@ impl RolesAPI { &self, role_id: String, body: crate::datadogV2::model::RelationshipToPermission, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::PermissionsResponse, + datadog::Error, + > { match self .remove_permission_from_role_with_http_info(role_id, body) .await @@ -1547,7 +1572,7 @@ impl RolesAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1562,8 +1587,8 @@ impl RolesAPI { role_id: String, body: crate::datadogV2::model::RelationshipToPermission, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.remove_permission_from_role"; @@ -1573,7 +1598,7 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}/permissions", local_configuration.get_operation_host(operation_id), - role_id = urlencode(role_id) + role_id = datadog::urlencode(role_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -1590,7 +1615,7 @@ impl RolesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1613,7 +1638,7 @@ impl RolesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1624,7 +1649,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1634,7 +1659,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1644,7 +1669,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1668,23 +1693,23 @@ impl RolesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1693,7 +1718,8 @@ impl RolesAPI { &self, role_id: String, body: crate::datadogV2::model::RelationshipToUser, - ) -> Result> { + ) -> Result> + { match self .remove_user_from_role_with_http_info(role_id, body) .await @@ -1702,7 +1728,7 @@ impl RolesAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1717,8 +1743,8 @@ impl RolesAPI { role_id: String, body: crate::datadogV2::model::RelationshipToUser, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.remove_user_from_role"; @@ -1728,7 +1754,7 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}/users", local_configuration.get_operation_host(operation_id), - role_id = urlencode(role_id) + role_id = datadog::urlencode(role_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -1745,7 +1771,7 @@ impl RolesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1768,7 +1794,7 @@ impl RolesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1779,7 +1805,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1789,7 +1815,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1799,7 +1825,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1821,23 +1847,23 @@ impl RolesAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1846,13 +1872,13 @@ impl RolesAPI { &self, role_id: String, body: crate::datadogV2::model::RoleUpdateRequest, - ) -> Result> { + ) -> Result> { match self.update_role_with_http_info(role_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1866,8 +1892,10 @@ impl RolesAPI { &self, role_id: String, body: crate::datadogV2::model::RoleUpdateRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.update_role"; @@ -1876,7 +1904,7 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}", local_configuration.get_operation_host(operation_id), - role_id = urlencode(role_id) + role_id = datadog::urlencode(role_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -1893,7 +1921,7 @@ impl RolesAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1916,7 +1944,7 @@ impl RolesAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1927,7 +1955,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1937,7 +1965,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1947,7 +1975,7 @@ impl RolesAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1971,22 +1999,22 @@ impl RolesAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_rum.rs b/src/datadogV2/api/api_rum.rs index 7e8216925..1e601a8cb 100644 --- a/src/datadogV2/api/api_rum.rs +++ b/src/datadogV2/api/api_rum.rs @@ -1,14 +1,13 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -143,13 +142,13 @@ pub enum UpdateRUMApplicationError { #[derive(Debug, Clone)] pub struct RUMAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for RUMAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -157,7 +156,7 @@ impl RUMAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -199,7 +198,7 @@ impl RUMAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -211,14 +210,14 @@ impl RUMAPI { body: crate::datadogV2::model::RUMAggregateRequest, ) -> Result< crate::datadogV2::model::RUMAnalyticsAggregateResponse, - Error, + datadog::Error, > { match self.aggregate_rum_events_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -232,8 +231,8 @@ impl RUMAPI { &self, body: crate::datadogV2::model::RUMAggregateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.aggregate_rum_events"; @@ -259,7 +258,7 @@ impl RUMAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -282,7 +281,7 @@ impl RUMAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -293,7 +292,7 @@ impl RUMAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -303,7 +302,7 @@ impl RUMAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -313,7 +312,7 @@ impl RUMAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -337,23 +336,23 @@ impl RUMAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -361,14 +360,16 @@ impl RUMAPI { pub async fn create_rum_application( &self, body: crate::datadogV2::model::RUMApplicationCreateRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::RUMApplicationResponse, + datadog::Error, + > { match self.create_rum_application_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -382,8 +383,8 @@ impl RUMAPI { &self, body: crate::datadogV2::model::RUMApplicationCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_rum_application"; @@ -409,7 +410,7 @@ impl RUMAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -432,7 +433,7 @@ impl RUMAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -443,7 +444,7 @@ impl RUMAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -453,7 +454,7 @@ impl RUMAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -463,7 +464,7 @@ impl RUMAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -487,23 +488,23 @@ impl RUMAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -511,7 +512,7 @@ impl RUMAPI { pub async fn delete_rum_application( &self, id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.delete_rum_application_with_http_info(id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -522,7 +523,7 @@ impl RUMAPI { pub async fn delete_rum_application_with_http_info( &self, id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_rum_application"; @@ -531,7 +532,7 @@ impl RUMAPI { let local_uri_str = format!( "{}/api/v2/rum/applications/{id}", local_configuration.get_operation_host(operation_id), - id = urlencode(id) + id = datadog::urlencode(id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -547,7 +548,7 @@ impl RUMAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -576,7 +577,7 @@ impl RUMAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -584,12 +585,12 @@ impl RUMAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -597,14 +598,16 @@ impl RUMAPI { pub async fn get_rum_application( &self, id: String, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::RUMApplicationResponse, + datadog::Error, + > { match self.get_rum_application_with_http_info(id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -618,8 +621,8 @@ impl RUMAPI { &self, id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_rum_application"; @@ -629,7 +632,7 @@ impl RUMAPI { let local_uri_str = format!( "{}/api/v2/rum/applications/{id}", local_configuration.get_operation_host(operation_id), - id = urlencode(id) + id = datadog::urlencode(id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -645,7 +648,7 @@ impl RUMAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -678,37 +681,39 @@ impl RUMAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// List all the RUM applications in your organization. pub async fn get_rum_applications( &self, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::RUMApplicationsResponse, + datadog::Error, + > { match self.get_rum_applications_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -721,8 +726,8 @@ impl RUMAPI { pub async fn get_rum_applications_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_rum_applications"; @@ -747,7 +752,7 @@ impl RUMAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -780,23 +785,23 @@ impl RUMAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -809,13 +814,14 @@ impl RUMAPI { pub async fn list_rum_events( &self, params: ListRUMEventsOptionalParams, - ) -> Result> { + ) -> Result> + { match self.list_rum_events_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -827,8 +833,9 @@ impl RUMAPI { pub fn list_rum_events_with_pagination( &self, mut params: ListRUMEventsOptionalParams, - ) -> impl Stream>> + '_ - { + ) -> impl Stream< + Item = Result>, + > + '_ { try_stream! { let mut page_size: i32 = 10; if params.page_limit.is_none() { @@ -868,8 +875,8 @@ impl RUMAPI { &self, params: ListRUMEventsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_rum_events"; @@ -927,7 +934,7 @@ impl RUMAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -959,23 +966,23 @@ impl RUMAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -988,13 +995,14 @@ impl RUMAPI { pub async fn search_rum_events( &self, body: crate::datadogV2::model::RUMSearchEventsRequest, - ) -> Result> { + ) -> Result> + { match self.search_rum_events_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1006,8 +1014,9 @@ impl RUMAPI { pub fn search_rum_events_with_pagination( &self, mut body: crate::datadogV2::model::RUMSearchEventsRequest, - ) -> impl Stream>> + '_ - { + ) -> impl Stream< + Item = Result>, + > + '_ { try_stream! { let mut page_size: i32 = 10; if body.page.is_none() { @@ -1050,8 +1059,8 @@ impl RUMAPI { &self, body: crate::datadogV2::model::RUMSearchEventsRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.search_rum_events"; @@ -1077,7 +1086,7 @@ impl RUMAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1100,7 +1109,7 @@ impl RUMAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1111,7 +1120,7 @@ impl RUMAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1121,7 +1130,7 @@ impl RUMAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1131,7 +1140,7 @@ impl RUMAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1154,23 +1163,23 @@ impl RUMAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1179,14 +1188,16 @@ impl RUMAPI { &self, id: String, body: crate::datadogV2::model::RUMApplicationUpdateRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::RUMApplicationResponse, + datadog::Error, + > { match self.update_rum_application_with_http_info(id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1201,8 +1212,8 @@ impl RUMAPI { id: String, body: crate::datadogV2::model::RUMApplicationUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_rum_application"; @@ -1212,7 +1223,7 @@ impl RUMAPI { let local_uri_str = format!( "{}/api/v2/rum/applications/{id}", local_configuration.get_operation_host(operation_id), - id = urlencode(id) + id = datadog::urlencode(id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -1229,7 +1240,7 @@ impl RUMAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1252,7 +1263,7 @@ impl RUMAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1263,7 +1274,7 @@ impl RUMAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1273,7 +1284,7 @@ impl RUMAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1283,7 +1294,7 @@ impl RUMAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1307,23 +1318,23 @@ impl RUMAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_security_monitoring.rs b/src/datadogV2/api/api_security_monitoring.rs index 754e7a196..9f9c4a589 100644 --- a/src/datadogV2/api/api_security_monitoring.rs +++ b/src/datadogV2/api/api_security_monitoring.rs @@ -1,7 +1,7 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, @@ -9,7 +9,6 @@ use flate2::{ }; use futures_core::stream::Stream; use log::warn; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -476,13 +475,13 @@ pub enum ValidateSecurityMonitoringRuleError { #[derive(Debug, Clone)] pub struct SecurityMonitoringAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for SecurityMonitoringAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -490,7 +489,7 @@ impl SecurityMonitoringAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -532,7 +531,7 @@ impl SecurityMonitoringAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -545,14 +544,16 @@ impl SecurityMonitoringAPI { pub async fn create_security_filter( &self, body: crate::datadogV2::model::SecurityFilterCreateRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::SecurityFilterResponse, + datadog::Error, + > { match self.create_security_filter_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -569,8 +570,8 @@ impl SecurityMonitoringAPI { &self, body: crate::datadogV2::model::SecurityFilterCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_security_filter"; @@ -596,7 +597,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -619,7 +620,7 @@ impl SecurityMonitoringAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -630,7 +631,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -640,7 +641,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -650,7 +651,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -674,23 +675,23 @@ impl SecurityMonitoringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -700,7 +701,7 @@ impl SecurityMonitoringAPI { body: crate::datadogV2::model::SecurityMonitoringRuleCreatePayload, ) -> Result< crate::datadogV2::model::SecurityMonitoringRuleResponse, - Error, + datadog::Error, > { match self .create_security_monitoring_rule_with_http_info(body) @@ -710,7 +711,7 @@ impl SecurityMonitoringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -724,8 +725,8 @@ impl SecurityMonitoringAPI { &self, body: crate::datadogV2::model::SecurityMonitoringRuleCreatePayload, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_security_monitoring_rule"; @@ -751,7 +752,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -774,7 +775,7 @@ impl SecurityMonitoringAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -785,7 +786,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -795,7 +796,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -805,7 +806,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -829,23 +830,23 @@ impl SecurityMonitoringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -855,7 +856,7 @@ impl SecurityMonitoringAPI { body: crate::datadogV2::model::SecurityMonitoringSuppressionCreateRequest, ) -> Result< crate::datadogV2::model::SecurityMonitoringSuppressionResponse, - Error, + datadog::Error, > { match self .create_security_monitoring_suppression_with_http_info(body) @@ -865,7 +866,7 @@ impl SecurityMonitoringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -879,8 +880,8 @@ impl SecurityMonitoringAPI { &self, body: crate::datadogV2::model::SecurityMonitoringSuppressionCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_security_monitoring_suppression"; @@ -906,7 +907,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -929,7 +930,7 @@ impl SecurityMonitoringAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -940,7 +941,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -950,7 +951,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -960,7 +961,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -985,23 +986,23 @@ impl SecurityMonitoringAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1009,7 +1010,7 @@ impl SecurityMonitoringAPI { pub async fn delete_security_filter( &self, security_filter_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_security_filter_with_http_info(security_filter_id) .await @@ -1023,7 +1024,7 @@ impl SecurityMonitoringAPI { pub async fn delete_security_filter_with_http_info( &self, security_filter_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_security_filter"; @@ -1032,7 +1033,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}", local_configuration.get_operation_host(operation_id), - security_filter_id = urlencode(security_filter_id) + security_filter_id = datadog::urlencode(security_filter_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -1048,7 +1049,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1077,7 +1078,7 @@ impl SecurityMonitoringAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -1085,12 +1086,12 @@ impl SecurityMonitoringAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1098,7 +1099,7 @@ impl SecurityMonitoringAPI { pub async fn delete_security_monitoring_rule( &self, rule_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_security_monitoring_rule_with_http_info(rule_id) .await @@ -1112,7 +1113,8 @@ impl SecurityMonitoringAPI { pub async fn delete_security_monitoring_rule_with_http_info( &self, rule_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> + { let local_configuration = &self.config; let operation_id = "v2.delete_security_monitoring_rule"; @@ -1121,7 +1123,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/rules/{rule_id}", local_configuration.get_operation_host(operation_id), - rule_id = urlencode(rule_id) + rule_id = datadog::urlencode(rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -1137,7 +1139,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1166,7 +1168,7 @@ impl SecurityMonitoringAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -1174,12 +1176,12 @@ impl SecurityMonitoringAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1187,7 +1189,7 @@ impl SecurityMonitoringAPI { pub async fn delete_security_monitoring_suppression( &self, suppression_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_security_monitoring_suppression_with_http_info(suppression_id) .await @@ -1201,7 +1203,10 @@ impl SecurityMonitoringAPI { pub async fn delete_security_monitoring_suppression_with_http_info( &self, suppression_id: String, - ) -> Result, Error> { + ) -> Result< + datadog::ResponseContent<()>, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.delete_security_monitoring_suppression"; @@ -1210,7 +1215,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/configuration/suppressions/{suppression_id}", local_configuration.get_operation_host(operation_id), - suppression_id = urlencode(suppression_id) + suppression_id = datadog::urlencode(suppression_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -1226,7 +1231,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1255,7 +1260,7 @@ impl SecurityMonitoringAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -1263,12 +1268,12 @@ impl SecurityMonitoringAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1279,7 +1284,7 @@ impl SecurityMonitoringAPI { body: crate::datadogV2::model::SecurityMonitoringSignalAssigneeUpdateRequest, ) -> Result< crate::datadogV2::model::SecurityMonitoringSignalTriageUpdateResponse, - Error, + datadog::Error, > { match self .edit_security_monitoring_signal_assignee_with_http_info(signal_id, body) @@ -1289,7 +1294,7 @@ impl SecurityMonitoringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1304,8 +1309,10 @@ impl SecurityMonitoringAPI { signal_id: String, body: crate::datadogV2::model::SecurityMonitoringSignalAssigneeUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent< + crate::datadogV2::model::SecurityMonitoringSignalTriageUpdateResponse, + >, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.edit_security_monitoring_signal_assignee"; @@ -1315,7 +1322,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/signals/{signal_id}/assignee", local_configuration.get_operation_host(operation_id), - signal_id = urlencode(signal_id) + signal_id = datadog::urlencode(signal_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -1332,7 +1339,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1355,7 +1362,7 @@ impl SecurityMonitoringAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1366,7 +1373,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1376,7 +1383,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1386,7 +1393,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1411,23 +1418,23 @@ impl SecurityMonitoringAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1438,7 +1445,7 @@ impl SecurityMonitoringAPI { body: crate::datadogV2::model::SecurityMonitoringSignalIncidentsUpdateRequest, ) -> Result< crate::datadogV2::model::SecurityMonitoringSignalTriageUpdateResponse, - Error, + datadog::Error, > { match self .edit_security_monitoring_signal_incidents_with_http_info(signal_id, body) @@ -1448,7 +1455,7 @@ impl SecurityMonitoringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1463,8 +1470,10 @@ impl SecurityMonitoringAPI { signal_id: String, body: crate::datadogV2::model::SecurityMonitoringSignalIncidentsUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent< + crate::datadogV2::model::SecurityMonitoringSignalTriageUpdateResponse, + >, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.edit_security_monitoring_signal_incidents"; @@ -1474,7 +1483,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/signals/{signal_id}/incidents", local_configuration.get_operation_host(operation_id), - signal_id = urlencode(signal_id) + signal_id = datadog::urlencode(signal_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -1491,7 +1500,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1514,7 +1523,7 @@ impl SecurityMonitoringAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1525,7 +1534,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1535,7 +1544,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1545,7 +1554,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1570,23 +1579,23 @@ impl SecurityMonitoringAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1597,7 +1606,7 @@ impl SecurityMonitoringAPI { body: crate::datadogV2::model::SecurityMonitoringSignalStateUpdateRequest, ) -> Result< crate::datadogV2::model::SecurityMonitoringSignalTriageUpdateResponse, - Error, + datadog::Error, > { match self .edit_security_monitoring_signal_state_with_http_info(signal_id, body) @@ -1607,7 +1616,7 @@ impl SecurityMonitoringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1622,8 +1631,10 @@ impl SecurityMonitoringAPI { signal_id: String, body: crate::datadogV2::model::SecurityMonitoringSignalStateUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent< + crate::datadogV2::model::SecurityMonitoringSignalTriageUpdateResponse, + >, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.edit_security_monitoring_signal_state"; @@ -1633,7 +1644,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/signals/{signal_id}/state", local_configuration.get_operation_host(operation_id), - signal_id = urlencode(signal_id) + signal_id = datadog::urlencode(signal_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -1650,7 +1661,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1673,7 +1684,7 @@ impl SecurityMonitoringAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1684,7 +1695,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1694,7 +1705,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1704,7 +1715,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1729,23 +1740,23 @@ impl SecurityMonitoringAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1754,13 +1765,13 @@ impl SecurityMonitoringAPI { &self, finding_id: String, params: GetFindingOptionalParams, - ) -> Result> { + ) -> Result> { match self.get_finding_with_http_info(finding_id, params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1774,17 +1785,19 @@ impl SecurityMonitoringAPI { &self, finding_id: String, params: GetFindingOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.get_finding"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.get_finding' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } // unbox and build optional parameters @@ -1795,7 +1808,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/posture_management/findings/{finding_id}", local_configuration.get_operation_host(operation_id), - finding_id = urlencode(finding_id) + finding_id = datadog::urlencode(finding_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1816,7 +1829,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1849,22 +1862,22 @@ impl SecurityMonitoringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1875,8 +1888,10 @@ impl SecurityMonitoringAPI { pub async fn get_security_filter( &self, security_filter_id: String, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::SecurityFilterResponse, + datadog::Error, + > { match self .get_security_filter_with_http_info(security_filter_id) .await @@ -1885,7 +1900,7 @@ impl SecurityMonitoringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1902,8 +1917,8 @@ impl SecurityMonitoringAPI { &self, security_filter_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_security_filter"; @@ -1913,7 +1928,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}", local_configuration.get_operation_host(operation_id), - security_filter_id = urlencode(security_filter_id) + security_filter_id = datadog::urlencode(security_filter_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1929,7 +1944,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1962,23 +1977,23 @@ impl SecurityMonitoringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1988,7 +2003,7 @@ impl SecurityMonitoringAPI { rule_id: String, ) -> Result< crate::datadogV2::model::SecurityMonitoringRuleResponse, - Error, + datadog::Error, > { match self .get_security_monitoring_rule_with_http_info(rule_id) @@ -1998,7 +2013,7 @@ impl SecurityMonitoringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2012,8 +2027,8 @@ impl SecurityMonitoringAPI { &self, rule_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_security_monitoring_rule"; @@ -2023,7 +2038,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/rules/{rule_id}", local_configuration.get_operation_host(operation_id), - rule_id = urlencode(rule_id) + rule_id = datadog::urlencode(rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2039,7 +2054,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2072,23 +2087,23 @@ impl SecurityMonitoringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2098,7 +2113,7 @@ impl SecurityMonitoringAPI { signal_id: String, ) -> Result< crate::datadogV2::model::SecurityMonitoringSignalResponse, - Error, + datadog::Error, > { match self .get_security_monitoring_signal_with_http_info(signal_id) @@ -2108,7 +2123,7 @@ impl SecurityMonitoringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2122,8 +2137,8 @@ impl SecurityMonitoringAPI { &self, signal_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_security_monitoring_signal"; @@ -2133,7 +2148,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/signals/{signal_id}", local_configuration.get_operation_host(operation_id), - signal_id = urlencode(signal_id) + signal_id = datadog::urlencode(signal_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2149,7 +2164,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2182,23 +2197,23 @@ impl SecurityMonitoringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2208,7 +2223,7 @@ impl SecurityMonitoringAPI { suppression_id: String, ) -> Result< crate::datadogV2::model::SecurityMonitoringSuppressionResponse, - Error, + datadog::Error, > { match self .get_security_monitoring_suppression_with_http_info(suppression_id) @@ -2218,7 +2233,7 @@ impl SecurityMonitoringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2232,8 +2247,8 @@ impl SecurityMonitoringAPI { &self, suppression_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_security_monitoring_suppression"; @@ -2243,7 +2258,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/configuration/suppressions/{suppression_id}", local_configuration.get_operation_host(operation_id), - suppression_id = urlencode(suppression_id) + suppression_id = datadog::urlencode(suppression_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2259,7 +2274,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2293,23 +2308,23 @@ impl SecurityMonitoringAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2347,13 +2362,14 @@ impl SecurityMonitoringAPI { pub async fn list_findings( &self, params: ListFindingsOptionalParams, - ) -> Result> { + ) -> Result> + { match self.list_findings_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2365,8 +2381,9 @@ impl SecurityMonitoringAPI { pub fn list_findings_with_pagination( &self, mut params: ListFindingsOptionalParams, - ) -> impl Stream>> + '_ - { + ) -> impl Stream< + Item = Result>, + > + '_ { try_stream! { let mut page_size: i64 = 100; if params.page_limit.is_none() { @@ -2429,18 +2446,18 @@ impl SecurityMonitoringAPI { &self, params: ListFindingsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_findings"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.list_findings' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } // unbox and build optional parameters @@ -2530,7 +2547,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2563,36 +2580,38 @@ impl SecurityMonitoringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// Get the list of configured security filters with their definitions. pub async fn list_security_filters( &self, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::SecurityFiltersResponse, + datadog::Error, + > { match self.list_security_filters_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2605,8 +2624,8 @@ impl SecurityMonitoringAPI { pub async fn list_security_filters_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_security_filters"; @@ -2631,7 +2650,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2664,23 +2683,23 @@ impl SecurityMonitoringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2690,7 +2709,7 @@ impl SecurityMonitoringAPI { params: ListSecurityMonitoringRulesOptionalParams, ) -> Result< crate::datadogV2::model::SecurityMonitoringListRulesResponse, - Error, + datadog::Error, > { match self .list_security_monitoring_rules_with_http_info(params) @@ -2700,7 +2719,7 @@ impl SecurityMonitoringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2714,8 +2733,8 @@ impl SecurityMonitoringAPI { &self, params: ListSecurityMonitoringRulesOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_security_monitoring_rules"; @@ -2753,7 +2772,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2786,23 +2805,23 @@ impl SecurityMonitoringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2814,7 +2833,7 @@ impl SecurityMonitoringAPI { params: ListSecurityMonitoringSignalsOptionalParams, ) -> Result< crate::datadogV2::model::SecurityMonitoringSignalsListResponse, - Error, + datadog::Error, > { match self .list_security_monitoring_signals_with_http_info(params) @@ -2824,7 +2843,7 @@ impl SecurityMonitoringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2839,7 +2858,7 @@ impl SecurityMonitoringAPI { ) -> impl Stream< Item = Result< crate::datadogV2::model::SecurityMonitoringSignal, - Error, + datadog::Error, >, > + '_ { try_stream! { @@ -2878,8 +2897,8 @@ impl SecurityMonitoringAPI { &self, params: ListSecurityMonitoringSignalsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_security_monitoring_signals"; @@ -2937,7 +2956,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2971,23 +2990,23 @@ impl SecurityMonitoringAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2996,7 +3015,7 @@ impl SecurityMonitoringAPI { &self, ) -> Result< crate::datadogV2::model::SecurityMonitoringSuppressionsResponse, - Error, + datadog::Error, > { match self .list_security_monitoring_suppressions_with_http_info() @@ -3006,7 +3025,7 @@ impl SecurityMonitoringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -3019,8 +3038,8 @@ impl SecurityMonitoringAPI { pub async fn list_security_monitoring_suppressions_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_security_monitoring_suppressions"; @@ -3045,7 +3064,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3079,23 +3098,23 @@ impl SecurityMonitoringAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3103,13 +3122,14 @@ impl SecurityMonitoringAPI { pub async fn mute_findings( &self, body: crate::datadogV2::model::BulkMuteFindingsRequest, - ) -> Result> { + ) -> Result> + { match self.mute_findings_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -3123,18 +3143,18 @@ impl SecurityMonitoringAPI { &self, body: crate::datadogV2::model::BulkMuteFindingsRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.mute_findings"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.mute_findings' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -3158,7 +3178,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3181,7 +3201,7 @@ impl SecurityMonitoringAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -3192,7 +3212,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -3202,7 +3222,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -3212,7 +3232,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -3236,22 +3256,22 @@ impl SecurityMonitoringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3263,7 +3283,7 @@ impl SecurityMonitoringAPI { params: SearchSecurityMonitoringSignalsOptionalParams, ) -> Result< crate::datadogV2::model::SecurityMonitoringSignalsListResponse, - Error, + datadog::Error, > { match self .search_security_monitoring_signals_with_http_info(params) @@ -3273,7 +3293,7 @@ impl SecurityMonitoringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -3288,7 +3308,7 @@ impl SecurityMonitoringAPI { ) -> impl Stream< Item = Result< crate::datadogV2::model::SecurityMonitoringSignal, - Error, + datadog::Error, >, > + '_ { try_stream! { @@ -3333,8 +3353,8 @@ impl SecurityMonitoringAPI { &self, params: SearchSecurityMonitoringSignalsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.search_security_monitoring_signals"; @@ -3363,7 +3383,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3386,7 +3406,7 @@ impl SecurityMonitoringAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -3397,7 +3417,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -3407,7 +3427,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -3417,7 +3437,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -3442,23 +3462,23 @@ impl SecurityMonitoringAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3468,8 +3488,10 @@ impl SecurityMonitoringAPI { &self, security_filter_id: String, body: crate::datadogV2::model::SecurityFilterUpdateRequest, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::SecurityFilterResponse, + datadog::Error, + > { match self .update_security_filter_with_http_info(security_filter_id, body) .await @@ -3478,7 +3500,7 @@ impl SecurityMonitoringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -3494,8 +3516,8 @@ impl SecurityMonitoringAPI { security_filter_id: String, body: crate::datadogV2::model::SecurityFilterUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_security_filter"; @@ -3505,7 +3527,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}", local_configuration.get_operation_host(operation_id), - security_filter_id = urlencode(security_filter_id) + security_filter_id = datadog::urlencode(security_filter_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -3522,7 +3544,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3545,7 +3567,7 @@ impl SecurityMonitoringAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -3556,7 +3578,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -3566,7 +3588,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -3576,7 +3598,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -3600,23 +3622,23 @@ impl SecurityMonitoringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3629,7 +3651,7 @@ impl SecurityMonitoringAPI { body: crate::datadogV2::model::SecurityMonitoringRuleUpdatePayload, ) -> Result< crate::datadogV2::model::SecurityMonitoringRuleResponse, - Error, + datadog::Error, > { match self .update_security_monitoring_rule_with_http_info(rule_id, body) @@ -3639,7 +3661,7 @@ impl SecurityMonitoringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -3656,8 +3678,8 @@ impl SecurityMonitoringAPI { rule_id: String, body: crate::datadogV2::model::SecurityMonitoringRuleUpdatePayload, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_security_monitoring_rule"; @@ -3667,7 +3689,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/rules/{rule_id}", local_configuration.get_operation_host(operation_id), - rule_id = urlencode(rule_id) + rule_id = datadog::urlencode(rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -3684,7 +3706,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3707,7 +3729,7 @@ impl SecurityMonitoringAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -3718,7 +3740,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -3728,7 +3750,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -3738,7 +3760,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -3762,23 +3784,23 @@ impl SecurityMonitoringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3789,7 +3811,7 @@ impl SecurityMonitoringAPI { body: crate::datadogV2::model::SecurityMonitoringSuppressionUpdateRequest, ) -> Result< crate::datadogV2::model::SecurityMonitoringSuppressionResponse, - Error, + datadog::Error, > { match self .update_security_monitoring_suppression_with_http_info(suppression_id, body) @@ -3799,7 +3821,7 @@ impl SecurityMonitoringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -3814,8 +3836,8 @@ impl SecurityMonitoringAPI { suppression_id: String, body: crate::datadogV2::model::SecurityMonitoringSuppressionUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_security_monitoring_suppression"; @@ -3825,7 +3847,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/configuration/suppressions/{suppression_id}", local_configuration.get_operation_host(operation_id), - suppression_id = urlencode(suppression_id) + suppression_id = datadog::urlencode(suppression_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -3842,7 +3864,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -3865,7 +3887,7 @@ impl SecurityMonitoringAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -3876,7 +3898,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -3886,7 +3908,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -3896,7 +3918,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -3921,23 +3943,23 @@ impl SecurityMonitoringAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -3945,7 +3967,7 @@ impl SecurityMonitoringAPI { pub async fn validate_security_monitoring_rule( &self, body: crate::datadogV2::model::SecurityMonitoringRuleCreatePayload, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .validate_security_monitoring_rule_with_http_info(body) .await @@ -3959,7 +3981,8 @@ impl SecurityMonitoringAPI { pub async fn validate_security_monitoring_rule_with_http_info( &self, body: crate::datadogV2::model::SecurityMonitoringRuleCreatePayload, - ) -> Result, Error> { + ) -> Result, datadog::Error> + { let local_configuration = &self.config; let operation_id = "v2.validate_security_monitoring_rule"; @@ -3984,7 +4007,7 @@ impl SecurityMonitoringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -4007,7 +4030,7 @@ impl SecurityMonitoringAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -4018,7 +4041,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -4028,7 +4051,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -4038,7 +4061,7 @@ impl SecurityMonitoringAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -4058,7 +4081,7 @@ impl SecurityMonitoringAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -4066,12 +4089,12 @@ impl SecurityMonitoringAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_sensitive_data_scanner.rs b/src/datadogV2/api/api_sensitive_data_scanner.rs index 6b065b2ac..83940d77e 100644 --- a/src/datadogV2/api/api_sensitive_data_scanner.rs +++ b/src/datadogV2/api/api_sensitive_data_scanner.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -107,13 +106,13 @@ pub enum UpdateScanningRuleError { #[derive(Debug, Clone)] pub struct SensitiveDataScannerAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for SensitiveDataScannerAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -121,7 +120,7 @@ impl SensitiveDataScannerAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -163,7 +162,7 @@ impl SensitiveDataScannerAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -179,14 +178,14 @@ impl SensitiveDataScannerAPI { body: crate::datadogV2::model::SensitiveDataScannerGroupCreateRequest, ) -> Result< crate::datadogV2::model::SensitiveDataScannerCreateGroupResponse, - Error, + datadog::Error, > { match self.create_scanning_group_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -204,8 +203,8 @@ impl SensitiveDataScannerAPI { &self, body: crate::datadogV2::model::SensitiveDataScannerGroupCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_scanning_group"; @@ -231,7 +230,7 @@ impl SensitiveDataScannerAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -254,7 +253,7 @@ impl SensitiveDataScannerAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -265,7 +264,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -275,7 +274,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -285,7 +284,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -310,23 +309,23 @@ impl SensitiveDataScannerAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -340,14 +339,14 @@ impl SensitiveDataScannerAPI { body: crate::datadogV2::model::SensitiveDataScannerRuleCreateRequest, ) -> Result< crate::datadogV2::model::SensitiveDataScannerCreateRuleResponse, - Error, + datadog::Error, > { match self.create_scanning_rule_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -365,8 +364,8 @@ impl SensitiveDataScannerAPI { &self, body: crate::datadogV2::model::SensitiveDataScannerRuleCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_scanning_rule"; @@ -392,7 +391,7 @@ impl SensitiveDataScannerAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -415,7 +414,7 @@ impl SensitiveDataScannerAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -426,7 +425,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -436,7 +435,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -446,7 +445,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -471,23 +470,23 @@ impl SensitiveDataScannerAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -498,7 +497,7 @@ impl SensitiveDataScannerAPI { body: crate::datadogV2::model::SensitiveDataScannerGroupDeleteRequest, ) -> Result< crate::datadogV2::model::SensitiveDataScannerGroupDeleteResponse, - Error, + datadog::Error, > { match self .delete_scanning_group_with_http_info(group_id, body) @@ -508,7 +507,7 @@ impl SensitiveDataScannerAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -523,8 +522,8 @@ impl SensitiveDataScannerAPI { group_id: String, body: crate::datadogV2::model::SensitiveDataScannerGroupDeleteRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.delete_scanning_group"; @@ -534,7 +533,7 @@ impl SensitiveDataScannerAPI { let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config/groups/{group_id}", local_configuration.get_operation_host(operation_id), - group_id = urlencode(group_id) + group_id = datadog::urlencode(group_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -551,7 +550,7 @@ impl SensitiveDataScannerAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -574,7 +573,7 @@ impl SensitiveDataScannerAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -585,7 +584,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -595,7 +594,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -605,7 +604,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -630,23 +629,23 @@ impl SensitiveDataScannerAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -657,7 +656,7 @@ impl SensitiveDataScannerAPI { body: crate::datadogV2::model::SensitiveDataScannerRuleDeleteRequest, ) -> Result< crate::datadogV2::model::SensitiveDataScannerRuleDeleteResponse, - Error, + datadog::Error, > { match self .delete_scanning_rule_with_http_info(rule_id, body) @@ -667,7 +666,7 @@ impl SensitiveDataScannerAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -682,8 +681,8 @@ impl SensitiveDataScannerAPI { rule_id: String, body: crate::datadogV2::model::SensitiveDataScannerRuleDeleteRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.delete_scanning_rule"; @@ -693,7 +692,7 @@ impl SensitiveDataScannerAPI { let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config/rules/{rule_id}", local_configuration.get_operation_host(operation_id), - rule_id = urlencode(rule_id) + rule_id = datadog::urlencode(rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -710,7 +709,7 @@ impl SensitiveDataScannerAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -733,7 +732,7 @@ impl SensitiveDataScannerAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -744,7 +743,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -754,7 +753,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -764,7 +763,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -789,23 +788,23 @@ impl SensitiveDataScannerAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -814,14 +813,14 @@ impl SensitiveDataScannerAPI { &self, ) -> Result< crate::datadogV2::model::SensitiveDataScannerGetConfigResponse, - Error, + datadog::Error, > { match self.list_scanning_groups_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -834,8 +833,8 @@ impl SensitiveDataScannerAPI { pub async fn list_scanning_groups_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_scanning_groups"; @@ -860,7 +859,7 @@ impl SensitiveDataScannerAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -894,23 +893,23 @@ impl SensitiveDataScannerAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -919,14 +918,14 @@ impl SensitiveDataScannerAPI { &self, ) -> Result< crate::datadogV2::model::SensitiveDataScannerStandardPatternsResponseData, - Error, + datadog::Error, > { match self.list_standard_patterns_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -939,8 +938,10 @@ impl SensitiveDataScannerAPI { pub async fn list_standard_patterns_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent< + crate::datadogV2::model::SensitiveDataScannerStandardPatternsResponseData, + >, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_standard_patterns"; @@ -965,7 +966,7 @@ impl SensitiveDataScannerAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -999,23 +1000,23 @@ impl SensitiveDataScannerAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1025,14 +1026,14 @@ impl SensitiveDataScannerAPI { body: crate::datadogV2::model::SensitiveDataScannerConfigRequest, ) -> Result< crate::datadogV2::model::SensitiveDataScannerReorderGroupsResponse, - Error, + datadog::Error, > { match self.reorder_scanning_groups_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1046,8 +1047,10 @@ impl SensitiveDataScannerAPI { &self, body: crate::datadogV2::model::SensitiveDataScannerConfigRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent< + crate::datadogV2::model::SensitiveDataScannerReorderGroupsResponse, + >, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.reorder_scanning_groups"; @@ -1073,7 +1076,7 @@ impl SensitiveDataScannerAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1096,7 +1099,7 @@ impl SensitiveDataScannerAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1107,7 +1110,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1117,7 +1120,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1127,7 +1130,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1152,23 +1155,23 @@ impl SensitiveDataScannerAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1182,7 +1185,7 @@ impl SensitiveDataScannerAPI { body: crate::datadogV2::model::SensitiveDataScannerGroupUpdateRequest, ) -> Result< crate::datadogV2::model::SensitiveDataScannerGroupUpdateResponse, - Error, + datadog::Error, > { match self .update_scanning_group_with_http_info(group_id, body) @@ -1192,7 +1195,7 @@ impl SensitiveDataScannerAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1210,8 +1213,8 @@ impl SensitiveDataScannerAPI { group_id: String, body: crate::datadogV2::model::SensitiveDataScannerGroupUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_scanning_group"; @@ -1221,7 +1224,7 @@ impl SensitiveDataScannerAPI { let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config/groups/{group_id}", local_configuration.get_operation_host(operation_id), - group_id = urlencode(group_id) + group_id = datadog::urlencode(group_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -1238,7 +1241,7 @@ impl SensitiveDataScannerAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1261,7 +1264,7 @@ impl SensitiveDataScannerAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1272,7 +1275,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1282,7 +1285,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1292,7 +1295,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1317,23 +1320,23 @@ impl SensitiveDataScannerAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1347,7 +1350,7 @@ impl SensitiveDataScannerAPI { body: crate::datadogV2::model::SensitiveDataScannerRuleUpdateRequest, ) -> Result< crate::datadogV2::model::SensitiveDataScannerRuleUpdateResponse, - Error, + datadog::Error, > { match self .update_scanning_rule_with_http_info(rule_id, body) @@ -1357,7 +1360,7 @@ impl SensitiveDataScannerAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1375,8 +1378,8 @@ impl SensitiveDataScannerAPI { rule_id: String, body: crate::datadogV2::model::SensitiveDataScannerRuleUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_scanning_rule"; @@ -1386,7 +1389,7 @@ impl SensitiveDataScannerAPI { let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config/rules/{rule_id}", local_configuration.get_operation_host(operation_id), - rule_id = urlencode(rule_id) + rule_id = datadog::urlencode(rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -1403,7 +1406,7 @@ impl SensitiveDataScannerAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1426,7 +1429,7 @@ impl SensitiveDataScannerAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1437,7 +1440,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1447,7 +1450,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1457,7 +1460,7 @@ impl SensitiveDataScannerAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1482,23 +1485,23 @@ impl SensitiveDataScannerAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_service_accounts.rs b/src/datadogV2/api/api_service_accounts.rs index c9e511a93..ea2e39275 100644 --- a/src/datadogV2/api/api_service_accounts.rs +++ b/src/datadogV2/api/api_service_accounts.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -130,13 +129,13 @@ pub enum UpdateServiceAccountApplicationKeyError { #[derive(Debug, Clone)] pub struct ServiceAccountsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for ServiceAccountsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -144,7 +143,7 @@ impl ServiceAccountsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -186,7 +185,7 @@ impl ServiceAccountsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -196,13 +195,14 @@ impl ServiceAccountsAPI { pub async fn create_service_account( &self, body: crate::datadogV2::model::ServiceAccountCreateRequest, - ) -> Result> { + ) -> Result> + { match self.create_service_account_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -216,8 +216,8 @@ impl ServiceAccountsAPI { &self, body: crate::datadogV2::model::ServiceAccountCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_service_account"; @@ -243,7 +243,7 @@ impl ServiceAccountsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -266,7 +266,7 @@ impl ServiceAccountsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -277,7 +277,7 @@ impl ServiceAccountsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -287,7 +287,7 @@ impl ServiceAccountsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -297,7 +297,7 @@ impl ServiceAccountsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -319,23 +319,23 @@ impl ServiceAccountsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -346,7 +346,7 @@ impl ServiceAccountsAPI { body: crate::datadogV2::model::ApplicationKeyCreateRequest, ) -> Result< crate::datadogV2::model::ApplicationKeyResponse, - Error, + datadog::Error, > { match self .create_service_account_application_key_with_http_info(service_account_id, body) @@ -356,7 +356,7 @@ impl ServiceAccountsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -371,8 +371,8 @@ impl ServiceAccountsAPI { service_account_id: String, body: crate::datadogV2::model::ApplicationKeyCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_service_account_application_key"; @@ -382,7 +382,7 @@ impl ServiceAccountsAPI { let local_uri_str = format!( "{}/api/v2/service_accounts/{service_account_id}/application_keys", local_configuration.get_operation_host(operation_id), - service_account_id = urlencode(service_account_id) + service_account_id = datadog::urlencode(service_account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -399,7 +399,7 @@ impl ServiceAccountsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -422,7 +422,7 @@ impl ServiceAccountsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -433,7 +433,7 @@ impl ServiceAccountsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -443,7 +443,7 @@ impl ServiceAccountsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -453,7 +453,7 @@ impl ServiceAccountsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -477,23 +477,23 @@ impl ServiceAccountsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -502,7 +502,7 @@ impl ServiceAccountsAPI { &self, service_account_id: String, app_key_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_service_account_application_key_with_http_info(service_account_id, app_key_id) .await @@ -517,7 +517,8 @@ impl ServiceAccountsAPI { &self, service_account_id: String, app_key_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> + { let local_configuration = &self.config; let operation_id = "v2.delete_service_account_application_key"; @@ -526,8 +527,8 @@ impl ServiceAccountsAPI { let local_uri_str = format!( "{}/api/v2/service_accounts/{service_account_id}/application_keys/{app_key_id}", local_configuration.get_operation_host(operation_id), - service_account_id = urlencode(service_account_id), - app_key_id = urlencode(app_key_id) + service_account_id = datadog::urlencode(service_account_id), + app_key_id = datadog::urlencode(app_key_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -543,7 +544,7 @@ impl ServiceAccountsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -572,7 +573,7 @@ impl ServiceAccountsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -580,12 +581,12 @@ impl ServiceAccountsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -596,7 +597,7 @@ impl ServiceAccountsAPI { app_key_id: String, ) -> Result< crate::datadogV2::model::PartialApplicationKeyResponse, - Error, + datadog::Error, > { match self .get_service_account_application_key_with_http_info(service_account_id, app_key_id) @@ -606,7 +607,7 @@ impl ServiceAccountsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -621,8 +622,8 @@ impl ServiceAccountsAPI { service_account_id: String, app_key_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_service_account_application_key"; @@ -632,8 +633,8 @@ impl ServiceAccountsAPI { let local_uri_str = format!( "{}/api/v2/service_accounts/{service_account_id}/application_keys/{app_key_id}", local_configuration.get_operation_host(operation_id), - service_account_id = urlencode(service_account_id), - app_key_id = urlencode(app_key_id) + service_account_id = datadog::urlencode(service_account_id), + app_key_id = datadog::urlencode(app_key_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -649,7 +650,7 @@ impl ServiceAccountsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -682,23 +683,23 @@ impl ServiceAccountsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -709,7 +710,7 @@ impl ServiceAccountsAPI { params: ListServiceAccountApplicationKeysOptionalParams, ) -> Result< crate::datadogV2::model::ListApplicationKeysResponse, - Error, + datadog::Error, > { match self .list_service_account_application_keys_with_http_info(service_account_id, params) @@ -719,7 +720,7 @@ impl ServiceAccountsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -734,8 +735,8 @@ impl ServiceAccountsAPI { service_account_id: String, params: ListServiceAccountApplicationKeysOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_service_account_application_keys"; @@ -753,7 +754,7 @@ impl ServiceAccountsAPI { let local_uri_str = format!( "{}/api/v2/service_accounts/{service_account_id}/application_keys", local_configuration.get_operation_host(operation_id), - service_account_id = urlencode(service_account_id) + service_account_id = datadog::urlencode(service_account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -794,7 +795,7 @@ impl ServiceAccountsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -827,23 +828,23 @@ impl ServiceAccountsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -855,7 +856,7 @@ impl ServiceAccountsAPI { body: crate::datadogV2::model::ApplicationKeyUpdateRequest, ) -> Result< crate::datadogV2::model::PartialApplicationKeyResponse, - Error, + datadog::Error, > { match self .update_service_account_application_key_with_http_info( @@ -869,7 +870,7 @@ impl ServiceAccountsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -885,8 +886,8 @@ impl ServiceAccountsAPI { app_key_id: String, body: crate::datadogV2::model::ApplicationKeyUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_service_account_application_key"; @@ -896,8 +897,8 @@ impl ServiceAccountsAPI { let local_uri_str = format!( "{}/api/v2/service_accounts/{service_account_id}/application_keys/{app_key_id}", local_configuration.get_operation_host(operation_id), - service_account_id = urlencode(service_account_id), - app_key_id = urlencode(app_key_id) + service_account_id = datadog::urlencode(service_account_id), + app_key_id = datadog::urlencode(app_key_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -914,7 +915,7 @@ impl ServiceAccountsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -937,7 +938,7 @@ impl ServiceAccountsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -948,7 +949,7 @@ impl ServiceAccountsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -958,7 +959,7 @@ impl ServiceAccountsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -968,7 +969,7 @@ impl ServiceAccountsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -992,23 +993,23 @@ impl ServiceAccountsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_service_definition.rs b/src/datadogV2/api/api_service_definition.rs index 569881967..807eb3503 100644 --- a/src/datadogV2/api/api_service_definition.rs +++ b/src/datadogV2/api/api_service_definition.rs @@ -1,14 +1,13 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -110,13 +109,13 @@ pub enum ListServiceDefinitionsError { #[derive(Debug, Clone)] pub struct ServiceDefinitionAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for ServiceDefinitionAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -124,7 +123,7 @@ impl ServiceDefinitionAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -166,7 +165,7 @@ impl ServiceDefinitionAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -178,7 +177,7 @@ impl ServiceDefinitionAPI { body: crate::datadogV2::model::ServiceDefinitionsCreateRequest, ) -> Result< crate::datadogV2::model::ServiceDefinitionCreateResponse, - Error, + datadog::Error, > { match self .create_or_update_service_definitions_with_http_info(body) @@ -188,7 +187,7 @@ impl ServiceDefinitionAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -202,8 +201,8 @@ impl ServiceDefinitionAPI { &self, body: crate::datadogV2::model::ServiceDefinitionsCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_or_update_service_definitions"; @@ -229,7 +228,7 @@ impl ServiceDefinitionAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -252,7 +251,7 @@ impl ServiceDefinitionAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -263,7 +262,7 @@ impl ServiceDefinitionAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -273,7 +272,7 @@ impl ServiceDefinitionAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -283,7 +282,7 @@ impl ServiceDefinitionAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -307,23 +306,23 @@ impl ServiceDefinitionAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -331,7 +330,7 @@ impl ServiceDefinitionAPI { pub async fn delete_service_definition( &self, service_name: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_service_definition_with_http_info(service_name) .await @@ -345,7 +344,7 @@ impl ServiceDefinitionAPI { pub async fn delete_service_definition_with_http_info( &self, service_name: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_service_definition"; @@ -354,7 +353,7 @@ impl ServiceDefinitionAPI { let local_uri_str = format!( "{}/api/v2/services/definitions/{service_name}", local_configuration.get_operation_host(operation_id), - service_name = urlencode(service_name) + service_name = datadog::urlencode(service_name) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -370,7 +369,7 @@ impl ServiceDefinitionAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -399,7 +398,7 @@ impl ServiceDefinitionAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -407,12 +406,12 @@ impl ServiceDefinitionAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -423,7 +422,7 @@ impl ServiceDefinitionAPI { params: GetServiceDefinitionOptionalParams, ) -> Result< crate::datadogV2::model::ServiceDefinitionGetResponse, - Error, + datadog::Error, > { match self .get_service_definition_with_http_info(service_name, params) @@ -433,7 +432,7 @@ impl ServiceDefinitionAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -448,8 +447,8 @@ impl ServiceDefinitionAPI { service_name: String, params: GetServiceDefinitionOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_service_definition"; @@ -462,7 +461,7 @@ impl ServiceDefinitionAPI { let local_uri_str = format!( "{}/api/v2/services/definitions/{service_name}", local_configuration.get_operation_host(operation_id), - service_name = urlencode(service_name) + service_name = datadog::urlencode(service_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -483,7 +482,7 @@ impl ServiceDefinitionAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -516,23 +515,23 @@ impl ServiceDefinitionAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -542,14 +541,14 @@ impl ServiceDefinitionAPI { params: ListServiceDefinitionsOptionalParams, ) -> Result< crate::datadogV2::model::ServiceDefinitionsListResponse, - Error, + datadog::Error, > { match self.list_service_definitions_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -564,7 +563,7 @@ impl ServiceDefinitionAPI { ) -> impl Stream< Item = Result< crate::datadogV2::model::ServiceDefinitionData, - Error, + datadog::Error, >, > + '_ { try_stream! { @@ -600,8 +599,8 @@ impl ServiceDefinitionAPI { &self, params: ListServiceDefinitionsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_service_definitions"; @@ -644,7 +643,7 @@ impl ServiceDefinitionAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -677,23 +676,23 @@ impl ServiceDefinitionAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_service_scorecards.rs b/src/datadogV2/api/api_service_scorecards.rs index 0fde6dced..36f150ece 100644 --- a/src/datadogV2/api/api_service_scorecards.rs +++ b/src/datadogV2/api/api_service_scorecards.rs @@ -1,7 +1,7 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, @@ -9,7 +9,6 @@ use flate2::{ }; use futures_core::stream::Stream; use log::warn; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -225,13 +224,13 @@ pub enum ListScorecardRulesError { #[derive(Debug, Clone)] pub struct ServiceScorecardsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for ServiceScorecardsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -239,7 +238,7 @@ impl ServiceScorecardsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -281,7 +280,7 @@ impl ServiceScorecardsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -293,7 +292,7 @@ impl ServiceScorecardsAPI { body: crate::datadogV2::model::OutcomesBatchRequest, ) -> Result< crate::datadogV2::model::OutcomesBatchResponse, - Error, + datadog::Error, > { match self .create_scorecard_outcomes_batch_with_http_info(body) @@ -303,7 +302,7 @@ impl ServiceScorecardsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -317,18 +316,18 @@ impl ServiceScorecardsAPI { &self, body: crate::datadogV2::model::OutcomesBatchRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_scorecard_outcomes_batch"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.create_scorecard_outcomes_batch' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -352,7 +351,7 @@ impl ServiceScorecardsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -375,7 +374,7 @@ impl ServiceScorecardsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -386,7 +385,7 @@ impl ServiceScorecardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -396,7 +395,7 @@ impl ServiceScorecardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -406,7 +405,7 @@ impl ServiceScorecardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -430,23 +429,23 @@ impl ServiceScorecardsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -454,13 +453,14 @@ impl ServiceScorecardsAPI { pub async fn create_scorecard_rule( &self, body: crate::datadogV2::model::CreateRuleRequest, - ) -> Result> { + ) -> Result> + { match self.create_scorecard_rule_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -474,18 +474,18 @@ impl ServiceScorecardsAPI { &self, body: crate::datadogV2::model::CreateRuleRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_scorecard_rule"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.create_scorecard_rule' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -509,7 +509,7 @@ impl ServiceScorecardsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -532,7 +532,7 @@ impl ServiceScorecardsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -543,7 +543,7 @@ impl ServiceScorecardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -553,7 +553,7 @@ impl ServiceScorecardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -563,7 +563,7 @@ impl ServiceScorecardsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -587,23 +587,23 @@ impl ServiceScorecardsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -611,7 +611,7 @@ impl ServiceScorecardsAPI { pub async fn delete_scorecard_rule( &self, rule_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.delete_scorecard_rule_with_http_info(rule_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -622,16 +622,16 @@ impl ServiceScorecardsAPI { pub async fn delete_scorecard_rule_with_http_info( &self, rule_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_scorecard_rule"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.delete_scorecard_rule' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -639,7 +639,7 @@ impl ServiceScorecardsAPI { let local_uri_str = format!( "{}/api/v2/scorecard/rules/{rule_id}", local_configuration.get_operation_host(operation_id), - rule_id = urlencode(rule_id) + rule_id = datadog::urlencode(rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -655,7 +655,7 @@ impl ServiceScorecardsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -684,7 +684,7 @@ impl ServiceScorecardsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -692,12 +692,12 @@ impl ServiceScorecardsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -705,13 +705,14 @@ impl ServiceScorecardsAPI { pub async fn list_scorecard_outcomes( &self, params: ListScorecardOutcomesOptionalParams, - ) -> Result> { + ) -> Result> + { match self.list_scorecard_outcomes_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -726,7 +727,7 @@ impl ServiceScorecardsAPI { ) -> impl Stream< Item = Result< crate::datadogV2::model::OutcomesResponseDataItem, - Error, + datadog::Error, >, > + '_ { try_stream! { @@ -763,18 +764,18 @@ impl ServiceScorecardsAPI { &self, params: ListScorecardOutcomesOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_scorecard_outcomes"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.list_scorecard_outcomes' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } // unbox and build optional parameters @@ -852,7 +853,7 @@ impl ServiceScorecardsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -884,23 +885,23 @@ impl ServiceScorecardsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -908,13 +909,14 @@ impl ServiceScorecardsAPI { pub async fn list_scorecard_rules( &self, params: ListScorecardRulesOptionalParams, - ) -> Result> { + ) -> Result> + { match self.list_scorecard_rules_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -929,7 +931,7 @@ impl ServiceScorecardsAPI { ) -> impl Stream< Item = Result< crate::datadogV2::model::ListRulesResponseDataItem, - Error, + datadog::Error, >, > + '_ { try_stream! { @@ -966,18 +968,18 @@ impl ServiceScorecardsAPI { &self, params: ListScorecardRulesOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_scorecard_rules"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.list_scorecard_rules' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } // unbox and build optional parameters @@ -1053,7 +1055,7 @@ impl ServiceScorecardsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1085,23 +1087,23 @@ impl ServiceScorecardsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_spans.rs b/src/datadogV2/api/api_spans.rs index f19d421c1..1937b1516 100644 --- a/src/datadogV2/api/api_spans.rs +++ b/src/datadogV2/api/api_spans.rs @@ -1,14 +1,13 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -98,13 +97,13 @@ pub enum ListSpansGetError { #[derive(Debug, Clone)] pub struct SpansAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for SpansAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -112,7 +111,7 @@ impl SpansAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -154,7 +153,7 @@ impl SpansAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -165,13 +164,14 @@ impl SpansAPI { pub async fn aggregate_spans( &self, body: crate::datadogV2::model::SpansAggregateRequest, - ) -> Result> { + ) -> Result> + { match self.aggregate_spans_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -186,8 +186,8 @@ impl SpansAPI { &self, body: crate::datadogV2::model::SpansAggregateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.aggregate_spans"; @@ -213,7 +213,7 @@ impl SpansAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -236,7 +236,7 @@ impl SpansAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -247,7 +247,7 @@ impl SpansAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -257,7 +257,7 @@ impl SpansAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -267,7 +267,7 @@ impl SpansAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -291,23 +291,23 @@ impl SpansAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -321,13 +321,13 @@ impl SpansAPI { pub async fn list_spans( &self, body: crate::datadogV2::model::SpansListRequest, - ) -> Result> { + ) -> Result> { match self.list_spans_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -339,7 +339,8 @@ impl SpansAPI { pub fn list_spans_with_pagination( &self, mut body: crate::datadogV2::model::SpansListRequest, - ) -> impl Stream>> + '_ { + ) -> impl Stream>> + '_ + { try_stream! { let mut page_size: i32 = 10; if body.data.is_none() { @@ -388,8 +389,10 @@ impl SpansAPI { pub async fn list_spans_with_http_info( &self, body: crate::datadogV2::model::SpansListRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.list_spans"; @@ -414,7 +417,7 @@ impl SpansAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -437,7 +440,7 @@ impl SpansAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -448,7 +451,7 @@ impl SpansAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -458,7 +461,7 @@ impl SpansAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -468,7 +471,7 @@ impl SpansAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -491,22 +494,22 @@ impl SpansAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -520,13 +523,13 @@ impl SpansAPI { pub async fn list_spans_get( &self, params: ListSpansGetOptionalParams, - ) -> Result> { + ) -> Result> { match self.list_spans_get_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -538,7 +541,7 @@ impl SpansAPI { pub fn list_spans_get_with_pagination( &self, mut params: ListSpansGetOptionalParams, - ) -> impl Stream>> + '_ + ) -> impl Stream>> + '_ { try_stream! { let mut page_size: i32 = 10; @@ -579,8 +582,10 @@ impl SpansAPI { pub async fn list_spans_get_with_http_info( &self, params: ListSpansGetOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.list_spans_get"; @@ -637,7 +642,7 @@ impl SpansAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -669,22 +674,22 @@ impl SpansAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_spans_metrics.rs b/src/datadogV2/api/api_spans_metrics.rs index d502f3457..5296de649 100644 --- a/src/datadogV2/api/api_spans_metrics.rs +++ b/src/datadogV2/api/api_spans_metrics.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -64,13 +63,13 @@ pub enum UpdateSpansMetricError { #[derive(Debug, Clone)] pub struct SpansMetricsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for SpansMetricsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -78,7 +77,7 @@ impl SpansMetricsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -120,7 +119,7 @@ impl SpansMetricsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -131,13 +130,14 @@ impl SpansMetricsAPI { pub async fn create_spans_metric( &self, body: crate::datadogV2::model::SpansMetricCreateRequest, - ) -> Result> { + ) -> Result> + { match self.create_spans_metric_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -152,8 +152,8 @@ impl SpansMetricsAPI { &self, body: crate::datadogV2::model::SpansMetricCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_spans_metric"; @@ -179,7 +179,7 @@ impl SpansMetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -202,7 +202,7 @@ impl SpansMetricsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -213,7 +213,7 @@ impl SpansMetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -223,7 +223,7 @@ impl SpansMetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -233,7 +233,7 @@ impl SpansMetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -257,23 +257,23 @@ impl SpansMetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -281,7 +281,7 @@ impl SpansMetricsAPI { pub async fn delete_spans_metric( &self, metric_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.delete_spans_metric_with_http_info(metric_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -292,7 +292,7 @@ impl SpansMetricsAPI { pub async fn delete_spans_metric_with_http_info( &self, metric_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_spans_metric"; @@ -301,7 +301,7 @@ impl SpansMetricsAPI { let local_uri_str = format!( "{}/api/v2/apm/config/metrics/{metric_id}", local_configuration.get_operation_host(operation_id), - metric_id = urlencode(metric_id) + metric_id = datadog::urlencode(metric_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -317,7 +317,7 @@ impl SpansMetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -346,7 +346,7 @@ impl SpansMetricsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -354,12 +354,12 @@ impl SpansMetricsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -367,13 +367,14 @@ impl SpansMetricsAPI { pub async fn get_spans_metric( &self, metric_id: String, - ) -> Result> { + ) -> Result> + { match self.get_spans_metric_with_http_info(metric_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -387,8 +388,8 @@ impl SpansMetricsAPI { &self, metric_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_spans_metric"; @@ -398,7 +399,7 @@ impl SpansMetricsAPI { let local_uri_str = format!( "{}/api/v2/apm/config/metrics/{metric_id}", local_configuration.get_operation_host(operation_id), - metric_id = urlencode(metric_id) + metric_id = datadog::urlencode(metric_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -414,7 +415,7 @@ impl SpansMetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -447,36 +448,37 @@ impl SpansMetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// Get the list of configured span-based metrics with their definitions. pub async fn list_spans_metrics( &self, - ) -> Result> { + ) -> Result> + { match self.list_spans_metrics_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -489,8 +491,8 @@ impl SpansMetricsAPI { pub async fn list_spans_metrics_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_spans_metrics"; @@ -515,7 +517,7 @@ impl SpansMetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -548,23 +550,23 @@ impl SpansMetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -574,7 +576,8 @@ impl SpansMetricsAPI { &self, metric_id: String, body: crate::datadogV2::model::SpansMetricUpdateRequest, - ) -> Result> { + ) -> Result> + { match self .update_spans_metric_with_http_info(metric_id, body) .await @@ -583,7 +586,7 @@ impl SpansMetricsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -599,8 +602,8 @@ impl SpansMetricsAPI { metric_id: String, body: crate::datadogV2::model::SpansMetricUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_spans_metric"; @@ -610,7 +613,7 @@ impl SpansMetricsAPI { let local_uri_str = format!( "{}/api/v2/apm/config/metrics/{metric_id}", local_configuration.get_operation_host(operation_id), - metric_id = urlencode(metric_id) + metric_id = datadog::urlencode(metric_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -627,7 +630,7 @@ impl SpansMetricsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -650,7 +653,7 @@ impl SpansMetricsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -661,7 +664,7 @@ impl SpansMetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -671,7 +674,7 @@ impl SpansMetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -681,7 +684,7 @@ impl SpansMetricsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -705,23 +708,23 @@ impl SpansMetricsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_synthetics.rs b/src/datadogV2/api/api_synthetics.rs index 54732e3e9..a4e13d3e1 100644 --- a/src/datadogV2/api/api_synthetics.rs +++ b/src/datadogV2/api/api_synthetics.rs @@ -1,12 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -29,13 +28,13 @@ pub enum SetOnDemandConcurrencyCapError { #[derive(Debug, Clone)] pub struct SyntheticsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for SyntheticsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -43,7 +42,7 @@ impl SyntheticsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -85,7 +84,7 @@ impl SyntheticsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -96,14 +95,14 @@ impl SyntheticsAPI { &self, ) -> Result< crate::datadogV2::model::OnDemandConcurrencyCapResponse, - Error, + datadog::Error, > { match self.get_on_demand_concurrency_cap_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -116,8 +115,8 @@ impl SyntheticsAPI { pub async fn get_on_demand_concurrency_cap_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_on_demand_concurrency_cap"; @@ -142,7 +141,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -175,23 +174,23 @@ impl SyntheticsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -201,7 +200,7 @@ impl SyntheticsAPI { body: crate::datadogV2::model::OnDemandConcurrencyCapAttributes, ) -> Result< crate::datadogV2::model::OnDemandConcurrencyCapResponse, - Error, + datadog::Error, > { match self .set_on_demand_concurrency_cap_with_http_info(body) @@ -211,7 +210,7 @@ impl SyntheticsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -225,8 +224,8 @@ impl SyntheticsAPI { &self, body: crate::datadogV2::model::OnDemandConcurrencyCapAttributes, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.set_on_demand_concurrency_cap"; @@ -252,7 +251,7 @@ impl SyntheticsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -275,7 +274,7 @@ impl SyntheticsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -286,7 +285,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -296,7 +295,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -306,7 +305,7 @@ impl SyntheticsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -330,23 +329,23 @@ impl SyntheticsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_teams.rs b/src/datadogV2/api/api_teams.rs index be15ced86..ecabf4451 100644 --- a/src/datadogV2/api/api_teams.rs +++ b/src/datadogV2/api/api_teams.rs @@ -1,14 +1,13 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -282,13 +281,13 @@ pub enum UpdateTeamPermissionSettingError { #[derive(Debug, Clone)] pub struct TeamsAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for TeamsAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -296,7 +295,7 @@ impl TeamsAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -338,7 +337,7 @@ impl TeamsAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -349,13 +348,13 @@ impl TeamsAPI { pub async fn create_team( &self, body: crate::datadogV2::model::TeamCreateRequest, - ) -> Result> { + ) -> Result> { match self.create_team_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -369,8 +368,10 @@ impl TeamsAPI { pub async fn create_team_with_http_info( &self, body: crate::datadogV2::model::TeamCreateRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.create_team"; @@ -395,7 +396,7 @@ impl TeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -418,7 +419,7 @@ impl TeamsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -429,7 +430,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -439,7 +440,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -449,7 +450,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -471,22 +472,22 @@ impl TeamsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -495,13 +496,14 @@ impl TeamsAPI { &self, team_id: String, body: crate::datadogV2::model::TeamLinkCreateRequest, - ) -> Result> { + ) -> Result> + { match self.create_team_link_with_http_info(team_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -516,8 +518,8 @@ impl TeamsAPI { team_id: String, body: crate::datadogV2::model::TeamLinkCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_team_link"; @@ -527,7 +529,7 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/links", local_configuration.get_operation_host(operation_id), - team_id = urlencode(team_id) + team_id = datadog::urlencode(team_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -544,7 +546,7 @@ impl TeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -567,7 +569,7 @@ impl TeamsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -578,7 +580,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -588,7 +590,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -598,7 +600,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -621,23 +623,23 @@ impl TeamsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -646,7 +648,8 @@ impl TeamsAPI { &self, team_id: String, body: crate::datadogV2::model::UserTeamRequest, - ) -> Result> { + ) -> Result> + { match self .create_team_membership_with_http_info(team_id, body) .await @@ -655,7 +658,7 @@ impl TeamsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -670,8 +673,8 @@ impl TeamsAPI { team_id: String, body: crate::datadogV2::model::UserTeamRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.create_team_membership"; @@ -681,7 +684,7 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/memberships", local_configuration.get_operation_host(operation_id), - team_id = urlencode(team_id) + team_id = datadog::urlencode(team_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -698,7 +701,7 @@ impl TeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -721,7 +724,7 @@ impl TeamsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -732,7 +735,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -742,7 +745,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -752,7 +755,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -775,28 +778,31 @@ impl TeamsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// Remove a team using the team's `id`. - pub async fn delete_team(&self, team_id: String) -> Result<(), Error> { + pub async fn delete_team( + &self, + team_id: String, + ) -> Result<(), datadog::Error> { match self.delete_team_with_http_info(team_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -807,7 +813,7 @@ impl TeamsAPI { pub async fn delete_team_with_http_info( &self, team_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_team"; @@ -816,7 +822,7 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}", local_configuration.get_operation_host(operation_id), - team_id = urlencode(team_id) + team_id = datadog::urlencode(team_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -832,7 +838,7 @@ impl TeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -861,19 +867,19 @@ impl TeamsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, }) } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -882,7 +888,7 @@ impl TeamsAPI { &self, team_id: String, link_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self.delete_team_link_with_http_info(team_id, link_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -894,7 +900,7 @@ impl TeamsAPI { &self, team_id: String, link_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_team_link"; @@ -903,8 +909,8 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/links/{link_id}", local_configuration.get_operation_host(operation_id), - team_id = urlencode(team_id), - link_id = urlencode(link_id) + team_id = datadog::urlencode(team_id), + link_id = datadog::urlencode(link_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -920,7 +926,7 @@ impl TeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -949,7 +955,7 @@ impl TeamsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -957,12 +963,12 @@ impl TeamsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -971,7 +977,7 @@ impl TeamsAPI { &self, team_id: String, user_id: String, - ) -> Result<(), Error> { + ) -> Result<(), datadog::Error> { match self .delete_team_membership_with_http_info(team_id, user_id) .await @@ -986,7 +992,7 @@ impl TeamsAPI { &self, team_id: String, user_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.delete_team_membership"; @@ -995,8 +1001,8 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/memberships/{user_id}", local_configuration.get_operation_host(operation_id), - team_id = urlencode(team_id), - user_id = urlencode(user_id) + team_id = datadog::urlencode(team_id), + user_id = datadog::urlencode(user_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -1012,7 +1018,7 @@ impl TeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1041,7 +1047,7 @@ impl TeamsAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, @@ -1049,12 +1055,12 @@ impl TeamsAPI { } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1062,13 +1068,13 @@ impl TeamsAPI { pub async fn get_team( &self, team_id: String, - ) -> Result> { + ) -> Result> { match self.get_team_with_http_info(team_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1081,7 +1087,10 @@ impl TeamsAPI { pub async fn get_team_with_http_info( &self, team_id: String, - ) -> Result, Error> { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.get_team"; @@ -1090,7 +1099,7 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}", local_configuration.get_operation_host(operation_id), - team_id = urlencode(team_id) + team_id = datadog::urlencode(team_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1106,7 +1115,7 @@ impl TeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1137,22 +1146,22 @@ impl TeamsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1161,13 +1170,13 @@ impl TeamsAPI { &self, team_id: String, link_id: String, - ) -> Result> { + ) -> Result> { match self.get_team_link_with_http_info(team_id, link_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1181,8 +1190,10 @@ impl TeamsAPI { &self, team_id: String, link_id: String, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.get_team_link"; @@ -1191,8 +1202,8 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/links/{link_id}", local_configuration.get_operation_host(operation_id), - team_id = urlencode(team_id), - link_id = urlencode(link_id) + team_id = datadog::urlencode(team_id), + link_id = datadog::urlencode(link_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1208,7 +1219,7 @@ impl TeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1240,22 +1251,22 @@ impl TeamsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1263,13 +1274,13 @@ impl TeamsAPI { pub async fn get_team_links( &self, team_id: String, - ) -> Result> { + ) -> Result> { match self.get_team_links_with_http_info(team_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1282,8 +1293,10 @@ impl TeamsAPI { pub async fn get_team_links_with_http_info( &self, team_id: String, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.get_team_links"; @@ -1292,7 +1305,7 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/links", local_configuration.get_operation_host(operation_id), - team_id = urlencode(team_id) + team_id = datadog::urlencode(team_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1308,7 +1321,7 @@ impl TeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1340,22 +1353,22 @@ impl TeamsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1364,7 +1377,8 @@ impl TeamsAPI { &self, team_id: String, params: GetTeamMembershipsOptionalParams, - ) -> Result> { + ) -> Result> + { match self .get_team_memberships_with_http_info(team_id, params) .await @@ -1373,7 +1387,7 @@ impl TeamsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1386,8 +1400,9 @@ impl TeamsAPI { &self, team_id: String, mut params: GetTeamMembershipsOptionalParams, - ) -> impl Stream>> + '_ - { + ) -> impl Stream< + Item = Result>, + > + '_ { try_stream! { let mut page_size: i64 = 10; if params.page_size.is_none() { @@ -1422,8 +1437,8 @@ impl TeamsAPI { team_id: String, params: GetTeamMembershipsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_team_memberships"; @@ -1439,7 +1454,7 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/memberships", local_configuration.get_operation_host(operation_id), - team_id = urlencode(team_id) + team_id = datadog::urlencode(team_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1472,7 +1487,7 @@ impl TeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1504,23 +1519,23 @@ impl TeamsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1530,7 +1545,7 @@ impl TeamsAPI { team_id: String, ) -> Result< crate::datadogV2::model::TeamPermissionSettingsResponse, - Error, + datadog::Error, > { match self .get_team_permission_settings_with_http_info(team_id) @@ -1540,7 +1555,7 @@ impl TeamsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1554,8 +1569,8 @@ impl TeamsAPI { &self, team_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_team_permission_settings"; @@ -1565,7 +1580,7 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/permission-settings", local_configuration.get_operation_host(operation_id), - team_id = urlencode(team_id) + team_id = datadog::urlencode(team_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1581,7 +1596,7 @@ impl TeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1614,23 +1629,23 @@ impl TeamsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1638,13 +1653,14 @@ impl TeamsAPI { pub async fn get_user_memberships( &self, user_uuid: String, - ) -> Result> { + ) -> Result> + { match self.get_user_memberships_with_http_info(user_uuid).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1658,8 +1674,8 @@ impl TeamsAPI { &self, user_uuid: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_user_memberships"; @@ -1669,7 +1685,7 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/users/{user_uuid}/memberships", local_configuration.get_operation_host(operation_id), - user_uuid = urlencode(user_uuid) + user_uuid = datadog::urlencode(user_uuid) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1685,7 +1701,7 @@ impl TeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1717,23 +1733,23 @@ impl TeamsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1742,13 +1758,13 @@ impl TeamsAPI { pub async fn list_teams( &self, params: ListTeamsOptionalParams, - ) -> Result> { + ) -> Result> { match self.list_teams_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1760,7 +1776,8 @@ impl TeamsAPI { pub fn list_teams_with_pagination( &self, mut params: ListTeamsOptionalParams, - ) -> impl Stream>> + '_ { + ) -> impl Stream>> + '_ + { try_stream! { let mut page_size: i64 = 10; if params.page_size.is_none() { @@ -1794,8 +1811,10 @@ impl TeamsAPI { pub async fn list_teams_with_http_info( &self, params: ListTeamsOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.list_teams"; @@ -1871,7 +1890,7 @@ impl TeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1902,22 +1921,22 @@ impl TeamsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1927,13 +1946,13 @@ impl TeamsAPI { &self, team_id: String, body: crate::datadogV2::model::TeamUpdateRequest, - ) -> Result> { + ) -> Result> { match self.update_team_with_http_info(team_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1948,8 +1967,10 @@ impl TeamsAPI { &self, team_id: String, body: crate::datadogV2::model::TeamUpdateRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.update_team"; @@ -1958,7 +1979,7 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}", local_configuration.get_operation_host(operation_id), - team_id = urlencode(team_id) + team_id = datadog::urlencode(team_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -1975,7 +1996,7 @@ impl TeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1998,7 +2019,7 @@ impl TeamsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -2009,7 +2030,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -2019,7 +2040,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -2029,7 +2050,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -2051,22 +2072,22 @@ impl TeamsAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2076,7 +2097,8 @@ impl TeamsAPI { team_id: String, link_id: String, body: crate::datadogV2::model::TeamLinkCreateRequest, - ) -> Result> { + ) -> Result> + { match self .update_team_link_with_http_info(team_id, link_id, body) .await @@ -2085,7 +2107,7 @@ impl TeamsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2101,8 +2123,8 @@ impl TeamsAPI { link_id: String, body: crate::datadogV2::model::TeamLinkCreateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_team_link"; @@ -2112,8 +2134,8 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/links/{link_id}", local_configuration.get_operation_host(operation_id), - team_id = urlencode(team_id), - link_id = urlencode(link_id) + team_id = datadog::urlencode(team_id), + link_id = datadog::urlencode(link_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -2130,7 +2152,7 @@ impl TeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2153,7 +2175,7 @@ impl TeamsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -2164,7 +2186,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -2174,7 +2196,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -2184,7 +2206,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -2207,23 +2229,23 @@ impl TeamsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2233,7 +2255,8 @@ impl TeamsAPI { team_id: String, user_id: String, body: crate::datadogV2::model::UserTeamUpdateRequest, - ) -> Result> { + ) -> Result> + { match self .update_team_membership_with_http_info(team_id, user_id, body) .await @@ -2242,7 +2265,7 @@ impl TeamsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2258,8 +2281,8 @@ impl TeamsAPI { user_id: String, body: crate::datadogV2::model::UserTeamUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_team_membership"; @@ -2269,8 +2292,8 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/memberships/{user_id}", local_configuration.get_operation_host(operation_id), - team_id = urlencode(team_id), - user_id = urlencode(user_id) + team_id = datadog::urlencode(team_id), + user_id = datadog::urlencode(user_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -2287,7 +2310,7 @@ impl TeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2310,7 +2333,7 @@ impl TeamsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -2321,7 +2344,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -2331,7 +2354,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -2341,7 +2364,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -2364,23 +2387,23 @@ impl TeamsAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -2392,7 +2415,7 @@ impl TeamsAPI { body: crate::datadogV2::model::TeamPermissionSettingUpdateRequest, ) -> Result< crate::datadogV2::model::TeamPermissionSettingResponse, - Error, + datadog::Error, > { match self .update_team_permission_setting_with_http_info(team_id, action, body) @@ -2402,7 +2425,7 @@ impl TeamsAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -2418,8 +2441,8 @@ impl TeamsAPI { action: String, body: crate::datadogV2::model::TeamPermissionSettingUpdateRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.update_team_permission_setting"; @@ -2429,8 +2452,8 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/permission-settings/{action}", local_configuration.get_operation_host(operation_id), - team_id = urlencode(team_id), - action = urlencode(action) + team_id = datadog::urlencode(team_id), + action = datadog::urlencode(action) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -2447,7 +2470,7 @@ impl TeamsAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -2470,7 +2493,7 @@ impl TeamsAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -2481,7 +2504,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -2491,7 +2514,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -2501,7 +2524,7 @@ impl TeamsAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -2525,23 +2548,23 @@ impl TeamsAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_usage_metering.rs b/src/datadogV2/api/api_usage_metering.rs index 95f8966a0..aba7d83ff 100644 --- a/src/datadogV2/api/api_usage_metering.rs +++ b/src/datadogV2/api/api_usage_metering.rs @@ -1,9 +1,8 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use log::warn; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; @@ -363,13 +362,13 @@ pub enum GetUsageObservabilityPipelinesError { #[derive(Debug, Clone)] pub struct UsageMeteringAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for UsageMeteringAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -377,7 +376,7 @@ impl UsageMeteringAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -419,7 +418,7 @@ impl UsageMeteringAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -430,14 +429,14 @@ impl UsageMeteringAPI { &self, ) -> Result< crate::datadogV2::model::ActiveBillingDimensionsResponse, - Error, + datadog::Error, > { match self.get_active_billing_dimensions_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -450,18 +449,18 @@ impl UsageMeteringAPI { pub async fn get_active_billing_dimensions_with_http_info( &self, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_active_billing_dimensions"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.get_active_billing_dimensions' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } let local_client = &self.client; @@ -487,7 +486,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -520,23 +519,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -549,7 +548,7 @@ impl UsageMeteringAPI { &self, start_month: String, params: GetCostByOrgOptionalParams, - ) -> Result> { + ) -> Result> { match self .get_cost_by_org_with_http_info(start_month, params) .await @@ -558,7 +557,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -576,8 +575,10 @@ impl UsageMeteringAPI { &self, start_month: String, params: GetCostByOrgOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.get_cost_by_org"; @@ -613,7 +614,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -645,22 +646,22 @@ impl UsageMeteringAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -671,13 +672,16 @@ impl UsageMeteringAPI { pub async fn get_estimated_cost_by_org( &self, params: GetEstimatedCostByOrgOptionalParams, - ) -> Result> { + ) -> Result< + crate::datadogV2::model::CostByOrgResponse, + datadog::Error, + > { match self.get_estimated_cost_by_org_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -694,8 +698,8 @@ impl UsageMeteringAPI { &self, params: GetEstimatedCostByOrgOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_estimated_cost_by_org"; @@ -751,7 +755,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -783,23 +787,23 @@ impl UsageMeteringAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -809,8 +813,10 @@ impl UsageMeteringAPI { &self, start_month: String, params: GetHistoricalCostByOrgOptionalParams, - ) -> Result> - { + ) -> Result< + crate::datadogV2::model::CostByOrgResponse, + datadog::Error, + > { match self .get_historical_cost_by_org_with_http_info(start_month, params) .await @@ -819,7 +825,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -835,8 +841,8 @@ impl UsageMeteringAPI { start_month: String, params: GetHistoricalCostByOrgOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_historical_cost_by_org"; @@ -878,7 +884,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -910,23 +916,23 @@ impl UsageMeteringAPI { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -936,7 +942,8 @@ impl UsageMeteringAPI { filter_timestamp_start: String, filter_product_families: String, params: GetHourlyUsageOptionalParams, - ) -> Result> { + ) -> Result> + { match self .get_hourly_usage_with_http_info( filter_timestamp_start, @@ -949,7 +956,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -965,8 +972,8 @@ impl UsageMeteringAPI { filter_product_families: String, params: GetHourlyUsageOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_hourly_usage"; @@ -1037,7 +1044,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1070,23 +1077,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1112,7 +1119,7 @@ impl UsageMeteringAPI { params: GetMonthlyCostAttributionOptionalParams, ) -> Result< crate::datadogV2::model::MonthlyCostAttributionResponse, - Error, + datadog::Error, > { match self .get_monthly_cost_attribution_with_http_info(start_month, end_month, fields, params) @@ -1122,7 +1129,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1152,18 +1159,18 @@ impl UsageMeteringAPI { fields: String, params: GetMonthlyCostAttributionOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_monthly_cost_attribution"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { - let local_error = UnstableOperationDisabledError { + let local_error = datadog::UnstableOperationDisabledError { msg: "Operation 'v2.get_monthly_cost_attribution' is not enabled".to_string(), }; - return Err(Error::UnstableOperationDisabledError(local_error)); + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } // unbox and build optional parameters @@ -1220,7 +1227,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1253,23 +1260,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1279,13 +1286,14 @@ impl UsageMeteringAPI { pub async fn get_projected_cost( &self, params: GetProjectedCostOptionalParams, - ) -> Result> { + ) -> Result> + { match self.get_projected_cost_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1301,8 +1309,8 @@ impl UsageMeteringAPI { &self, params: GetProjectedCostOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_projected_cost"; @@ -1338,7 +1346,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1371,23 +1379,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1399,7 +1407,7 @@ impl UsageMeteringAPI { params: GetUsageApplicationSecurityMonitoringOptionalParams, ) -> Result< crate::datadogV2::model::UsageApplicationSecurityMonitoringResponse, - Error, + datadog::Error, > { match self .get_usage_application_security_monitoring_with_http_info(start_hr, params) @@ -1409,7 +1417,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1425,8 +1433,10 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageApplicationSecurityMonitoringOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent< + crate::datadogV2::model::UsageApplicationSecurityMonitoringResponse, + >, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_usage_application_security_monitoring"; @@ -1463,7 +1473,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1497,23 +1507,23 @@ impl UsageMeteringAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1525,7 +1535,7 @@ impl UsageMeteringAPI { params: GetUsageLambdaTracedInvocationsOptionalParams, ) -> Result< crate::datadogV2::model::UsageLambdaTracedInvocationsResponse, - Error, + datadog::Error, > { match self .get_usage_lambda_traced_invocations_with_http_info(start_hr, params) @@ -1535,7 +1545,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1551,8 +1561,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageLambdaTracedInvocationsOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_usage_lambda_traced_invocations"; @@ -1589,7 +1599,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1623,23 +1633,23 @@ impl UsageMeteringAPI { >(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1651,7 +1661,7 @@ impl UsageMeteringAPI { params: GetUsageObservabilityPipelinesOptionalParams, ) -> Result< crate::datadogV2::model::UsageObservabilityPipelinesResponse, - Error, + datadog::Error, > { match self .get_usage_observability_pipelines_with_http_info(start_hr, params) @@ -1661,7 +1671,7 @@ impl UsageMeteringAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1677,8 +1687,8 @@ impl UsageMeteringAPI { start_hr: String, params: GetUsageObservabilityPipelinesOptionalParams, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_usage_observability_pipelines"; @@ -1715,7 +1725,7 @@ impl UsageMeteringAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1748,23 +1758,23 @@ impl UsageMeteringAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/api/api_users.rs b/src/datadogV2/api/api_users.rs index 024c6c66f..bb09bb4b3 100644 --- a/src/datadogV2/api/api_users.rs +++ b/src/datadogV2/api/api_users.rs @@ -1,14 +1,13 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. -use crate::datadog::*; +use crate::datadog; use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; use futures_core::stream::Stream; -use reqwest; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; @@ -168,13 +167,13 @@ pub enum UpdateUserError { #[derive(Debug, Clone)] pub struct UsersAPI { - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } impl Default for UsersAPI { fn default() -> Self { - Self::with_config(configuration::Configuration::default()) + Self::with_config(datadog::Configuration::default()) } } @@ -182,7 +181,7 @@ impl UsersAPI { pub fn new() -> Self { Self::default() } - pub fn with_config(config: configuration::Configuration) -> Self { + pub fn with_config(config: datadog::Configuration) -> Self { let mut reqwest_client_builder = reqwest::Client::builder(); if let Some(proxy_url) = &config.proxy_url { @@ -224,7 +223,7 @@ impl UsersAPI { } pub fn with_client_and_config( - config: configuration::Configuration, + config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, ) -> Self { Self { config, client } @@ -234,13 +233,13 @@ impl UsersAPI { pub async fn create_user( &self, body: crate::datadogV2::model::UserCreateRequest, - ) -> Result> { + ) -> Result> { match self.create_user_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -253,8 +252,10 @@ impl UsersAPI { pub async fn create_user_with_http_info( &self, body: crate::datadogV2::model::UserCreateRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.create_user"; @@ -279,7 +280,7 @@ impl UsersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -302,7 +303,7 @@ impl UsersAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -313,7 +314,7 @@ impl UsersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -323,7 +324,7 @@ impl UsersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -333,7 +334,7 @@ impl UsersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -355,28 +356,31 @@ impl UsersAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } /// Disable a user. Can only be used with an application key belonging /// to an administrator user. - pub async fn disable_user(&self, user_id: String) -> Result<(), Error> { + pub async fn disable_user( + &self, + user_id: String, + ) -> Result<(), datadog::Error> { match self.disable_user_with_http_info(user_id).await { Ok(_) => Ok(()), Err(err) => Err(err), @@ -388,7 +392,7 @@ impl UsersAPI { pub async fn disable_user_with_http_info( &self, user_id: String, - ) -> Result, Error> { + ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.disable_user"; @@ -397,7 +401,7 @@ impl UsersAPI { let local_uri_str = format!( "{}/api/v2/users/{user_id}", local_configuration.get_operation_host(operation_id), - user_id = urlencode(user_id) + user_id = datadog::urlencode(user_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -413,7 +417,7 @@ impl UsersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -442,19 +446,19 @@ impl UsersAPI { let local_content = local_resp.text().await?; if !local_status.is_client_error() && !local_status.is_server_error() { - Ok(ResponseContent { + Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: None, }) } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -462,7 +466,8 @@ impl UsersAPI { pub async fn get_invitation( &self, user_invitation_uuid: String, - ) -> Result> { + ) -> Result> + { match self .get_invitation_with_http_info(user_invitation_uuid) .await @@ -471,7 +476,7 @@ impl UsersAPI { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -485,8 +490,8 @@ impl UsersAPI { &self, user_invitation_uuid: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.get_invitation"; @@ -496,7 +501,7 @@ impl UsersAPI { let local_uri_str = format!( "{}/api/v2/user_invitations/{user_invitation_uuid}", local_configuration.get_operation_host(operation_id), - user_invitation_uuid = urlencode(user_invitation_uuid) + user_invitation_uuid = datadog::urlencode(user_invitation_uuid) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -512,7 +517,7 @@ impl UsersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -545,23 +550,23 @@ impl UsersAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -569,13 +574,13 @@ impl UsersAPI { pub async fn get_user( &self, user_id: String, - ) -> Result> { + ) -> Result> { match self.get_user_with_http_info(user_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -588,7 +593,10 @@ impl UsersAPI { pub async fn get_user_with_http_info( &self, user_id: String, - ) -> Result, Error> { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.get_user"; @@ -597,7 +605,7 @@ impl UsersAPI { let local_uri_str = format!( "{}/api/v2/users/{user_id}", local_configuration.get_operation_host(operation_id), - user_id = urlencode(user_id) + user_id = datadog::urlencode(user_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -613,7 +621,7 @@ impl UsersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -644,22 +652,22 @@ impl UsersAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -668,13 +676,14 @@ impl UsersAPI { pub async fn list_user_organizations( &self, user_id: String, - ) -> Result> { + ) -> Result> + { match self.list_user_organizations_with_http_info(user_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -689,8 +698,8 @@ impl UsersAPI { &self, user_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_user_organizations"; @@ -700,7 +709,7 @@ impl UsersAPI { let local_uri_str = format!( "{}/api/v2/users/{user_id}/orgs", local_configuration.get_operation_host(operation_id), - user_id = urlencode(user_id) + user_id = datadog::urlencode(user_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -716,7 +725,7 @@ impl UsersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -747,23 +756,23 @@ impl UsersAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -772,13 +781,16 @@ impl UsersAPI { pub async fn list_user_permissions( &self, user_id: String, - ) -> Result> { + ) -> Result< + crate::datadogV2::model::PermissionsResponse, + datadog::Error, + > { match self.list_user_permissions_with_http_info(user_id).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -793,8 +805,8 @@ impl UsersAPI { &self, user_id: String, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.list_user_permissions"; @@ -804,7 +816,7 @@ impl UsersAPI { let local_uri_str = format!( "{}/api/v2/users/{user_id}/permissions", local_configuration.get_operation_host(operation_id), - user_id = urlencode(user_id) + user_id = datadog::urlencode(user_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -820,7 +832,7 @@ impl UsersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -853,23 +865,23 @@ impl UsersAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -878,13 +890,13 @@ impl UsersAPI { pub async fn list_users( &self, params: ListUsersOptionalParams, - ) -> Result> { + ) -> Result> { match self.list_users_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -896,7 +908,8 @@ impl UsersAPI { pub fn list_users_with_pagination( &self, mut params: ListUsersOptionalParams, - ) -> impl Stream>> + '_ { + ) -> impl Stream>> + '_ + { try_stream! { let mut page_size: i64 = 10; if params.page_size.is_none() { @@ -930,8 +943,10 @@ impl UsersAPI { pub async fn list_users_with_http_info( &self, params: ListUsersOptionalParams, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.list_users"; @@ -988,7 +1003,7 @@ impl UsersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1019,22 +1034,22 @@ impl UsersAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1042,13 +1057,16 @@ impl UsersAPI { pub async fn send_invitations( &self, body: crate::datadogV2::model::UserInvitationsRequest, - ) -> Result> { + ) -> Result< + crate::datadogV2::model::UserInvitationsResponse, + datadog::Error, + > { match self.send_invitations_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1062,8 +1080,8 @@ impl UsersAPI { &self, body: crate::datadogV2::model::UserInvitationsRequest, ) -> Result< - ResponseContent, - Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; let operation_id = "v2.send_invitations"; @@ -1089,7 +1107,7 @@ impl UsersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1112,7 +1130,7 @@ impl UsersAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1123,7 +1141,7 @@ impl UsersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1133,7 +1151,7 @@ impl UsersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1143,7 +1161,7 @@ impl UsersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1167,23 +1185,23 @@ impl UsersAPI { &local_content, ) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } @@ -1193,13 +1211,13 @@ impl UsersAPI { &self, user_id: String, body: crate::datadogV2::model::UserUpdateRequest, - ) -> Result> { + ) -> Result> { match self.update_user_with_http_info(user_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) } else { - Err(Error::Serde(serde::de::Error::custom( + Err(datadog::Error::Serde(serde::de::Error::custom( "response content was None", ))) } @@ -1214,8 +1232,10 @@ impl UsersAPI { &self, user_id: String, body: crate::datadogV2::model::UserUpdateRequest, - ) -> Result, Error> - { + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { let local_configuration = &self.config; let operation_id = "v2.update_user"; @@ -1224,7 +1244,7 @@ impl UsersAPI { let local_uri_str = format!( "{}/api/v2/users/{user_id}", local_configuration.get_operation_host(operation_id), - user_id = urlencode(user_id) + user_id = datadog::urlencode(user_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -1241,7 +1261,7 @@ impl UsersAPI { log::warn!("Failed to parse user agent header: {e}, falling back to default"); headers.insert( reqwest::header::USER_AGENT, - HeaderValue::from_static(configuration::DEFAULT_USER_AGENT.as_str()), + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), ) } }; @@ -1264,7 +1284,7 @@ impl UsersAPI { // build body parameters let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, DDFormatter); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); if body.serialize(&mut ser).is_ok() { if let Some(content_encoding) = headers.get("Content-Encoding") { match content_encoding.to_str().unwrap_or_default() { @@ -1275,7 +1295,7 @@ impl UsersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "deflate" => { @@ -1285,7 +1305,7 @@ impl UsersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } "zstd1" => { @@ -1295,7 +1315,7 @@ impl UsersAPI { Ok(buf) => { local_req_builder = local_req_builder.body(buf); } - Err(e) => return Err(Error::Io(e)), + Err(e) => return Err(datadog::Error::Io(e)), } } _ => { @@ -1317,22 +1337,22 @@ impl UsersAPI { if !local_status.is_client_error() && !local_status.is_server_error() { match serde_json::from_str::(&local_content) { Ok(e) => { - return Ok(ResponseContent { + return Ok(datadog::ResponseContent { status: local_status, content: local_content, entity: Some(e), }) } - Err(e) => return Err(crate::datadog::Error::Serde(e)), + Err(e) => return Err(datadog::Error::Serde(e)), }; } else { let local_entity: Option = serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { + let local_error = datadog::ResponseContent { status: local_status, content: local_content, entity: local_entity, }; - Err(Error::ResponseError(local_error)) + Err(datadog::Error::ResponseError(local_error)) } } } diff --git a/src/datadogV2/mod.rs b/src/datadogV2/mod.rs index f0d16bd38..695cbb35f 100644 --- a/src/datadogV2/mod.rs +++ b/src/datadogV2/mod.rs @@ -3,4 +3,53 @@ // Copyright 2019-Present Datadog, Inc. pub mod api; +pub use self::api::api_api_management; +pub use self::api::api_apm_retention_filters; +pub use self::api::api_audit; +pub use self::api::api_authn_mappings; +pub use self::api::api_case_management; +pub use self::api::api_ci_visibility_pipelines; +pub use self::api::api_ci_visibility_tests; +pub use self::api::api_cloud_cost_management; +pub use self::api::api_cloud_workload_security; +pub use self::api::api_cloudflare_integration; +pub use self::api::api_confluent_cloud; +pub use self::api::api_container_images; +pub use self::api::api_containers; +pub use self::api::api_dashboard_lists; +pub use self::api::api_dora_metrics; +pub use self::api::api_downtimes; +pub use self::api::api_events; +pub use self::api::api_fastly_integration; +pub use self::api::api_gcp_integration; +pub use self::api::api_incident_services; +pub use self::api::api_incident_teams; +pub use self::api::api_incidents; +pub use self::api::api_ip_allowlist; +pub use self::api::api_key_management; +pub use self::api::api_logs; +pub use self::api::api_logs_archives; +pub use self::api::api_logs_custom_destinations; +pub use self::api::api_logs_metrics; +pub use self::api::api_metrics; +pub use self::api::api_monitors; +pub use self::api::api_okta_integration; +pub use self::api::api_opsgenie_integration; +pub use self::api::api_organizations; +pub use self::api::api_powerpack; +pub use self::api::api_processes; +pub use self::api::api_restriction_policies; +pub use self::api::api_roles; +pub use self::api::api_rum; +pub use self::api::api_security_monitoring; +pub use self::api::api_sensitive_data_scanner; +pub use self::api::api_service_accounts; +pub use self::api::api_service_definition; +pub use self::api::api_service_scorecards; +pub use self::api::api_spans; +pub use self::api::api_spans_metrics; +pub use self::api::api_synthetics; +pub use self::api::api_teams; +pub use self::api::api_usage_metering; +pub use self::api::api_users; pub mod model; diff --git a/tests/scenarios/fixtures.rs b/tests/scenarios/fixtures.rs index 5616b5334..20b945a74 100644 --- a/tests/scenarios/fixtures.rs +++ b/tests/scenarios/fixtures.rs @@ -9,7 +9,7 @@ use cucumber::{ gherkin::{Feature, Rule, Scenario}, given, then, when, World, }; -use datadog_api_client::datadog::configuration::{APIKey, Configuration}; +use datadog_api_client::datadog::{APIKey, Configuration}; use lazy_static::lazy_static; use minijinja::{Environment, State}; use regex::Regex; diff --git a/tests/scenarios/function_mappings.rs b/tests/scenarios/function_mappings.rs index 394d5cf84..1053e80b2 100644 --- a/tests/scenarios/function_mappings.rs +++ b/tests/scenarios/function_mappings.rs @@ -11,93 +11,111 @@ use datadog_api_client::datadogV2; #[derive(Debug, Default)] pub struct ApiInstances { - pub v1_api_ip_ranges: Option, - pub v1_api_key_management: Option, - pub v1_api_service_checks: Option, - pub v1_api_usage_metering: Option, - pub v1_api_dashboards: Option, - pub v1_api_dashboard_lists: Option, - pub v1_api_metrics: Option, - pub v1_api_downtimes: Option, - 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_azure_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, - pub v1_api_logs: Option, - pub v1_api_logs_indexes: Option, - pub v1_api_logs_pipelines: Option, - pub v1_api_monitors: Option, - pub v1_api_notebooks: Option, - pub v1_api_organizations: Option, - pub v1_api_security_monitoring: Option, - pub v1_api_service_level_objectives: Option, - pub v1_api_service_level_objective_corrections: Option, - pub v1_api_synthetics: Option, - pub v1_api_tags: Option, - pub v1_api_users: Option, - pub v1_api_authentication: Option, - pub v2_api_key_management: Option, - pub v2_api_api_management: Option, - pub v2_api_spans_metrics: Option, - pub v2_api_apm_retention_filters: Option, - pub v2_api_audit: Option, - pub v2_api_authn_mappings: Option, - pub v2_api_case_management: 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_downtimes: Option, - pub v2_api_events: Option, - pub v2_api_incidents: 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_logs: Option, - pub v2_api_logs_archives: Option, - pub v2_api_logs_custom_destinations: Option, - pub v2_api_logs_metrics: Option, - pub v2_api_metrics: Option, - pub v2_api_monitors: Option, - pub v2_api_roles: Option, - pub v2_api_security_monitoring: Option, - pub v2_api_powerpack: Option, - pub v2_api_processes: Option, - pub v2_api_cloud_workload_security: Option, - pub v2_api_restriction_policies: Option, - pub v2_api_rum: Option, - pub v2_api_organizations: Option, - pub v2_api_service_scorecards: Option, - pub v2_api_sensitive_data_scanner: Option, - pub v2_api_service_accounts: Option, - pub v2_api_incident_services: Option, - pub v2_api_service_definition: Option, - pub v2_api_spans: Option, - pub v2_api_synthetics: Option, - pub v2_api_teams: Option, - pub v2_api_incident_teams: Option, - pub v2_api_users: 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, + pub v1_api_dashboards: Option, + pub v1_api_dashboard_lists: Option, + pub v1_api_metrics: Option, + pub v1_api_downtimes: Option, + 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_azure_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, + pub v1_api_logs: Option, + pub v1_api_logs_indexes: Option, + pub v1_api_logs_pipelines: Option, + pub v1_api_monitors: Option, + pub v1_api_notebooks: Option, + pub v1_api_organizations: Option, + pub v1_api_security_monitoring: + Option, + pub v1_api_service_level_objectives: + Option, + pub v1_api_service_level_objective_corrections: Option< + datadogV1::api_service_level_objective_corrections::ServiceLevelObjectiveCorrectionsAPI, + >, + pub v1_api_synthetics: Option, + pub v1_api_tags: Option, + pub v1_api_users: Option, + pub v1_api_authentication: Option, + pub v2_api_key_management: Option, + pub v2_api_api_management: Option, + pub v2_api_spans_metrics: Option, + pub v2_api_apm_retention_filters: + Option, + pub v2_api_audit: Option, + pub v2_api_authn_mappings: Option, + pub v2_api_case_management: 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_downtimes: Option, + pub v2_api_events: Option, + pub v2_api_incidents: 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_logs: Option, + pub v2_api_logs_archives: Option, + pub v2_api_logs_custom_destinations: + Option, + pub v2_api_logs_metrics: Option, + pub v2_api_metrics: Option, + pub v2_api_monitors: Option, + pub v2_api_roles: Option, + pub v2_api_security_monitoring: + Option, + pub v2_api_powerpack: Option, + pub v2_api_processes: Option, + pub v2_api_cloud_workload_security: + Option, + pub v2_api_restriction_policies: + Option, + pub v2_api_rum: Option, + pub v2_api_organizations: Option, + pub v2_api_service_scorecards: Option, + pub v2_api_sensitive_data_scanner: + Option, + pub v2_api_service_accounts: Option, + pub v2_api_incident_services: Option, + pub v2_api_service_definition: Option, + pub v2_api_spans: Option, + pub v2_api_synthetics: Option, + pub v2_api_teams: Option, + pub v2_api_incident_teams: Option, + pub v2_api_users: Option, } pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { match api.as_str() { "IPRanges" => { world.api_instances.v1_api_ip_ranges = Some( - datadogV1::api::api_ip_ranges::IPRangesAPI::with_client_and_config( + datadogV1::api_ip_ranges::IPRangesAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -105,13 +123,13 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "KeyManagement" => { world.api_instances.v1_api_key_management = Some( - datadogV1::api::api_key_management::KeyManagementAPI::with_client_and_config( + datadogV1::api_key_management::KeyManagementAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); world.api_instances.v2_api_key_management = Some( - datadogV2::api::api_key_management::KeyManagementAPI::with_client_and_config( + datadogV2::api_key_management::KeyManagementAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -119,7 +137,7 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "ServiceChecks" => { world.api_instances.v1_api_service_checks = Some( - datadogV1::api::api_service_checks::ServiceChecksAPI::with_client_and_config( + datadogV1::api_service_checks::ServiceChecksAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -127,13 +145,13 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "UsageMetering" => { world.api_instances.v1_api_usage_metering = Some( - datadogV1::api::api_usage_metering::UsageMeteringAPI::with_client_and_config( + datadogV1::api_usage_metering::UsageMeteringAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); world.api_instances.v2_api_usage_metering = Some( - datadogV2::api::api_usage_metering::UsageMeteringAPI::with_client_and_config( + datadogV2::api_usage_metering::UsageMeteringAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -141,7 +159,7 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "Dashboards" => { world.api_instances.v1_api_dashboards = Some( - datadogV1::api::api_dashboards::DashboardsAPI::with_client_and_config( + datadogV1::api_dashboards::DashboardsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -149,63 +167,59 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "DashboardLists" => { world.api_instances.v1_api_dashboard_lists = Some( - datadogV1::api::api_dashboard_lists::DashboardListsAPI::with_client_and_config( + datadogV1::api_dashboard_lists::DashboardListsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); world.api_instances.v2_api_dashboard_lists = Some( - datadogV2::api::api_dashboard_lists::DashboardListsAPI::with_client_and_config( + datadogV2::api_dashboard_lists::DashboardListsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); } "Metrics" => { - world.api_instances.v1_api_metrics = Some( - datadogV1::api::api_metrics::MetricsAPI::with_client_and_config( + world.api_instances.v1_api_metrics = + Some(datadogV1::api_metrics::MetricsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), - ), - ); - world.api_instances.v2_api_metrics = Some( - datadogV2::api::api_metrics::MetricsAPI::with_client_and_config( + )); + world.api_instances.v2_api_metrics = + Some(datadogV2::api_metrics::MetricsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), - ), - ); + )); } "Downtimes" => { world.api_instances.v1_api_downtimes = Some( - datadogV1::api::api_downtimes::DowntimesAPI::with_client_and_config( + datadogV1::api_downtimes::DowntimesAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); world.api_instances.v2_api_downtimes = Some( - datadogV2::api::api_downtimes::DowntimesAPI::with_client_and_config( + datadogV2::api_downtimes::DowntimesAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); } "Events" => { - world.api_instances.v1_api_events = Some( - datadogV1::api::api_events::EventsAPI::with_client_and_config( + world.api_instances.v1_api_events = + Some(datadogV1::api_events::EventsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), - ), - ); - world.api_instances.v2_api_events = Some( - datadogV2::api::api_events::EventsAPI::with_client_and_config( + )); + world.api_instances.v2_api_events = + Some(datadogV2::api_events::EventsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), - ), - ); + )); } "Snapshots" => { world.api_instances.v1_api_snapshots = Some( - datadogV1::api::api_snapshots::SnapshotsAPI::with_client_and_config( + datadogV1::api_snapshots::SnapshotsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -213,28 +227,30 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "Hosts" => { world.api_instances.v1_api_hosts = - Some(datadogV1::api::api_hosts::HostsAPI::with_client_and_config( + Some(datadogV1::api_hosts::HostsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), )); } "AWSIntegration" => { world.api_instances.v1_api_aws_integration = Some( - datadogV1::api::api_aws_integration::AWSIntegrationAPI::with_client_and_config( + datadogV1::api_aws_integration::AWSIntegrationAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); } "AWSLogsIntegration" => { - world.api_instances.v1_api_aws_logs_integration = Some(datadogV1::api::api_aws_logs_integration::AWSLogsIntegrationAPI::with_client_and_config( - world.config.clone(), - world.http_client.as_ref().unwrap().clone() - )); + world.api_instances.v1_api_aws_logs_integration = Some( + datadogV1::api_aws_logs_integration::AWSLogsIntegrationAPI::with_client_and_config( + world.config.clone(), + world.http_client.as_ref().unwrap().clone(), + ), + ); } "AzureIntegration" => { world.api_instances.v1_api_azure_integration = Some( - datadogV1::api::api_azure_integration::AzureIntegrationAPI::with_client_and_config( + datadogV1::api_azure_integration::AzureIntegrationAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -242,53 +258,55 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "GCPIntegration" => { world.api_instances.v1_api_gcp_integration = Some( - datadogV1::api::api_gcp_integration::GCPIntegrationAPI::with_client_and_config( + datadogV1::api_gcp_integration::GCPIntegrationAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); world.api_instances.v2_api_gcp_integration = Some( - datadogV2::api::api_gcp_integration::GCPIntegrationAPI::with_client_and_config( + datadogV2::api_gcp_integration::GCPIntegrationAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); } "PagerDutyIntegration" => { - world.api_instances.v1_api_pager_duty_integration = Some(datadogV1::api::api_pager_duty_integration::PagerDutyIntegrationAPI::with_client_and_config( + world.api_instances.v1_api_pager_duty_integration = Some(datadogV1::api_pager_duty_integration::PagerDutyIntegrationAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone() )); } "SlackIntegration" => { world.api_instances.v1_api_slack_integration = Some( - datadogV1::api::api_slack_integration::SlackIntegrationAPI::with_client_and_config( + datadogV1::api_slack_integration::SlackIntegrationAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); } "WebhooksIntegration" => { - world.api_instances.v1_api_webhooks_integration = Some(datadogV1::api::api_webhooks_integration::WebhooksIntegrationAPI::with_client_and_config( - world.config.clone(), - world.http_client.as_ref().unwrap().clone() - )); + world.api_instances.v1_api_webhooks_integration = Some( + datadogV1::api_webhooks_integration::WebhooksIntegrationAPI::with_client_and_config( + world.config.clone(), + world.http_client.as_ref().unwrap().clone(), + ), + ); } "Logs" => { world.api_instances.v1_api_logs = - Some(datadogV1::api::api_logs::LogsAPI::with_client_and_config( + Some(datadogV1::api_logs::LogsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), )); world.api_instances.v2_api_logs = - Some(datadogV2::api::api_logs::LogsAPI::with_client_and_config( + Some(datadogV2::api_logs::LogsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), )); } "LogsIndexes" => { world.api_instances.v1_api_logs_indexes = Some( - datadogV1::api::api_logs_indexes::LogsIndexesAPI::with_client_and_config( + datadogV1::api_logs_indexes::LogsIndexesAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -296,7 +314,7 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "LogsPipelines" => { world.api_instances.v1_api_logs_pipelines = Some( - datadogV1::api::api_logs_pipelines::LogsPipelinesAPI::with_client_and_config( + datadogV1::api_logs_pipelines::LogsPipelinesAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -304,13 +322,13 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "Monitors" => { world.api_instances.v1_api_monitors = Some( - datadogV1::api::api_monitors::MonitorsAPI::with_client_and_config( + datadogV1::api_monitors::MonitorsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); world.api_instances.v2_api_monitors = Some( - datadogV2::api::api_monitors::MonitorsAPI::with_client_and_config( + datadogV2::api_monitors::MonitorsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -318,7 +336,7 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "Notebooks" => { world.api_instances.v1_api_notebooks = Some( - datadogV1::api::api_notebooks::NotebooksAPI::with_client_and_config( + datadogV1::api_notebooks::NotebooksAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -326,49 +344,53 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "Organizations" => { world.api_instances.v1_api_organizations = Some( - datadogV1::api::api_organizations::OrganizationsAPI::with_client_and_config( + datadogV1::api_organizations::OrganizationsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); world.api_instances.v2_api_organizations = Some( - datadogV2::api::api_organizations::OrganizationsAPI::with_client_and_config( + datadogV2::api_organizations::OrganizationsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); } "SecurityMonitoring" => { - world.api_instances.v1_api_security_monitoring = Some(datadogV1::api::api_security_monitoring::SecurityMonitoringAPI::with_client_and_config( - world.config.clone(), - world.http_client.as_ref().unwrap().clone() - )); - world.api_instances.v2_api_security_monitoring = Some(datadogV2::api::api_security_monitoring::SecurityMonitoringAPI::with_client_and_config( - world.config.clone(), - world.http_client.as_ref().unwrap().clone() - )); + world.api_instances.v1_api_security_monitoring = Some( + datadogV1::api_security_monitoring::SecurityMonitoringAPI::with_client_and_config( + world.config.clone(), + world.http_client.as_ref().unwrap().clone(), + ), + ); + world.api_instances.v2_api_security_monitoring = Some( + datadogV2::api_security_monitoring::SecurityMonitoringAPI::with_client_and_config( + world.config.clone(), + world.http_client.as_ref().unwrap().clone(), + ), + ); } "ServiceLevelObjectives" => { - world.api_instances.v1_api_service_level_objectives = Some(datadogV1::api::api_service_level_objectives::ServiceLevelObjectivesAPI::with_client_and_config( + world.api_instances.v1_api_service_level_objectives = Some(datadogV1::api_service_level_objectives::ServiceLevelObjectivesAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone() )); } "ServiceLevelObjectiveCorrections" => { - world.api_instances.v1_api_service_level_objective_corrections = Some(datadogV1::api::api_service_level_objective_corrections::ServiceLevelObjectiveCorrectionsAPI::with_client_and_config( + world.api_instances.v1_api_service_level_objective_corrections = Some(datadogV1::api_service_level_objective_corrections::ServiceLevelObjectiveCorrectionsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone() )); } "Synthetics" => { world.api_instances.v1_api_synthetics = Some( - datadogV1::api::api_synthetics::SyntheticsAPI::with_client_and_config( + datadogV1::api_synthetics::SyntheticsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); world.api_instances.v2_api_synthetics = Some( - datadogV2::api::api_synthetics::SyntheticsAPI::with_client_and_config( + datadogV2::api_synthetics::SyntheticsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -376,26 +398,26 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "Tags" => { world.api_instances.v1_api_tags = - Some(datadogV1::api::api_tags::TagsAPI::with_client_and_config( + Some(datadogV1::api_tags::TagsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), )); } "Users" => { world.api_instances.v1_api_users = - Some(datadogV1::api::api_users::UsersAPI::with_client_and_config( + Some(datadogV1::api_users::UsersAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), )); world.api_instances.v2_api_users = - Some(datadogV2::api::api_users::UsersAPI::with_client_and_config( + Some(datadogV2::api_users::UsersAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), )); } "Authentication" => { world.api_instances.v1_api_authentication = Some( - datadogV1::api::api_authentication::AuthenticationAPI::with_client_and_config( + datadogV1::api_authentication::AuthenticationAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -403,7 +425,7 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "APIManagement" => { world.api_instances.v2_api_api_management = Some( - datadogV2::api::api_api_management::APIManagementAPI::with_client_and_config( + datadogV2::api_api_management::APIManagementAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -411,28 +433,28 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "SpansMetrics" => { world.api_instances.v2_api_spans_metrics = Some( - datadogV2::api::api_spans_metrics::SpansMetricsAPI::with_client_and_config( + datadogV2::api_spans_metrics::SpansMetricsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); } "APMRetentionFilters" => { - world.api_instances.v2_api_apm_retention_filters = Some(datadogV2::api::api_apm_retention_filters::APMRetentionFiltersAPI::with_client_and_config( + world.api_instances.v2_api_apm_retention_filters = Some(datadogV2::api_apm_retention_filters::APMRetentionFiltersAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone() )); } "Audit" => { world.api_instances.v2_api_audit = - Some(datadogV2::api::api_audit::AuditAPI::with_client_and_config( + Some(datadogV2::api_audit::AuditAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), )); } "AuthNMappings" => { world.api_instances.v2_api_authn_mappings = Some( - datadogV2::api::api_authn_mappings::AuthNMappingsAPI::with_client_and_config( + datadogV2::api_authn_mappings::AuthNMappingsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -440,27 +462,29 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "CaseManagement" => { world.api_instances.v2_api_case_management = Some( - datadogV2::api::api_case_management::CaseManagementAPI::with_client_and_config( + datadogV2::api_case_management::CaseManagementAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); } "CIVisibilityPipelines" => { - world.api_instances.v2_api_ci_visibility_pipelines = Some(datadogV2::api::api_ci_visibility_pipelines::CIVisibilityPipelinesAPI::with_client_and_config( + world.api_instances.v2_api_ci_visibility_pipelines = Some(datadogV2::api_ci_visibility_pipelines::CIVisibilityPipelinesAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone() )); } "CIVisibilityTests" => { - world.api_instances.v2_api_ci_visibility_tests = Some(datadogV2::api::api_ci_visibility_tests::CIVisibilityTestsAPI::with_client_and_config( - world.config.clone(), - world.http_client.as_ref().unwrap().clone() - )); + world.api_instances.v2_api_ci_visibility_tests = Some( + datadogV2::api_ci_visibility_tests::CIVisibilityTestsAPI::with_client_and_config( + world.config.clone(), + world.http_client.as_ref().unwrap().clone(), + ), + ); } "ContainerImages" => { world.api_instances.v2_api_container_images = Some( - datadogV2::api::api_container_images::ContainerImagesAPI::with_client_and_config( + datadogV2::api_container_images::ContainerImagesAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -468,21 +492,21 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "Containers" => { world.api_instances.v2_api_containers = Some( - datadogV2::api::api_containers::ContainersAPI::with_client_and_config( + datadogV2::api_containers::ContainersAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); } "CloudCostManagement" => { - world.api_instances.v2_api_cloud_cost_management = Some(datadogV2::api::api_cloud_cost_management::CloudCostManagementAPI::with_client_and_config( + world.api_instances.v2_api_cloud_cost_management = Some(datadogV2::api_cloud_cost_management::CloudCostManagementAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone() )); } "DORAMetrics" => { world.api_instances.v2_api_dora_metrics = Some( - datadogV2::api::api_dora_metrics::DORAMetricsAPI::with_client_and_config( + datadogV2::api_dora_metrics::DORAMetricsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -490,41 +514,45 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "Incidents" => { world.api_instances.v2_api_incidents = Some( - datadogV2::api::api_incidents::IncidentsAPI::with_client_and_config( + datadogV2::api_incidents::IncidentsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); } "OpsgenieIntegration" => { - world.api_instances.v2_api_opsgenie_integration = Some(datadogV2::api::api_opsgenie_integration::OpsgenieIntegrationAPI::with_client_and_config( - world.config.clone(), - world.http_client.as_ref().unwrap().clone() - )); + world.api_instances.v2_api_opsgenie_integration = Some( + datadogV2::api_opsgenie_integration::OpsgenieIntegrationAPI::with_client_and_config( + world.config.clone(), + world.http_client.as_ref().unwrap().clone(), + ), + ); } "CloudflareIntegration" => { - world.api_instances.v2_api_cloudflare_integration = Some(datadogV2::api::api_cloudflare_integration::CloudflareIntegrationAPI::with_client_and_config( + world.api_instances.v2_api_cloudflare_integration = Some(datadogV2::api_cloudflare_integration::CloudflareIntegrationAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone() )); } "ConfluentCloud" => { world.api_instances.v2_api_confluent_cloud = Some( - datadogV2::api::api_confluent_cloud::ConfluentCloudAPI::with_client_and_config( + datadogV2::api_confluent_cloud::ConfluentCloudAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); } "FastlyIntegration" => { - world.api_instances.v2_api_fastly_integration = Some(datadogV2::api::api_fastly_integration::FastlyIntegrationAPI::with_client_and_config( - world.config.clone(), - world.http_client.as_ref().unwrap().clone() - )); + world.api_instances.v2_api_fastly_integration = Some( + datadogV2::api_fastly_integration::FastlyIntegrationAPI::with_client_and_config( + world.config.clone(), + world.http_client.as_ref().unwrap().clone(), + ), + ); } "OktaIntegration" => { world.api_instances.v2_api_okta_integration = Some( - datadogV2::api::api_okta_integration::OktaIntegrationAPI::with_client_and_config( + datadogV2::api_okta_integration::OktaIntegrationAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -532,7 +560,7 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "IPAllowlist" => { world.api_instances.v2_api_ip_allowlist = Some( - datadogV2::api::api_ip_allowlist::IPAllowlistAPI::with_client_and_config( + datadogV2::api_ip_allowlist::IPAllowlistAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -540,21 +568,21 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "LogsArchives" => { world.api_instances.v2_api_logs_archives = Some( - datadogV2::api::api_logs_archives::LogsArchivesAPI::with_client_and_config( + datadogV2::api_logs_archives::LogsArchivesAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); } "LogsCustomDestinations" => { - world.api_instances.v2_api_logs_custom_destinations = Some(datadogV2::api::api_logs_custom_destinations::LogsCustomDestinationsAPI::with_client_and_config( + world.api_instances.v2_api_logs_custom_destinations = Some(datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone() )); } "LogsMetrics" => { world.api_instances.v2_api_logs_metrics = Some( - datadogV2::api::api_logs_metrics::LogsMetricsAPI::with_client_and_config( + datadogV2::api_logs_metrics::LogsMetricsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -562,14 +590,14 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "Roles" => { world.api_instances.v2_api_roles = - Some(datadogV2::api::api_roles::RolesAPI::with_client_and_config( + Some(datadogV2::api_roles::RolesAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), )); } "Powerpack" => { world.api_instances.v2_api_powerpack = Some( - datadogV2::api::api_powerpack::PowerpackAPI::with_client_and_config( + datadogV2::api_powerpack::PowerpackAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -577,46 +605,50 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "Processes" => { world.api_instances.v2_api_processes = Some( - datadogV2::api::api_processes::ProcessesAPI::with_client_and_config( + datadogV2::api_processes::ProcessesAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); } "CloudWorkloadSecurity" => { - world.api_instances.v2_api_cloud_workload_security = Some(datadogV2::api::api_cloud_workload_security::CloudWorkloadSecurityAPI::with_client_and_config( + world.api_instances.v2_api_cloud_workload_security = Some(datadogV2::api_cloud_workload_security::CloudWorkloadSecurityAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone() )); } "RestrictionPolicies" => { - world.api_instances.v2_api_restriction_policies = Some(datadogV2::api::api_restriction_policies::RestrictionPoliciesAPI::with_client_and_config( - world.config.clone(), - world.http_client.as_ref().unwrap().clone() - )); + world.api_instances.v2_api_restriction_policies = Some( + datadogV2::api_restriction_policies::RestrictionPoliciesAPI::with_client_and_config( + world.config.clone(), + world.http_client.as_ref().unwrap().clone(), + ), + ); } "RUM" => { world.api_instances.v2_api_rum = - Some(datadogV2::api::api_rum::RUMAPI::with_client_and_config( + Some(datadogV2::api_rum::RUMAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), )); } "ServiceScorecards" => { - world.api_instances.v2_api_service_scorecards = Some(datadogV2::api::api_service_scorecards::ServiceScorecardsAPI::with_client_and_config( - world.config.clone(), - world.http_client.as_ref().unwrap().clone() - )); + world.api_instances.v2_api_service_scorecards = Some( + datadogV2::api_service_scorecards::ServiceScorecardsAPI::with_client_and_config( + world.config.clone(), + world.http_client.as_ref().unwrap().clone(), + ), + ); } "SensitiveDataScanner" => { - world.api_instances.v2_api_sensitive_data_scanner = Some(datadogV2::api::api_sensitive_data_scanner::SensitiveDataScannerAPI::with_client_and_config( + world.api_instances.v2_api_sensitive_data_scanner = Some(datadogV2::api_sensitive_data_scanner::SensitiveDataScannerAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone() )); } "ServiceAccounts" => { world.api_instances.v2_api_service_accounts = Some( - datadogV2::api::api_service_accounts::ServiceAccountsAPI::with_client_and_config( + datadogV2::api_service_accounts::ServiceAccountsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -624,35 +656,37 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { } "IncidentServices" => { world.api_instances.v2_api_incident_services = Some( - datadogV2::api::api_incident_services::IncidentServicesAPI::with_client_and_config( + datadogV2::api_incident_services::IncidentServicesAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), ); } "ServiceDefinition" => { - world.api_instances.v2_api_service_definition = Some(datadogV2::api::api_service_definition::ServiceDefinitionAPI::with_client_and_config( - world.config.clone(), - world.http_client.as_ref().unwrap().clone() - )); + world.api_instances.v2_api_service_definition = Some( + datadogV2::api_service_definition::ServiceDefinitionAPI::with_client_and_config( + world.config.clone(), + world.http_client.as_ref().unwrap().clone(), + ), + ); } "Spans" => { world.api_instances.v2_api_spans = - Some(datadogV2::api::api_spans::SpansAPI::with_client_and_config( + Some(datadogV2::api_spans::SpansAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), )); } "Teams" => { world.api_instances.v2_api_teams = - Some(datadogV2::api::api_teams::TeamsAPI::with_client_and_config( + Some(datadogV2::api_teams::TeamsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), )); } "IncidentTeams" => { world.api_instances.v2_api_incident_teams = Some( - datadogV2::api::api_incident_teams::IncidentTeamsAPI::with_client_and_config( + datadogV2::api_incident_teams::IncidentTeamsAPI::with_client_and_config( world.config.clone(), world.http_client.as_ref().unwrap().clone(), ), @@ -3100,8 +3134,7 @@ fn test_v1_get_daily_custom_reports( let sort = _parameters .get("sort") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV1::api::api_usage_metering::GetDailyCustomReportsOptionalParams::default(); + let mut params = datadogV1::api_usage_metering::GetDailyCustomReportsOptionalParams::default(); params.page_size = page_size; params.page_number = page_number; params.sort_dir = sort_dir; @@ -3175,7 +3208,7 @@ fn test_v1_get_monthly_custom_reports( .get("sort") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV1::api::api_usage_metering::GetMonthlyCustomReportsOptionalParams::default(); + datadogV1::api_usage_metering::GetMonthlyCustomReportsOptionalParams::default(); params.page_size = page_size; params.page_number = page_number; params.sort_dir = sort_dir; @@ -3237,8 +3270,7 @@ fn test_v1_get_usage_analyzed_logs(world: &mut DatadogWorld, _parameters: &HashM let end_hr = _parameters .get("end_hr") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV1::api::api_usage_metering::GetUsageAnalyzedLogsOptionalParams::default(); + let mut params = datadogV1::api_usage_metering::GetUsageAnalyzedLogsOptionalParams::default(); params.end_hr = end_hr; let response = match block_on(api.get_usage_analyzed_logs_with_http_info(start_hr, params)) { Ok(response) => response, @@ -3268,7 +3300,7 @@ fn test_v1_get_usage_audit_logs(world: &mut DatadogWorld, _parameters: &HashMap< let end_hr = _parameters .get("end_hr") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = datadogV1::api::api_usage_metering::GetUsageAuditLogsOptionalParams::default(); + let mut params = datadogV1::api_usage_metering::GetUsageAuditLogsOptionalParams::default(); params.end_hr = end_hr; let response = match block_on(api.get_usage_audit_logs_with_http_info(start_hr, params)) { Ok(response) => response, @@ -3298,7 +3330,7 @@ fn test_v1_get_usage_lambda(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -3331,7 +3363,7 @@ fn test_v1_get_usage_billable_summary( .get("month") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV1::api::api_usage_metering::GetUsageBillableSummaryOptionalParams::default(); + datadogV1::api_usage_metering::GetUsageBillableSummaryOptionalParams::default(); params.month = month; let response = match block_on(api.get_usage_billable_summary_with_http_info(params)) { Ok(response) => response, @@ -3361,7 +3393,7 @@ fn test_v1_get_usage_ci_app(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -3394,7 +3426,7 @@ fn test_v1_get_usage_cloud_security_posture_management( let end_hr = _parameters .get("end_hr") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = datadogV1::api::api_usage_metering::GetUsageCloudSecurityPostureManagementOptionalParams::default(); + let mut params = datadogV1::api_usage_metering::GetUsageCloudSecurityPostureManagementOptionalParams::default(); params.end_hr = end_hr; let response = match block_on( api.get_usage_cloud_security_posture_management_with_http_info(start_hr, params), @@ -3426,7 +3458,7 @@ fn test_v1_get_usage_cws(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -3456,7 +3488,7 @@ fn test_v1_get_usage_dbm(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -3486,7 +3518,7 @@ fn test_v1_get_usage_fargate(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -3516,7 +3548,7 @@ fn test_v1_get_usage_hosts(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -3561,7 +3593,7 @@ fn test_v1_get_hourly_usage_attribution( .get("include_descendants") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV1::api::api_usage_metering::GetHourlyUsageAttributionOptionalParams::default(); + datadogV1::api_usage_metering::GetHourlyUsageAttributionOptionalParams::default(); params.end_hr = end_hr; params.next_record_id = next_record_id; params.tag_breakdown_keys = tag_breakdown_keys; @@ -3596,8 +3628,7 @@ fn test_v1_get_incident_management(world: &mut DatadogWorld, _parameters: &HashM let end_hr = _parameters .get("end_hr") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV1::api::api_usage_metering::GetIncidentManagementOptionalParams::default(); + let mut params = datadogV1::api_usage_metering::GetIncidentManagementOptionalParams::default(); params.end_hr = end_hr; let response = match block_on(api.get_incident_management_with_http_info(start_hr, params)) { Ok(response) => response, @@ -3627,8 +3658,7 @@ fn test_v1_get_usage_indexed_spans(world: &mut DatadogWorld, _parameters: &HashM let end_hr = _parameters .get("end_hr") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV1::api::api_usage_metering::GetUsageIndexedSpansOptionalParams::default(); + let mut params = datadogV1::api_usage_metering::GetUsageIndexedSpansOptionalParams::default(); params.end_hr = end_hr; let response = match block_on(api.get_usage_indexed_spans_with_http_info(start_hr, params)) { Ok(response) => response, @@ -3658,7 +3688,7 @@ fn test_v1_get_ingested_spans(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -3692,7 +3722,7 @@ fn test_v1_get_usage_internet_of_things( .get("end_hr") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV1::api::api_usage_metering::GetUsageInternetOfThingsOptionalParams::default(); + datadogV1::api_usage_metering::GetUsageInternetOfThingsOptionalParams::default(); params.end_hr = end_hr; let response = match block_on(api.get_usage_internet_of_things_with_http_info(start_hr, params)) { @@ -3723,7 +3753,7 @@ fn test_v1_get_usage_logs(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -3757,7 +3787,7 @@ fn test_v1_get_usage_logs_by_retention( .get("end_hr") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV1::api::api_usage_metering::GetUsageLogsByRetentionOptionalParams::default(); + datadogV1::api_usage_metering::GetUsageLogsByRetentionOptionalParams::default(); params.end_hr = end_hr; let response = match block_on(api.get_usage_logs_by_retention_with_http_info(start_hr, params)) { @@ -3791,8 +3821,7 @@ fn test_v1_get_usage_logs_by_index(world: &mut DatadogWorld, _parameters: &HashM let index_name = _parameters .get("index_name") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV1::api::api_usage_metering::GetUsageLogsByIndexOptionalParams::default(); + let mut params = datadogV1::api_usage_metering::GetUsageLogsByIndexOptionalParams::default(); params.end_hr = end_hr; params.index_name = index_name; let response = match block_on(api.get_usage_logs_by_index_with_http_info(start_hr, params)) { @@ -3844,7 +3873,7 @@ fn test_v1_get_monthly_usage_attribution( .get("include_descendants") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV1::api::api_usage_metering::GetMonthlyUsageAttributionOptionalParams::default(); + datadogV1::api_usage_metering::GetMonthlyUsageAttributionOptionalParams::default(); params.end_month = end_month; params.sort_direction = sort_direction; params.sort_name = sort_name; @@ -3883,8 +3912,7 @@ fn test_v1_get_usage_network_flows(world: &mut DatadogWorld, _parameters: &HashM let end_hr = _parameters .get("end_hr") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV1::api::api_usage_metering::GetUsageNetworkFlowsOptionalParams::default(); + let mut params = datadogV1::api_usage_metering::GetUsageNetworkFlowsOptionalParams::default(); params.end_hr = end_hr; let response = match block_on(api.get_usage_network_flows_with_http_info(start_hr, params)) { Ok(response) => response, @@ -3914,8 +3942,7 @@ fn test_v1_get_usage_network_hosts(world: &mut DatadogWorld, _parameters: &HashM let end_hr = _parameters .get("end_hr") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV1::api::api_usage_metering::GetUsageNetworkHostsOptionalParams::default(); + let mut params = datadogV1::api_usage_metering::GetUsageNetworkHostsOptionalParams::default(); params.end_hr = end_hr; let response = match block_on(api.get_usage_network_hosts_with_http_info(start_hr, params)) { Ok(response) => response, @@ -3948,8 +3975,7 @@ fn test_v1_get_usage_online_archive( let end_hr = _parameters .get("end_hr") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV1::api::api_usage_metering::GetUsageOnlineArchiveOptionalParams::default(); + let mut params = datadogV1::api_usage_metering::GetUsageOnlineArchiveOptionalParams::default(); params.end_hr = end_hr; let response = match block_on(api.get_usage_online_archive_with_http_info(start_hr, params)) { Ok(response) => response, @@ -3979,7 +4005,7 @@ fn test_v1_get_usage_profiling(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -4009,7 +4035,7 @@ fn test_v1_get_usage_rum_units(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -4042,8 +4068,7 @@ fn test_v1_get_usage_rum_sessions(world: &mut DatadogWorld, _parameters: &HashMa let type_ = _parameters .get("type") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV1::api::api_usage_metering::GetUsageRumSessionsOptionalParams::default(); + let mut params = datadogV1::api_usage_metering::GetUsageRumSessionsOptionalParams::default(); params.end_hr = end_hr; params.type_ = type_; let response = match block_on(api.get_usage_rum_sessions_with_http_info(start_hr, params)) { @@ -4074,7 +4099,7 @@ fn test_v1_get_usage_sds(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -4104,7 +4129,7 @@ fn test_v1_get_usage_snmp(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -4138,7 +4163,7 @@ fn test_v1_get_usage_summary(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -4203,8 +4227,7 @@ fn test_v1_get_usage_synthetics_api( let end_hr = _parameters .get("end_hr") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV1::api::api_usage_metering::GetUsageSyntheticsAPIOptionalParams::default(); + let mut params = datadogV1::api_usage_metering::GetUsageSyntheticsAPIOptionalParams::default(); params.end_hr = end_hr; let response = match block_on(api.get_usage_synthetics_api_with_http_info(start_hr, params)) { Ok(response) => response, @@ -4238,7 +4261,7 @@ fn test_v1_get_usage_synthetics_browser( .get("end_hr") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV1::api::api_usage_metering::GetUsageSyntheticsBrowserOptionalParams::default(); + datadogV1::api_usage_metering::GetUsageSyntheticsBrowserOptionalParams::default(); params.end_hr = end_hr; let response = match block_on(api.get_usage_synthetics_browser_with_http_info(start_hr, params)) { @@ -4269,8 +4292,7 @@ fn test_v1_get_usage_timeseries(world: &mut DatadogWorld, _parameters: &HashMap< let end_hr = _parameters .get("end_hr") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV1::api::api_usage_metering::GetUsageTimeseriesOptionalParams::default(); + let mut params = datadogV1::api_usage_metering::GetUsageTimeseriesOptionalParams::default(); params.end_hr = end_hr; let response = match block_on(api.get_usage_timeseries_with_http_info(start_hr, params)) { Ok(response) => response, @@ -4314,8 +4336,7 @@ fn test_v1_get_usage_top_avg_metrics( let next_record_id = _parameters .get("next_record_id") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV1::api::api_usage_metering::GetUsageTopAvgMetricsOptionalParams::default(); + let mut params = datadogV1::api_usage_metering::GetUsageTopAvgMetricsOptionalParams::default(); params.month = month; params.day = day; params.names = names; @@ -4382,7 +4403,7 @@ fn test_v1_list_dashboards(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -4958,7 +4979,7 @@ fn test_v1_list_active_metrics(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -5126,7 +5147,7 @@ fn test_v1_list_downtimes(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -5634,7 +5655,7 @@ fn test_v1_list_aws_accounts(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -7592,7 +7613,7 @@ fn test_v1_get_monitor(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -8437,7 +8454,7 @@ fn test_v1_get_slo(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -8524,7 +8541,7 @@ fn test_v1_get_slo_history(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -9606,7 +9622,7 @@ fn test_v1_delete_host_tags(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -9636,7 +9652,7 @@ fn test_v1_get_host_tags(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -9667,7 +9683,7 @@ fn test_v1_create_host_tags(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -9698,7 +9714,7 @@ fn test_v1_update_host_tags(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -9909,7 +9925,7 @@ fn test_v2_list_api_keys(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -10075,8 +10091,7 @@ fn test_v2_list_application_keys(world: &mut DatadogWorld, _parameters: &HashMap let include = _parameters .get("include") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV2::api::api_key_management::ListApplicationKeysOptionalParams::default(); + let mut params = datadogV2::api_key_management::ListApplicationKeysOptionalParams::default(); params.page_size = page_size; params.page_number = page_number; params.sort = sort; @@ -10139,7 +10154,7 @@ fn test_v2_get_application_key(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -10217,7 +10232,7 @@ fn test_v2_list_current_user_application_keys( .get("include") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV2::api::api_key_management::ListCurrentUserApplicationKeysOptionalParams::default(); + datadogV2::api_key_management::ListCurrentUserApplicationKeysOptionalParams::default(); params.page_size = page_size; params.page_number = page_number; params.sort = sort; @@ -10426,7 +10441,7 @@ fn test_v2_update_open_api(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -10460,7 +10475,7 @@ fn test_v2_create_open_api(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -10797,7 +10812,7 @@ fn test_v2_list_audit_logs(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -10923,7 +10938,7 @@ fn test_v2_search_audit_logs_with_pagination( let body = _parameters .get("body") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = datadogV2::api::api_audit::SearchAuditLogsOptionalParams::default(); + let mut params = datadogV2::api_audit::SearchAuditLogsOptionalParams::default(); params.body = body; let response = api.search_audit_logs_with_pagination(params); let mut result = Vec::new(); @@ -10971,7 +10986,7 @@ fn test_v2_list_authn_mappings(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -11723,7 +11737,8 @@ fn test_v2_search_ci_app_pipeline_events_with_pagination( let body = _parameters .get("body") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = datadogV2::api::api_ci_visibility_pipelines::SearchCIAppPipelineEventsOptionalParams::default(); + let mut params = + datadogV2::api_ci_visibility_pipelines::SearchCIAppPipelineEventsOptionalParams::default(); params.body = body; let response = api.search_ci_app_pipeline_events_with_pagination(params); let mut result = Vec::new(); @@ -11806,7 +11821,7 @@ fn test_v2_list_ci_app_test_events(world: &mut DatadogWorld, _parameters: &HashM .get("page[limit]") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV2::api::api_ci_visibility_tests::ListCIAppTestEventsOptionalParams::default(); + datadogV2::api_ci_visibility_tests::ListCIAppTestEventsOptionalParams::default(); params.filter_query = filter_query; params.filter_from = filter_from; params.filter_to = filter_to; @@ -11858,7 +11873,7 @@ fn test_v2_list_ci_app_test_events_with_pagination( .get("page[limit]") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV2::api::api_ci_visibility_tests::ListCIAppTestEventsOptionalParams::default(); + datadogV2::api_ci_visibility_tests::ListCIAppTestEventsOptionalParams::default(); params.filter_query = filter_query; params.filter_from = filter_from; params.filter_to = filter_to; @@ -11906,7 +11921,7 @@ fn test_v2_search_ci_app_test_events( .get("body") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV2::api::api_ci_visibility_tests::SearchCIAppTestEventsOptionalParams::default(); + datadogV2::api_ci_visibility_tests::SearchCIAppTestEventsOptionalParams::default(); params.body = body; let response = match block_on(api.search_ci_app_test_events_with_http_info(params)) { Ok(response) => response, @@ -11938,7 +11953,7 @@ fn test_v2_search_ci_app_test_events_with_pagination( .get("body") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV2::api::api_ci_visibility_tests::SearchCIAppTestEventsOptionalParams::default(); + datadogV2::api_ci_visibility_tests::SearchCIAppTestEventsOptionalParams::default(); params.body = body; let response = api.search_ci_app_test_events_with_pagination(params); let mut result = Vec::new(); @@ -11989,8 +12004,7 @@ fn test_v2_list_container_images(world: &mut DatadogWorld, _parameters: &HashMap let page_cursor = _parameters .get("page[cursor]") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV2::api::api_container_images::ListContainerImagesOptionalParams::default(); + let mut params = datadogV2::api_container_images::ListContainerImagesOptionalParams::default(); params.filter_tags = filter_tags; params.group_by = group_by; params.sort = sort; @@ -12037,8 +12051,7 @@ fn test_v2_list_container_images_with_pagination( let page_cursor = _parameters .get("page[cursor]") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV2::api::api_container_images::ListContainerImagesOptionalParams::default(); + let mut params = datadogV2::api_container_images::ListContainerImagesOptionalParams::default(); params.filter_tags = filter_tags; params.group_by = group_by; params.sort = sort; @@ -12093,7 +12106,7 @@ fn test_v2_list_containers(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -12640,8 +12655,7 @@ fn test_v2_get_estimated_cost_by_org( let end_date = _parameters .get("end_date") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV2::api::api_usage_metering::GetEstimatedCostByOrgOptionalParams::default(); + let mut params = datadogV2::api_usage_metering::GetEstimatedCostByOrgOptionalParams::default(); params.view = view; params.start_month = start_month; params.end_month = end_month; @@ -12682,8 +12696,7 @@ fn test_v2_get_historical_cost_by_org( let end_month = _parameters .get("end_month") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV2::api::api_usage_metering::GetHistoricalCostByOrgOptionalParams::default(); + let mut params = datadogV2::api_usage_metering::GetHistoricalCostByOrgOptionalParams::default(); params.view = view; params.end_month = end_month; let response = @@ -12735,7 +12748,7 @@ fn test_v2_get_hourly_usage(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -13054,7 +13066,7 @@ fn test_v2_list_downtimes(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -13253,7 +13265,7 @@ fn test_v2_list_monitor_downtimes(world: &mut DatadogWorld, _parameters: &HashMa let page_limit = _parameters .get("page[limit]") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = datadogV2::api::api_downtimes::ListMonitorDowntimesOptionalParams::default(); + let mut params = datadogV2::api_downtimes::ListMonitorDowntimesOptionalParams::default(); params.page_offset = page_offset; params.page_limit = page_limit; let response = match block_on(api.list_monitor_downtimes_with_http_info(monitor_id, params)) { @@ -13290,7 +13302,7 @@ fn test_v2_list_monitor_downtimes_with_pagination( let page_limit = _parameters .get("page[limit]") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = datadogV2::api::api_downtimes::ListMonitorDowntimesOptionalParams::default(); + let mut params = datadogV2::api_downtimes::ListMonitorDowntimesOptionalParams::default(); params.page_offset = page_offset; params.page_limit = page_limit; let response = api.list_monitor_downtimes_with_pagination(monitor_id, params); @@ -13345,7 +13357,7 @@ fn test_v2_list_events(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -13471,7 +13483,7 @@ fn test_v2_search_events_with_pagination( let body = _parameters .get("body") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = datadogV2::api::api_events::SearchEventsOptionalParams::default(); + let mut params = datadogV2::api_events::SearchEventsOptionalParams::default(); params.body = body; let response = api.search_events_with_pagination(params); let mut result = Vec::new(); @@ -13516,7 +13528,7 @@ fn test_v2_list_incidents(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -13777,7 +13789,7 @@ fn test_v2_update_incident(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -13814,8 +13826,7 @@ fn test_v2_list_incident_attachments( let filter_attachment_type = _parameters .get("filter[attachment_type]") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV2::api::api_incidents::ListIncidentAttachmentsOptionalParams::default(); + let mut params = datadogV2::api_incidents::ListIncidentAttachmentsOptionalParams::default(); params.include = include; params.filter_attachment_type = filter_attachment_type; let response = match block_on(api.list_incident_attachments_with_http_info(incident_id, params)) @@ -13852,8 +13863,7 @@ fn test_v2_update_incident_attachments( let include = _parameters .get("include") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV2::api::api_incidents::UpdateIncidentAttachmentsOptionalParams::default(); + let mut params = datadogV2::api_incidents::UpdateIncidentAttachmentsOptionalParams::default(); params.include = include; let response = match block_on(api.update_incident_attachments_with_http_info(incident_id, body, params)) { @@ -14310,8 +14320,7 @@ fn test_v2_make_gcpsts_delegate(world: &mut DatadogWorld, _parameters: &HashMap< let body = _parameters .get("body") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV2::api::api_gcp_integration::MakeGCPSTSDelegateOptionalParams::default(); + let mut params = datadogV2::api_gcp_integration::MakeGCPSTSDelegateOptionalParams::default(); params.body = body; let response = match block_on(api.make_gcpsts_delegate_with_http_info(params)) { Ok(response) => response, @@ -15347,7 +15356,7 @@ fn test_v2_submit_log(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -15559,7 +15568,7 @@ fn test_v2_list_logs_with_pagination( let body = _parameters .get("body") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = datadogV2::api::api_logs::ListLogsOptionalParams::default(); + let mut params = datadogV2::api_logs::ListLogsOptionalParams::default(); params.body = body; let response = api.list_logs_with_pagination(params); let mut result = Vec::new(); @@ -16154,7 +16163,7 @@ fn test_v2_list_tag_configurations(world: &mut DatadogWorld, _parameters: &HashM let window_seconds = _parameters .get("window[seconds]") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = datadogV2::api::api_metrics::ListTagConfigurationsOptionalParams::default(); + let mut params = datadogV2::api_metrics::ListTagConfigurationsOptionalParams::default(); params.filter_configured = filter_configured; params.filter_tags_configured = filter_tags_configured; params.filter_metric_type = filter_metric_type; @@ -16251,7 +16260,7 @@ fn test_v2_list_active_metric_configurations( .get("window[seconds]") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV2::api::api_metrics::ListActiveMetricConfigurationsOptionalParams::default(); + datadogV2::api_metrics::ListActiveMetricConfigurationsOptionalParams::default(); params.window_seconds = window_seconds; let response = match block_on(api.list_active_metric_configurations_with_http_info(metric_name, params)) { @@ -16353,8 +16362,7 @@ fn test_v2_estimate_metrics_output_series( let filter_timespan_h = _parameters .get("filter[timespan_h]") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV2::api::api_metrics::EstimateMetricsOutputSeriesOptionalParams::default(); + let mut params = datadogV2::api_metrics::EstimateMetricsOutputSeriesOptionalParams::default(); params.filter_groups = filter_groups; params.filter_hours_ago = filter_hours_ago; params.filter_num_aggregations = filter_num_aggregations; @@ -16586,7 +16594,7 @@ fn test_v2_submit_metrics(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -16792,7 +16800,7 @@ fn test_v2_list_roles(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -17623,8 +17631,7 @@ fn test_v2_list_security_monitoring_rules( .get("page[number]") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV2::api::api_security_monitoring::ListSecurityMonitoringRulesOptionalParams::default( - ); + datadogV2::api_security_monitoring::ListSecurityMonitoringRulesOptionalParams::default(); params.page_size = page_size; params.page_number = page_number; let response = match block_on(api.list_security_monitoring_rules_with_http_info(params)) { @@ -17814,7 +17821,8 @@ fn test_v2_list_security_monitoring_signals( let page_limit = _parameters .get("page[limit]") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = datadogV2::api::api_security_monitoring::ListSecurityMonitoringSignalsOptionalParams::default(); + let mut params = + datadogV2::api_security_monitoring::ListSecurityMonitoringSignalsOptionalParams::default(); params.filter_query = filter_query; params.filter_from = filter_from; params.filter_to = filter_to; @@ -17865,7 +17873,8 @@ fn test_v2_list_security_monitoring_signals_with_pagination( let page_limit = _parameters .get("page[limit]") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = datadogV2::api::api_security_monitoring::ListSecurityMonitoringSignalsOptionalParams::default(); + let mut params = + datadogV2::api_security_monitoring::ListSecurityMonitoringSignalsOptionalParams::default(); params.filter_query = filter_query; params.filter_from = filter_from; params.filter_to = filter_to; @@ -17912,7 +17921,9 @@ fn test_v2_search_security_monitoring_signals( let body = _parameters .get("body") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = datadogV2::api::api_security_monitoring::SearchSecurityMonitoringSignalsOptionalParams::default(); + let mut params = + datadogV2::api_security_monitoring::SearchSecurityMonitoringSignalsOptionalParams::default( + ); params.body = body; let response = match block_on(api.search_security_monitoring_signals_with_http_info(params)) { Ok(response) => response, @@ -17943,7 +17954,9 @@ fn test_v2_search_security_monitoring_signals_with_pagination( let body = _parameters .get("body") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = datadogV2::api::api_security_monitoring::SearchSecurityMonitoringSignalsOptionalParams::default(); + let mut params = + datadogV2::api_security_monitoring::SearchSecurityMonitoringSignalsOptionalParams::default( + ); params.body = body; let response = api.search_security_monitoring_signals_with_pagination(params); let mut result = Vec::new(); @@ -18105,7 +18118,7 @@ fn test_v2_list_powerpacks(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -19210,7 +19223,7 @@ fn test_v2_list_scorecard_outcomes(world: &mut DatadogWorld, _parameters: &HashM .get("filter[rule][name]") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV2::api::api_service_scorecards::ListScorecardOutcomesOptionalParams::default(); + datadogV2::api_service_scorecards::ListScorecardOutcomesOptionalParams::default(); params.page_size = page_size; params.page_offset = page_offset; params.include = include; @@ -19278,7 +19291,7 @@ fn test_v2_list_scorecard_outcomes_with_pagination( .get("filter[rule][name]") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV2::api::api_service_scorecards::ListScorecardOutcomesOptionalParams::default(); + datadogV2::api_service_scorecards::ListScorecardOutcomesOptionalParams::default(); params.page_size = page_size; params.page_offset = page_offset; params.include = include; @@ -19381,8 +19394,7 @@ fn test_v2_list_scorecard_rules(world: &mut DatadogWorld, _parameters: &HashMap< let fields_scorecard = _parameters .get("fields[scorecard]") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV2::api::api_service_scorecards::ListScorecardRulesOptionalParams::default(); + let mut params = datadogV2::api_service_scorecards::ListScorecardRulesOptionalParams::default(); params.page_size = page_size; params.page_offset = page_offset; params.include = include; @@ -19449,8 +19461,7 @@ fn test_v2_list_scorecard_rules_with_pagination( let fields_scorecard = _parameters .get("fields[scorecard]") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV2::api::api_service_scorecards::ListScorecardRulesOptionalParams::default(); + let mut params = datadogV2::api_service_scorecards::ListScorecardRulesOptionalParams::default(); params.page_size = page_size; params.page_offset = page_offset; params.include = include; @@ -19820,7 +19831,8 @@ fn test_v2_list_service_account_application_keys( let filter_created_at_end = _parameters .get("filter[created_at][end]") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = datadogV2::api::api_service_accounts::ListServiceAccountApplicationKeysOptionalParams::default(); + let mut params = + datadogV2::api_service_accounts::ListServiceAccountApplicationKeysOptionalParams::default(); params.page_size = page_size; params.page_number = page_number; params.sort = sort; @@ -20000,7 +20012,7 @@ fn test_v2_list_incident_services(world: &mut DatadogWorld, _parameters: &HashMa .get("filter") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV2::api::api_incident_services::ListIncidentServicesOptionalParams::default(); + datadogV2::api_incident_services::ListIncidentServicesOptionalParams::default(); params.include = include; params.page_size = page_size; params.page_offset = page_offset; @@ -20085,8 +20097,7 @@ fn test_v2_get_incident_service(world: &mut DatadogWorld, _parameters: &HashMap< let include = _parameters .get("include") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV2::api::api_incident_services::GetIncidentServiceOptionalParams::default(); + let mut params = datadogV2::api_incident_services::GetIncidentServiceOptionalParams::default(); params.include = include; let response = match block_on(api.get_incident_service_with_http_info(service_id, params)) { Ok(response) => response, @@ -20152,7 +20163,7 @@ fn test_v2_list_service_definitions( .get("schema_version") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV2::api::api_service_definition::ListServiceDefinitionsOptionalParams::default(); + datadogV2::api_service_definition::ListServiceDefinitionsOptionalParams::default(); params.page_size = page_size; params.page_number = page_number; params.schema_version = schema_version; @@ -20192,7 +20203,7 @@ fn test_v2_list_service_definitions_with_pagination( .get("schema_version") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV2::api::api_service_definition::ListServiceDefinitionsOptionalParams::default(); + datadogV2::api_service_definition::ListServiceDefinitionsOptionalParams::default(); params.page_size = page_size; params.page_number = page_number; params.schema_version = schema_version; @@ -20293,7 +20304,7 @@ fn test_v2_get_service_definition(world: &mut DatadogWorld, _parameters: &HashMa .get("schema_version") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV2::api::api_service_definition::GetServiceDefinitionOptionalParams::default(); + datadogV2::api_service_definition::GetServiceDefinitionOptionalParams::default(); params.schema_version = schema_version; let response = match block_on(api.get_service_definition_with_http_info(service_name, params)) { Ok(response) => response, @@ -20362,7 +20373,7 @@ fn test_v2_list_spans_get(world: &mut DatadogWorld, _parameters: &HashMap response, @@ -21396,7 +21407,7 @@ fn test_v2_list_users(world: &mut DatadogWorld, _parameters: &HashMap