datadog_api_client 2.12.0 → 2.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (251) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +6 -6
  3. data/.generator/conftest.py +7 -0
  4. data/.generator/poetry.lock +45 -75
  5. data/.generator/pyproject.toml +7 -7
  6. data/.generator/schemas/v1/openapi.yaml +257 -19
  7. data/.generator/schemas/v2/openapi.yaml +3020 -911
  8. data/.generator/src/generator/formatter.py +43 -32
  9. data/.generator/src/generator/openapi.py +4 -2
  10. data/.generator/src/generator/templates/api_client.j2 +81 -53
  11. data/.generator/src/generator/templates/configuration.j2 +21 -0
  12. data/.github/workflows/test_integration.yml +7 -1
  13. data/.pre-commit-config.yaml +4 -4
  14. data/CHANGELOG.md +62 -0
  15. data/README.md +23 -0
  16. data/examples/v1/azure-integration/CreateAzureIntegration.rb +3 -0
  17. data/examples/v1/azure-integration/DeleteAzureIntegration.rb +3 -0
  18. data/examples/v1/azure-integration/UpdateAzureHostFilters.rb +3 -0
  19. data/examples/v1/azure-integration/UpdateAzureIntegration.rb +3 -0
  20. data/examples/v1/dashboards/CreateDashboard_1284514532.rb +43 -0
  21. data/examples/v1/dashboards/CreateDashboard_2261785072.rb +47 -0
  22. data/examples/v1/dashboards/CreateDashboard_252716965.rb +6 -0
  23. data/examples/v1/dashboards/CreateDashboard_3513586382.rb +74 -0
  24. data/examples/v1/dashboards/CreateDashboard_3562282606.rb +1 -0
  25. data/examples/v1/dashboards/DeletePublicDashboardInvitation.rb +3 -3
  26. data/examples/v1/organizations/UpdateOrg.rb +1 -1
  27. data/examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.rb +1 -0
  28. data/examples/v1/users/CreateUser.rb +1 -1
  29. data/examples/v1/users/CreateUser_266604071.rb +13 -0
  30. data/examples/v1/users/UpdateUser.rb +1 -1
  31. data/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.rb +3 -0
  32. data/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.rb +3 -0
  33. data/examples/v2/confluent-cloud/CreateConfluentAccount.rb +1 -0
  34. data/examples/v2/confluent-cloud/CreateConfluentResource.rb +1 -0
  35. data/examples/v2/confluent-cloud/UpdateConfluentResource.rb +1 -0
  36. data/examples/v2/downtimes/CancelDowntime.rb +11 -0
  37. data/examples/v2/downtimes/CreateDowntime.rb +26 -0
  38. data/examples/v2/downtimes/GetDowntime.rb +11 -0
  39. data/examples/v2/downtimes/ListDowntimes.rb +8 -0
  40. data/examples/v2/downtimes/ListMonitorDowntimes.rb +8 -0
  41. data/examples/v2/downtimes/ListMonitorDowntimes_128979780.rb +8 -0
  42. data/examples/v2/downtimes/UpdateDowntime.rb +21 -0
  43. data/examples/v2/logs/AggregateLogs_2955613758.rb +1 -1
  44. data/examples/v2/logs/ListLogsGet_2034110533.rb +3 -1
  45. data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_1092490364.rb +10 -0
  46. data/examples/v2/spans/AggregateSpans.rb +25 -0
  47. data/examples/v2/spans/ListSpans.rb +25 -0
  48. data/examples/v2/spans/ListSpansGet.rb +5 -0
  49. data/examples/v2/spans/ListSpansGet_1130763422.rb +8 -0
  50. data/examples/v2/spans/ListSpans_3495563906.rb +25 -0
  51. data/examples/v2/teams/CreateTeam.rb +2 -2
  52. data/examples/v2/teams/CreateTeam_252121814.rb +24 -0
  53. data/examples/v2/teams/GetUserMemberships.rb +8 -0
  54. data/examples/v2/teams/UpdateTeam.rb +9 -0
  55. data/lib/datadog_api_client/api_client.rb +81 -53
  56. data/lib/datadog_api_client/configuration.rb +28 -0
  57. data/lib/datadog_api_client/inflector.rb +97 -1
  58. data/lib/datadog_api_client/v1/api/service_level_objective_corrections_api.rb +2 -2
  59. data/lib/datadog_api_client/v1/api/service_level_objectives_api.rb +10 -10
  60. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +3 -3
  61. data/lib/datadog_api_client/v1/models/azure_account.rb +32 -1
  62. data/lib/datadog_api_client/v1/models/change_widget_request.rb +1 -1
  63. data/lib/datadog_api_client/v1/models/distribution_widget_definition.rb +13 -1
  64. data/lib/datadog_api_client/v1/models/formula_and_function_cloud_cost_data_source.rb +26 -0
  65. data/lib/datadog_api_client/v1/models/formula_and_function_cloud_cost_query_definition.rb +150 -0
  66. data/lib/datadog_api_client/v1/models/formula_and_function_query_definition.rb +2 -1
  67. data/lib/datadog_api_client/v1/models/formula_and_function_response_format.rb +2 -1
  68. data/lib/datadog_api_client/v1/models/formula_and_function_slo_query_definition.rb +11 -1
  69. data/lib/datadog_api_client/v1/models/geomap_widget_request.rb +24 -2
  70. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +3 -0
  71. data/lib/datadog_api_client/v1/models/ip_prefixes_remote_configuration.rb +94 -0
  72. data/lib/datadog_api_client/v1/models/ip_ranges.rb +11 -1
  73. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +6 -0
  74. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +61 -1
  75. data/lib/datadog_api_client/v1/models/organization_settings.rb +8 -0
  76. data/lib/datadog_api_client/v1/models/query_value_widget_request.rb +1 -1
  77. data/lib/datadog_api_client/v1/models/scatterplot_table_request.rb +1 -1
  78. data/lib/datadog_api_client/v1/models/sunburst_widget_request.rb +1 -1
  79. data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +11 -1
  80. data/lib/datadog_api_client/v1/models/table_widget_request.rb +1 -1
  81. data/lib/datadog_api_client/v1/models/timeseries_widget_request.rb +1 -1
  82. data/lib/datadog_api_client/v1/models/toplist_widget_request.rb +1 -1
  83. data/lib/datadog_api_client/v1/models/tree_map_widget_request.rb +1 -1
  84. data/lib/datadog_api_client/v1/models/usage_ci_visibility_hour.rb +12 -1
  85. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +24 -4
  86. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +24 -4
  87. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +24 -4
  88. data/lib/datadog_api_client/v1/models/user.rb +8 -0
  89. data/lib/datadog_api_client/v1/models/widget_comparator.rb +1 -0
  90. data/lib/datadog_api_client/v1/models/widget_display_type.rb +1 -0
  91. data/lib/datadog_api_client/v2/api/ci_visibility_pipelines_api.rb +11 -5
  92. data/lib/datadog_api_client/v2/api/downtimes_api.rb +462 -0
  93. data/lib/datadog_api_client/v2/api/ip_allowlist_api.rb +2 -2
  94. data/lib/datadog_api_client/v2/api/logs_api.rb +2 -2
  95. data/lib/datadog_api_client/v2/api/metrics_api.rb +2 -2
  96. data/lib/datadog_api_client/v2/api/rum_api.rb +2 -2
  97. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +3 -3
  98. data/lib/datadog_api_client/v2/api/spans_api.rb +294 -0
  99. data/lib/datadog_api_client/v2/api/spans_metrics_api.rb +2 -2
  100. data/lib/datadog_api_client/v2/api/teams_api.rb +65 -0
  101. data/lib/datadog_api_client/v2/models/application_key_create_attributes.rb +1 -1
  102. data/lib/datadog_api_client/v2/models/application_key_update_attributes.rb +1 -1
  103. data/lib/datadog_api_client/v2/models/audit_logs_event_attributes.rb +11 -1
  104. data/lib/datadog_api_client/v2/models/ci_app_event_attributes.rb +9 -21
  105. data/lib/datadog_api_client/v2/models/ci_app_pipeline_event.rb +1 -1
  106. data/lib/datadog_api_client/v2/models/ci_app_pipeline_event_attributes.rb +102 -0
  107. data/lib/datadog_api_client/v2/models/ci_app_pipeline_event_pipeline.rb +1 -1
  108. data/lib/datadog_api_client/v2/models/ci_app_pipeline_level.rb +30 -0
  109. data/lib/datadog_api_client/v2/models/ci_app_pipelines_query_filter.rb +1 -1
  110. data/lib/datadog_api_client/v2/models/ci_app_test_level.rb +29 -0
  111. data/lib/datadog_api_client/v2/models/ci_app_tests_analytics_aggregate_response.rb +1 -1
  112. data/lib/datadog_api_client/v2/models/ci_app_tests_query_filter.rb +1 -1
  113. data/lib/datadog_api_client/v2/models/cloud_configuration_rule_compliance_signal_options.rb +25 -1
  114. data/lib/datadog_api_client/v2/models/cloud_configuration_rule_create_payload.rb +13 -1
  115. data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_attributes.rb +41 -1
  116. data/lib/datadog_api_client/v2/models/confluent_account_resource_attributes.rb +11 -1
  117. data/lib/datadog_api_client/v2/models/confluent_resource_request_attributes.rb +11 -1
  118. data/lib/datadog_api_client/v2/models/confluent_resource_response_attributes.rb +21 -1
  119. data/lib/datadog_api_client/v2/models/dashboard_list_item.rb +36 -1
  120. data/lib/datadog_api_client/v2/models/downtime_create_request.rb +98 -0
  121. data/lib/datadog_api_client/v2/models/downtime_create_request_attributes.rb +194 -0
  122. data/lib/datadog_api_client/v2/models/downtime_create_request_data.rb +119 -0
  123. data/lib/datadog_api_client/v2/models/downtime_included_monitor_type.rb +26 -0
  124. data/lib/datadog_api_client/v2/models/downtime_meta.rb +80 -0
  125. data/lib/datadog_api_client/v2/models/downtime_meta_page.rb +80 -0
  126. data/lib/datadog_api_client/v2/models/downtime_monitor_identifier.rb +63 -0
  127. data/lib/datadog_api_client/v2/models/downtime_monitor_identifier_id.rb +98 -0
  128. data/lib/datadog_api_client/v2/models/downtime_monitor_identifier_tags.rb +107 -0
  129. data/lib/datadog_api_client/v2/models/downtime_monitor_included_attributes.rb +80 -0
  130. data/lib/datadog_api_client/v2/models/downtime_monitor_included_item.rb +100 -0
  131. data/lib/datadog_api_client/v2/models/downtime_notify_end_state_actions.rb +27 -0
  132. data/lib/datadog_api_client/v2/models/downtime_notify_end_state_types.rb +28 -0
  133. data/lib/datadog_api_client/v2/models/downtime_relationships.rb +90 -0
  134. data/lib/datadog_api_client/v2/models/downtime_relationships_created_by.rb +88 -0
  135. data/lib/datadog_api_client/v2/models/downtime_relationships_created_by_data.rb +90 -0
  136. data/lib/datadog_api_client/v2/models/downtime_relationships_monitor.rb +88 -0
  137. data/lib/datadog_api_client/v2/models/downtime_relationships_monitor_data.rb +90 -0
  138. data/lib/datadog_api_client/v2/models/downtime_resource_type.rb +26 -0
  139. data/lib/datadog_api_client/v2/models/downtime_response.rb +95 -0
  140. data/lib/datadog_api_client/v2/models/downtime_response_attributes.rb +208 -0
  141. data/lib/datadog_api_client/v2/models/downtime_response_data.rb +110 -0
  142. data/lib/datadog_api_client/v2/models/downtime_response_included_item.rb +63 -0
  143. data/lib/datadog_api_client/v2/models/downtime_schedule_create_request.rb +63 -0
  144. data/lib/datadog_api_client/v2/models/downtime_schedule_current_downtime_response.rb +100 -0
  145. data/lib/datadog_api_client/v2/models/downtime_schedule_one_time_create_update_request.rb +101 -0
  146. data/lib/datadog_api_client/v2/models/downtime_schedule_one_time_response.rb +116 -0
  147. data/lib/datadog_api_client/v2/models/downtime_schedule_recurrence_create_update_request.rb +143 -0
  148. data/lib/datadog_api_client/v2/models/downtime_schedule_recurrence_response.rb +106 -0
  149. data/lib/datadog_api_client/v2/models/downtime_schedule_recurrences_create_request.rb +110 -0
  150. data/lib/datadog_api_client/v2/models/downtime_schedule_recurrences_response.rb +131 -0
  151. data/lib/datadog_api_client/v2/models/downtime_schedule_recurrences_update_request.rb +92 -0
  152. data/lib/datadog_api_client/v2/models/downtime_schedule_response.rb +65 -0
  153. data/lib/datadog_api_client/v2/models/downtime_schedule_update_request.rb +63 -0
  154. data/lib/datadog_api_client/v2/models/downtime_status.rb +29 -0
  155. data/lib/datadog_api_client/v2/models/downtime_update_request.rb +98 -0
  156. data/lib/datadog_api_client/v2/models/downtime_update_request_attributes.rb +165 -0
  157. data/lib/datadog_api_client/v2/models/{team_data.rb → downtime_update_request_data.rb} +9 -9
  158. data/lib/datadog_api_client/v2/models/event_response_attributes.rb +11 -1
  159. data/lib/datadog_api_client/v2/models/events_group_by_sort.rb +1 -1
  160. data/lib/datadog_api_client/v2/models/events_response_metadata.rb +11 -1
  161. data/lib/datadog_api_client/v2/models/formula_limit.rb +1 -0
  162. data/lib/datadog_api_client/v2/models/full_application_key_attributes.rb +1 -1
  163. data/lib/datadog_api_client/v2/models/list_downtimes_response.rb +104 -0
  164. data/lib/datadog_api_client/v2/models/logs_aggregate_request.rb +1 -1
  165. data/lib/datadog_api_client/v2/models/logs_aggregate_request_page.rb +1 -1
  166. data/lib/datadog_api_client/v2/models/logs_group_by.rb +3 -2
  167. data/lib/datadog_api_client/v2/models/logs_group_by_histogram.rb +1 -1
  168. data/lib/datadog_api_client/v2/models/logs_list_request.rb +1 -1
  169. data/lib/datadog_api_client/v2/models/logs_query_options.rb +1 -1
  170. data/lib/datadog_api_client/v2/models/logs_response_metadata_page.rb +1 -1
  171. data/lib/datadog_api_client/v2/models/metrics_aggregator.rb +1 -1
  172. data/lib/datadog_api_client/v2/models/metrics_scalar_query.rb +1 -1
  173. data/lib/datadog_api_client/v2/models/monitor_downtime_match_resource_type.rb +26 -0
  174. data/lib/datadog_api_client/v2/models/monitor_downtime_match_response.rb +92 -0
  175. data/lib/datadog_api_client/v2/models/monitor_downtime_match_response_attributes.rb +120 -0
  176. data/lib/datadog_api_client/v2/models/monitor_downtime_match_response_data.rb +108 -0
  177. data/lib/datadog_api_client/v2/models/on_demand_concurrency_cap.rb +14 -4
  178. data/lib/datadog_api_client/v2/models/on_demand_concurrency_cap_type.rb +26 -0
  179. data/lib/datadog_api_client/v2/models/partial_application_key_attributes.rb +1 -1
  180. data/lib/datadog_api_client/v2/models/query_formula.rb +1 -0
  181. data/lib/datadog_api_client/v2/models/relationship_to_team_links.rb +14 -4
  182. data/lib/datadog_api_client/v2/models/relationship_to_user_team_permission.rb +14 -4
  183. data/lib/datadog_api_client/v2/models/restriction_policy_binding.rb +2 -1
  184. data/lib/datadog_api_client/v2/models/rum_application_list.rb +11 -1
  185. data/lib/datadog_api_client/v2/models/security_monitoring_signal_metadata_type.rb +26 -0
  186. data/lib/datadog_api_client/v2/models/security_monitoring_signal_response.rb +80 -0
  187. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_response_query.rb +26 -2
  188. data/lib/datadog_api_client/v2/models/security_monitoring_signal_state_update_data.rb +24 -4
  189. data/lib/datadog_api_client/v2/models/security_monitoring_signal_triage_update_data.rb +24 -4
  190. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_query.rb +1 -19
  191. data/lib/datadog_api_client/v2/models/security_monitoring_triage_user.rb +11 -1
  192. data/lib/datadog_api_client/v2/models/sensitive_data_scanner_get_config_response_data.rb +11 -1
  193. data/lib/datadog_api_client/v2/models/sensitive_data_scanner_meta.rb +11 -1
  194. data/lib/datadog_api_client/v2/models/sensitive_data_scanner_standard_pattern_attributes.rb +11 -1
  195. data/lib/datadog_api_client/v2/models/service_definition_data.rb +11 -1
  196. data/lib/datadog_api_client/v2/models/service_definition_meta.rb +36 -4
  197. data/lib/datadog_api_client/v2/models/service_definition_meta_warnings.rb +100 -0
  198. data/lib/datadog_api_client/v2/models/span.rb +100 -0
  199. data/lib/datadog_api_client/v2/models/spans_aggregate_bucket.rb +100 -0
  200. data/lib/datadog_api_client/v2/models/spans_aggregate_bucket_attributes.rb +100 -0
  201. data/lib/datadog_api_client/v2/models/spans_aggregate_bucket_type.rb +26 -0
  202. data/lib/datadog_api_client/v2/models/spans_aggregate_bucket_value.rb +64 -0
  203. data/lib/datadog_api_client/v2/models/spans_aggregate_bucket_value_timeseries_point.rb +90 -0
  204. data/lib/datadog_api_client/v2/models/spans_aggregate_data.rb +90 -0
  205. data/lib/datadog_api_client/v2/models/spans_aggregate_request.rb +80 -0
  206. data/lib/datadog_api_client/v2/models/spans_aggregate_request_attributes.rb +115 -0
  207. data/lib/datadog_api_client/v2/models/spans_aggregate_request_type.rb +26 -0
  208. data/lib/datadog_api_client/v2/models/spans_aggregate_response.rb +92 -0
  209. data/lib/datadog_api_client/v2/models/spans_aggregate_response_metadata.rb +113 -0
  210. data/lib/datadog_api_client/v2/models/spans_aggregate_response_status.rb +27 -0
  211. data/lib/datadog_api_client/v2/models/spans_aggregate_sort.rb +110 -0
  212. data/lib/datadog_api_client/v2/models/spans_aggregate_sort_type.rb +27 -0
  213. data/lib/datadog_api_client/v2/models/spans_aggregation_function.rb +37 -0
  214. data/lib/datadog_api_client/v2/models/spans_attributes.rb +244 -0
  215. data/lib/datadog_api_client/v2/models/spans_compute.rb +129 -0
  216. data/lib/datadog_api_client/v2/models/spans_compute_type.rb +27 -0
  217. data/lib/datadog_api_client/v2/models/spans_group_by.rb +149 -0
  218. data/lib/datadog_api_client/v2/models/spans_group_by_histogram.rb +143 -0
  219. data/lib/datadog_api_client/v2/models/spans_group_by_missing.rb +63 -0
  220. data/lib/datadog_api_client/v2/models/spans_group_by_total.rb +64 -0
  221. data/lib/datadog_api_client/v2/models/spans_list_request.rb +80 -0
  222. data/lib/datadog_api_client/v2/models/spans_list_request_attributes.rb +111 -0
  223. data/lib/datadog_api_client/v2/models/spans_list_request_data.rb +90 -0
  224. data/lib/datadog_api_client/v2/models/spans_list_request_page.rb +108 -0
  225. data/lib/datadog_api_client/v2/models/spans_list_request_type.rb +26 -0
  226. data/lib/datadog_api_client/v2/models/spans_list_response.rb +102 -0
  227. data/lib/datadog_api_client/v2/models/spans_list_response_links.rb +81 -0
  228. data/lib/datadog_api_client/v2/models/spans_list_response_metadata.rb +123 -0
  229. data/lib/datadog_api_client/v2/models/spans_query_filter.rb +100 -0
  230. data/lib/datadog_api_client/v2/models/spans_query_options.rb +91 -0
  231. data/lib/datadog_api_client/v2/models/spans_response_metadata_page.rb +81 -0
  232. data/lib/datadog_api_client/v2/models/spans_sort.rb +27 -0
  233. data/lib/datadog_api_client/v2/models/spans_sort_order.rb +27 -0
  234. data/lib/datadog_api_client/v2/models/spans_type.rb +26 -0
  235. data/lib/datadog_api_client/v2/models/spans_warning.rb +100 -0
  236. data/lib/datadog_api_client/v2/models/team_attributes.rb +50 -4
  237. data/lib/datadog_api_client/v2/models/team_create_attributes.rb +57 -4
  238. data/lib/datadog_api_client/v2/models/team_relationships_links.rb +80 -0
  239. data/lib/datadog_api_client/v2/models/team_response.rb +1 -1
  240. data/lib/datadog_api_client/v2/models/team_update_attributes.rb +57 -4
  241. data/lib/datadog_api_client/v2/models/teams_response.rb +24 -4
  242. data/lib/datadog_api_client/v2/models/teams_response_links.rb +129 -0
  243. data/lib/datadog_api_client/v2/models/teams_response_meta.rb +80 -0
  244. data/lib/datadog_api_client/v2/models/teams_response_meta_pagination.rb +150 -0
  245. data/lib/datadog_api_client/v2/models/usage_attributes_object.rb +11 -1
  246. data/lib/datadog_api_client/v2/models/user_invitation_response_data.rb +11 -1
  247. data/lib/datadog_api_client/v2/models/user_teams_response.rb +24 -4
  248. data/lib/datadog_api_client/version.rb +1 -1
  249. data/spec/configuration_spec.rb +17 -0
  250. data/spec/retry_spec.rb +44 -0
  251. metadata +119 -3
@@ -55,71 +55,99 @@ module DatadogAPIClient
55
55
  # the data deserialized from response body (could be nil), response status code and response headers.
56
56
  def call_api(http_method, path, opts = {})
57
57
  request = build_request(http_method, path, opts)
58
- if opts[:stream_body]
59
- tempfile = nil
60
- encoding = nil
61
-
62
- response = request.perform do | chunk |
63
- unless tempfile
64
- content_disposition = chunk.http_response.header['Content-Disposition']
65
- if content_disposition && content_disposition =~ /filename=/i
66
- filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
67
- prefix = sanitize_filename(filename)
68
- else
69
- prefix = 'download-'
70
- end
71
- prefix = prefix + '-' unless prefix.end_with?('-')
72
- unless encoding
73
- encoding = chunk.encoding
58
+ attempt = 0
59
+ loop do
60
+ if opts[:stream_body]
61
+ tempfile = nil
62
+ encoding = nil
63
+
64
+ response = request.perform do | chunk |
65
+ unless tempfile
66
+ content_disposition = chunk.http_response.header['Content-Disposition']
67
+ if content_disposition && content_disposition =~ /filename=/i
68
+ filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
69
+ prefix = sanitize_filename(filename)
70
+ else
71
+ prefix = 'download-'
72
+ end
73
+ prefix = prefix + '-' unless prefix.end_with?('-')
74
+ unless encoding
75
+ encoding = chunk.encoding
76
+ end
77
+ tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
78
+ @tempfile = tempfile
74
79
  end
75
- tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
76
- @tempfile = tempfile
80
+ chunk.force_encoding(encoding)
81
+ tempfile.write(chunk)
82
+ end
83
+ if tempfile
84
+ tempfile.close
85
+ @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
86
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
87
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
88
+ "explicitly with `tempfile.delete`"
77
89
  end
78
- chunk.force_encoding(encoding)
79
- tempfile.write(chunk)
90
+ else
91
+ response = request.perform
80
92
  end
81
- if tempfile
82
- tempfile.close
83
- @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
84
- "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
85
- "will be deleted automatically with GC. It's also recommended to delete the temp file "\
86
- "explicitly with `tempfile.delete`"
93
+
94
+ if @config.debugging
95
+ @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
87
96
  end
88
- else
89
- response = request.perform
90
- end
91
97
 
92
- if @config.debugging
93
- @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
94
- end
98
+ unless response.success?
99
+ if response.request_timeout?
100
+ fail APIError.new('Connection timed out')
101
+ elsif response.code == 0
102
+ # Errors from libcurl will be made visible here
103
+ fail APIError.new(:code => 0,
104
+ :message => response.return_message)
105
+ else
106
+ body = response.body
107
+ if response.headers['Content-Encoding'].eql?('gzip') && !(body.nil? || body.empty?) then
108
+ gzip = Zlib::Inflate.new(Zlib::MAX_WBITS + 16)
109
+ body = gzip.inflate(body)
110
+ gzip.close
111
+ end
112
+ if should_retry(attempt, @config.max_retries, response.code, @config.enable_retry)
113
+ sleep calculate_retry_interval(response, @config.backoff_base, @config.backoff_multiplier, attempt, @config.timeout)
114
+ attempt = attempt + 1
115
+ next
116
+ else
117
+ fail APIError.new(:code => response.code,
118
+ :response_headers => response.headers,
119
+ :response_body => body),
120
+ response.message
121
+ end
122
+ end
123
+ end
95
124
 
96
- unless response.success?
97
- if response.request_timeout?
98
- fail APIError.new('Connection timed out')
99
- elsif response.code == 0
100
- # Errors from libcurl will be made visible here
101
- fail APIError.new(:code => 0,
102
- :message => response.return_message)
125
+ if opts[:return_type]
126
+ data = deserialize(opts[:api_version], response, opts[:return_type])
103
127
  else
104
- body = response.body
105
- if response.headers['Content-Encoding'].eql?('gzip') && !(body.nil? || body.empty?) then
106
- gzip = Zlib::Inflate.new(Zlib::MAX_WBITS + 16)
107
- body = gzip.inflate(body)
108
- gzip.close
109
- end
110
- fail APIError.new(:code => response.code,
111
- :response_headers => response.headers,
112
- :response_body => body),
113
- response.message
128
+ data = nil
114
129
  end
130
+ return data, response.code, response.headers
115
131
  end
132
+ end
133
+
134
+ # Check if an http request should be retried
135
+ def should_retry(attempt, max_retries, http_code, enable_retry)
136
+ (http_code == 429 || http_code >= 500) && max_retries > attempt && enable_retry
137
+ end
116
138
 
117
- if opts[:return_type]
118
- data = deserialize(opts[:api_version], response, opts[:return_type])
139
+ # Calculate the sleep interval between 2 retry attempts
140
+ def calculate_retry_interval(response, backoff_base, backoff_multiplier, attempt, timeout)
141
+ reset_header = response.headers['X-Ratelimit-Reset']
142
+ if !reset_header.nil? && !reset_header.empty?
143
+ sleep_time = reset_header.to_i
119
144
  else
120
- data = nil
145
+ sleep_time = (backoff_multiplier**attempt) * backoff_base
146
+ if timeout && timeout > 0
147
+ sleep_time = [timeout, sleep_time].min
148
+ end
121
149
  end
122
- return data, response.code, response.headers
150
+ sleep_time
123
151
  end
124
152
 
125
153
  # Build the HTTP request
@@ -149,6 +149,16 @@ module DatadogAPIClient
149
149
  # Password for proxy server authentication
150
150
  attr_accessor :http_proxypass
151
151
 
152
+ # Enable retry when rate limited
153
+ attr_accessor :enable_retry
154
+
155
+ # Retry backoff calculation parameters
156
+ attr_accessor :backoff_base
157
+ attr_accessor :backoff_multiplier
158
+
159
+ # Maximum number of retry attempts allowed
160
+ attr_accessor :max_retries
161
+
152
162
  def initialize
153
163
  @scheme = 'https'
154
164
  @host = 'api.datadoghq.com'
@@ -159,6 +169,10 @@ module DatadogAPIClient
159
169
  @server_operation_variables = {}
160
170
  @api_key = {}
161
171
  @api_key_prefix = {}
172
+ @enable_retry = false
173
+ @backoff_base = 2
174
+ @backoff_multiplier = 2
175
+ @max_retries = 3
162
176
  @timeout = nil
163
177
  @client_side_validation = true
164
178
  @verify_ssl = true
@@ -175,6 +189,13 @@ module DatadogAPIClient
175
189
  @http_proxypass = nil
176
190
  @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
177
191
  @unstable_operations = {
192
+ "v2.create_ci_app_pipeline_event": false,
193
+ "v2.cancel_downtime": false,
194
+ "v2.create_downtime": false,
195
+ "v2.get_downtime": false,
196
+ "v2.list_downtimes": false,
197
+ "v2.list_monitor_downtimes": false,
198
+ "v2.update_downtime": false,
178
199
  "v2.list_events": false,
179
200
  "v2.search_events": false,
180
201
  "v2.create_incident": false,
@@ -223,6 +244,13 @@ module DatadogAPIClient
223
244
  @@default ||= Configuration.new
224
245
  end
225
246
 
247
+ def backoff_base=(value)
248
+ if value < 2
249
+ raise ArgumentError, 'backoff_base cannot be smaller than 2'
250
+ end
251
+ @backoff_base = value
252
+ end
253
+
226
254
  def configure
227
255
  yield(self) if block_given?
228
256
  end
@@ -113,6 +113,8 @@ module DatadogAPIClient
113
113
  "v1.formula_and_function_apm_resource_stat_name" => "FormulaAndFunctionApmResourceStatName",
114
114
  "v1.formula_and_function_apm_resource_stats_data_source" => "FormulaAndFunctionApmResourceStatsDataSource",
115
115
  "v1.formula_and_function_apm_resource_stats_query_definition" => "FormulaAndFunctionApmResourceStatsQueryDefinition",
116
+ "v1.formula_and_function_cloud_cost_data_source" => "FormulaAndFunctionCloudCostDataSource",
117
+ "v1.formula_and_function_cloud_cost_query_definition" => "FormulaAndFunctionCloudCostQueryDefinition",
116
118
  "v1.formula_and_function_event_aggregation" => "FormulaAndFunctionEventAggregation",
117
119
  "v1.formula_and_function_event_query_definition" => "FormulaAndFunctionEventQueryDefinition",
118
120
  "v1.formula_and_function_event_query_definition_compute" => "FormulaAndFunctionEventQueryDefinitionCompute",
@@ -187,6 +189,7 @@ module DatadogAPIClient
187
189
  "v1.ip_prefixes_logs" => "IPPrefixesLogs",
188
190
  "v1.ip_prefixes_orchestrator" => "IPPrefixesOrchestrator",
189
191
  "v1.ip_prefixes_process" => "IPPrefixesProcess",
192
+ "v1.ip_prefixes_remote_configuration" => "IPPrefixesRemoteConfiguration",
190
193
  "v1.ip_prefixes_synthetics" => "IPPrefixesSynthetics",
191
194
  "v1.ip_prefixes_synthetics_private_locations" => "IPPrefixesSyntheticsPrivateLocations",
192
195
  "v1.ip_prefixes_webhooks" => "IPPrefixesWebhooks",
@@ -878,6 +881,7 @@ module DatadogAPIClient
878
881
  "v2.ci_app_group_by_total" => "CIAppGroupByTotal",
879
882
  "v2.ci_app_host_info" => "CIAppHostInfo",
880
883
  "v2.ci_app_pipeline_event" => "CIAppPipelineEvent",
884
+ "v2.ci_app_pipeline_event_attributes" => "CIAppPipelineEventAttributes",
881
885
  "v2.ci_app_pipeline_event_job" => "CIAppPipelineEventJob",
882
886
  "v2.ci_app_pipeline_event_job_level" => "CIAppPipelineEventJobLevel",
883
887
  "v2.ci_app_pipeline_event_job_status" => "CIAppPipelineEventJobStatus",
@@ -895,6 +899,7 @@ module DatadogAPIClient
895
899
  "v2.ci_app_pipeline_event_step_level" => "CIAppPipelineEventStepLevel",
896
900
  "v2.ci_app_pipeline_event_step_status" => "CIAppPipelineEventStepStatus",
897
901
  "v2.ci_app_pipeline_event_type_name" => "CIAppPipelineEventTypeName",
902
+ "v2.ci_app_pipeline_level" => "CIAppPipelineLevel",
898
903
  "v2.ci_app_pipelines_aggregate_request" => "CIAppPipelinesAggregateRequest",
899
904
  "v2.ci_app_pipelines_aggregation_buckets_response" => "CIAppPipelinesAggregationBucketsResponse",
900
905
  "v2.ci_app_pipelines_analytics_aggregate_response" => "CIAppPipelinesAnalyticsAggregateResponse",
@@ -914,6 +919,7 @@ module DatadogAPIClient
914
919
  "v2.ci_app_test_events_request" => "CIAppTestEventsRequest",
915
920
  "v2.ci_app_test_events_response" => "CIAppTestEventsResponse",
916
921
  "v2.ci_app_test_event_type_name" => "CIAppTestEventTypeName",
922
+ "v2.ci_app_test_level" => "CIAppTestLevel",
917
923
  "v2.ci_app_tests_aggregate_request" => "CIAppTestsAggregateRequest",
918
924
  "v2.ci_app_tests_aggregation_buckets_response" => "CIAppTestsAggregationBucketsResponse",
919
925
  "v2.ci_app_tests_analytics_aggregate_response" => "CIAppTestsAnalyticsAggregateResponse",
@@ -993,6 +999,44 @@ module DatadogAPIClient
993
999
  "v2.detailed_finding" => "DetailedFinding",
994
1000
  "v2.detailed_finding_attributes" => "DetailedFindingAttributes",
995
1001
  "v2.detailed_finding_type" => "DetailedFindingType",
1002
+ "v2.downtime_create_request" => "DowntimeCreateRequest",
1003
+ "v2.downtime_create_request_attributes" => "DowntimeCreateRequestAttributes",
1004
+ "v2.downtime_create_request_data" => "DowntimeCreateRequestData",
1005
+ "v2.downtime_included_monitor_type" => "DowntimeIncludedMonitorType",
1006
+ "v2.downtime_meta" => "DowntimeMeta",
1007
+ "v2.downtime_meta_page" => "DowntimeMetaPage",
1008
+ "v2.downtime_monitor_identifier" => "DowntimeMonitorIdentifier",
1009
+ "v2.downtime_monitor_identifier_id" => "DowntimeMonitorIdentifierId",
1010
+ "v2.downtime_monitor_identifier_tags" => "DowntimeMonitorIdentifierTags",
1011
+ "v2.downtime_monitor_included_attributes" => "DowntimeMonitorIncludedAttributes",
1012
+ "v2.downtime_monitor_included_item" => "DowntimeMonitorIncludedItem",
1013
+ "v2.downtime_notify_end_state_actions" => "DowntimeNotifyEndStateActions",
1014
+ "v2.downtime_notify_end_state_types" => "DowntimeNotifyEndStateTypes",
1015
+ "v2.downtime_relationships" => "DowntimeRelationships",
1016
+ "v2.downtime_relationships_created_by" => "DowntimeRelationshipsCreatedBy",
1017
+ "v2.downtime_relationships_created_by_data" => "DowntimeRelationshipsCreatedByData",
1018
+ "v2.downtime_relationships_monitor" => "DowntimeRelationshipsMonitor",
1019
+ "v2.downtime_relationships_monitor_data" => "DowntimeRelationshipsMonitorData",
1020
+ "v2.downtime_resource_type" => "DowntimeResourceType",
1021
+ "v2.downtime_response" => "DowntimeResponse",
1022
+ "v2.downtime_response_attributes" => "DowntimeResponseAttributes",
1023
+ "v2.downtime_response_data" => "DowntimeResponseData",
1024
+ "v2.downtime_response_included_item" => "DowntimeResponseIncludedItem",
1025
+ "v2.downtime_schedule_create_request" => "DowntimeScheduleCreateRequest",
1026
+ "v2.downtime_schedule_current_downtime_response" => "DowntimeScheduleCurrentDowntimeResponse",
1027
+ "v2.downtime_schedule_one_time_create_update_request" => "DowntimeScheduleOneTimeCreateUpdateRequest",
1028
+ "v2.downtime_schedule_one_time_response" => "DowntimeScheduleOneTimeResponse",
1029
+ "v2.downtime_schedule_recurrence_create_update_request" => "DowntimeScheduleRecurrenceCreateUpdateRequest",
1030
+ "v2.downtime_schedule_recurrence_response" => "DowntimeScheduleRecurrenceResponse",
1031
+ "v2.downtime_schedule_recurrences_create_request" => "DowntimeScheduleRecurrencesCreateRequest",
1032
+ "v2.downtime_schedule_recurrences_response" => "DowntimeScheduleRecurrencesResponse",
1033
+ "v2.downtime_schedule_recurrences_update_request" => "DowntimeScheduleRecurrencesUpdateRequest",
1034
+ "v2.downtime_schedule_response" => "DowntimeScheduleResponse",
1035
+ "v2.downtime_schedule_update_request" => "DowntimeScheduleUpdateRequest",
1036
+ "v2.downtime_status" => "DowntimeStatus",
1037
+ "v2.downtime_update_request" => "DowntimeUpdateRequest",
1038
+ "v2.downtime_update_request_attributes" => "DowntimeUpdateRequestAttributes",
1039
+ "v2.downtime_update_request_data" => "DowntimeUpdateRequestData",
996
1040
  "v2.event" => "Event",
997
1041
  "v2.event_attributes" => "EventAttributes",
998
1042
  "v2.event_priority" => "EventPriority",
@@ -1205,6 +1249,7 @@ module DatadogAPIClient
1205
1249
  "v2.jsonapi_error_item" => "JSONAPIErrorItem",
1206
1250
  "v2.jsonapi_error_response" => "JSONAPIErrorResponse",
1207
1251
  "v2.list_application_keys_response" => "ListApplicationKeysResponse",
1252
+ "v2.list_downtimes_response" => "ListDowntimesResponse",
1208
1253
  "v2.list_findings_meta" => "ListFindingsMeta",
1209
1254
  "v2.list_findings_page" => "ListFindingsPage",
1210
1255
  "v2.list_findings_response" => "ListFindingsResponse",
@@ -1361,6 +1406,10 @@ module DatadogAPIClient
1361
1406
  "v2.monitor_config_policy_tag_policy" => "MonitorConfigPolicyTagPolicy",
1362
1407
  "v2.monitor_config_policy_tag_policy_create_request" => "MonitorConfigPolicyTagPolicyCreateRequest",
1363
1408
  "v2.monitor_config_policy_type" => "MonitorConfigPolicyType",
1409
+ "v2.monitor_downtime_match_resource_type" => "MonitorDowntimeMatchResourceType",
1410
+ "v2.monitor_downtime_match_response" => "MonitorDowntimeMatchResponse",
1411
+ "v2.monitor_downtime_match_response_attributes" => "MonitorDowntimeMatchResponseAttributes",
1412
+ "v2.monitor_downtime_match_response_data" => "MonitorDowntimeMatchResponseData",
1364
1413
  "v2.monitor_type" => "MonitorType",
1365
1414
  "v2.mute_finding_request" => "MuteFindingRequest",
1366
1415
  "v2.mute_finding_request_attributes" => "MuteFindingRequestAttributes",
@@ -1375,6 +1424,7 @@ module DatadogAPIClient
1375
1424
  "v2.on_demand_concurrency_cap" => "OnDemandConcurrencyCap",
1376
1425
  "v2.on_demand_concurrency_cap_attributes" => "OnDemandConcurrencyCapAttributes",
1377
1426
  "v2.on_demand_concurrency_cap_response" => "OnDemandConcurrencyCapResponse",
1427
+ "v2.on_demand_concurrency_cap_type" => "OnDemandConcurrencyCapType",
1378
1428
  "v2.opsgenie_service_create_attributes" => "OpsgenieServiceCreateAttributes",
1379
1429
  "v2.opsgenie_service_create_data" => "OpsgenieServiceCreateData",
1380
1430
  "v2.opsgenie_service_create_request" => "OpsgenieServiceCreateRequest",
@@ -1574,6 +1624,8 @@ module DatadogAPIClient
1574
1624
  "v2.security_monitoring_signal_list_request" => "SecurityMonitoringSignalListRequest",
1575
1625
  "v2.security_monitoring_signal_list_request_filter" => "SecurityMonitoringSignalListRequestFilter",
1576
1626
  "v2.security_monitoring_signal_list_request_page" => "SecurityMonitoringSignalListRequestPage",
1627
+ "v2.security_monitoring_signal_metadata_type" => "SecurityMonitoringSignalMetadataType",
1628
+ "v2.security_monitoring_signal_response" => "SecurityMonitoringSignalResponse",
1577
1629
  "v2.security_monitoring_signal_rule_create_payload" => "SecurityMonitoringSignalRuleCreatePayload",
1578
1630
  "v2.security_monitoring_signal_rule_query" => "SecurityMonitoringSignalRuleQuery",
1579
1631
  "v2.security_monitoring_signal_rule_response" => "SecurityMonitoringSignalRuleResponse",
@@ -1658,6 +1710,7 @@ module DatadogAPIClient
1658
1710
  "v2.service_definition_data_attributes" => "ServiceDefinitionDataAttributes",
1659
1711
  "v2.service_definition_get_response" => "ServiceDefinitionGetResponse",
1660
1712
  "v2.service_definition_meta" => "ServiceDefinitionMeta",
1713
+ "v2.service_definition_meta_warnings" => "ServiceDefinitionMetaWarnings",
1661
1714
  "v2.service_definition_schema" => "ServiceDefinitionSchema",
1662
1715
  "v2.service_definition_schema_versions" => "ServiceDefinitionSchemaVersions",
1663
1716
  "v2.service_definitions_create_request" => "ServiceDefinitionsCreateRequest",
@@ -1703,6 +1756,37 @@ module DatadogAPIClient
1703
1756
  "v2.service_definition_v2_version" => "ServiceDefinitionV2Version",
1704
1757
  "v2.slack_integration_metadata" => "SlackIntegrationMetadata",
1705
1758
  "v2.slack_integration_metadata_channel_item" => "SlackIntegrationMetadataChannelItem",
1759
+ "v2.span" => "Span",
1760
+ "v2.spans_aggregate_bucket" => "SpansAggregateBucket",
1761
+ "v2.spans_aggregate_bucket_attributes" => "SpansAggregateBucketAttributes",
1762
+ "v2.spans_aggregate_bucket_type" => "SpansAggregateBucketType",
1763
+ "v2.spans_aggregate_bucket_value" => "SpansAggregateBucketValue",
1764
+ "v2.spans_aggregate_bucket_value_timeseries_point" => "SpansAggregateBucketValueTimeseriesPoint",
1765
+ "v2.spans_aggregate_data" => "SpansAggregateData",
1766
+ "v2.spans_aggregate_request" => "SpansAggregateRequest",
1767
+ "v2.spans_aggregate_request_attributes" => "SpansAggregateRequestAttributes",
1768
+ "v2.spans_aggregate_request_type" => "SpansAggregateRequestType",
1769
+ "v2.spans_aggregate_response" => "SpansAggregateResponse",
1770
+ "v2.spans_aggregate_response_metadata" => "SpansAggregateResponseMetadata",
1771
+ "v2.spans_aggregate_response_status" => "SpansAggregateResponseStatus",
1772
+ "v2.spans_aggregate_sort" => "SpansAggregateSort",
1773
+ "v2.spans_aggregate_sort_type" => "SpansAggregateSortType",
1774
+ "v2.spans_aggregation_function" => "SpansAggregationFunction",
1775
+ "v2.spans_attributes" => "SpansAttributes",
1776
+ "v2.spans_compute" => "SpansCompute",
1777
+ "v2.spans_compute_type" => "SpansComputeType",
1778
+ "v2.spans_group_by" => "SpansGroupBy",
1779
+ "v2.spans_group_by_histogram" => "SpansGroupByHistogram",
1780
+ "v2.spans_group_by_missing" => "SpansGroupByMissing",
1781
+ "v2.spans_group_by_total" => "SpansGroupByTotal",
1782
+ "v2.spans_list_request" => "SpansListRequest",
1783
+ "v2.spans_list_request_attributes" => "SpansListRequestAttributes",
1784
+ "v2.spans_list_request_data" => "SpansListRequestData",
1785
+ "v2.spans_list_request_page" => "SpansListRequestPage",
1786
+ "v2.spans_list_request_type" => "SpansListRequestType",
1787
+ "v2.spans_list_response" => "SpansListResponse",
1788
+ "v2.spans_list_response_links" => "SpansListResponseLinks",
1789
+ "v2.spans_list_response_metadata" => "SpansListResponseMetadata",
1706
1790
  "v2.spans_metric_compute" => "SpansMetricCompute",
1707
1791
  "v2.spans_metric_compute_aggregation_type" => "SpansMetricComputeAggregationType",
1708
1792
  "v2.spans_metric_create_attributes" => "SpansMetricCreateAttributes",
@@ -1722,13 +1806,19 @@ module DatadogAPIClient
1722
1806
  "v2.spans_metric_update_compute" => "SpansMetricUpdateCompute",
1723
1807
  "v2.spans_metric_update_data" => "SpansMetricUpdateData",
1724
1808
  "v2.spans_metric_update_request" => "SpansMetricUpdateRequest",
1809
+ "v2.spans_query_filter" => "SpansQueryFilter",
1810
+ "v2.spans_query_options" => "SpansQueryOptions",
1811
+ "v2.spans_response_metadata_page" => "SpansResponseMetadataPage",
1812
+ "v2.spans_sort" => "SpansSort",
1813
+ "v2.spans_sort_order" => "SpansSortOrder",
1814
+ "v2.spans_type" => "SpansType",
1815
+ "v2.spans_warning" => "SpansWarning",
1725
1816
  "v2.team" => "Team",
1726
1817
  "v2.team_attributes" => "TeamAttributes",
1727
1818
  "v2.team_create" => "TeamCreate",
1728
1819
  "v2.team_create_attributes" => "TeamCreateAttributes",
1729
1820
  "v2.team_create_relationships" => "TeamCreateRelationships",
1730
1821
  "v2.team_create_request" => "TeamCreateRequest",
1731
- "v2.team_data" => "TeamData",
1732
1822
  "v2.team_included" => "TeamIncluded",
1733
1823
  "v2.team_link" => "TeamLink",
1734
1824
  "v2.team_link_attributes" => "TeamLinkAttributes",
@@ -1748,8 +1838,12 @@ module DatadogAPIClient
1748
1838
  "v2.team_permission_setting_update_request" => "TeamPermissionSettingUpdateRequest",
1749
1839
  "v2.team_permission_setting_value" => "TeamPermissionSettingValue",
1750
1840
  "v2.team_relationships" => "TeamRelationships",
1841
+ "v2.team_relationships_links" => "TeamRelationshipsLinks",
1751
1842
  "v2.team_response" => "TeamResponse",
1752
1843
  "v2.teams_response" => "TeamsResponse",
1844
+ "v2.teams_response_links" => "TeamsResponseLinks",
1845
+ "v2.teams_response_meta" => "TeamsResponseMeta",
1846
+ "v2.teams_response_meta_pagination" => "TeamsResponseMetaPagination",
1753
1847
  "v2.team_type" => "TeamType",
1754
1848
  "v2.team_update" => "TeamUpdate",
1755
1849
  "v2.team_update_attributes" => "TeamUpdateAttributes",
@@ -1850,6 +1944,7 @@ module DatadogAPIClient
1850
1944
  "v2.cloudflare_integration_api" => "CloudflareIntegrationAPI",
1851
1945
  "v2.confluent_cloud_api" => "ConfluentCloudAPI",
1852
1946
  "v2.dashboard_lists_api" => "DashboardListsAPI",
1947
+ "v2.downtimes_api" => "DowntimesAPI",
1853
1948
  "v2.events_api" => "EventsAPI",
1854
1949
  "v2.fastly_integration_api" => "FastlyIntegrationAPI",
1855
1950
  "v2.gcp_integration_api" => "GCPIntegrationAPI",
@@ -1873,6 +1968,7 @@ module DatadogAPIClient
1873
1968
  "v2.sensitive_data_scanner_api" => "SensitiveDataScannerAPI",
1874
1969
  "v2.service_accounts_api" => "ServiceAccountsAPI",
1875
1970
  "v2.service_definition_api" => "ServiceDefinitionAPI",
1971
+ "v2.spans_api" => "SpansAPI",
1876
1972
  "v2.spans_metrics_api" => "SpansMetricsAPI",
1877
1973
  "v2.synthetics_api" => "SyntheticsAPI",
1878
1974
  "v2.teams_api" => "TeamsAPI",
@@ -70,7 +70,7 @@ module DatadogAPIClient::V1
70
70
  return_type = opts[:debug_return_type] || 'SLOCorrectionResponse'
71
71
 
72
72
  # auth_names
73
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
73
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
74
74
 
75
75
  new_options = opts.merge(
76
76
  :operation => :create_slo_correction,
@@ -264,7 +264,7 @@ module DatadogAPIClient::V1
264
264
  return_type = opts[:debug_return_type] || 'SLOCorrectionListResponse'
265
265
 
266
266
  # auth_names
267
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
267
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
268
268
 
269
269
  new_options = opts.merge(
270
270
  :operation => :list_slo_correction,
@@ -70,7 +70,7 @@ module DatadogAPIClient::V1
70
70
  return_type = opts[:debug_return_type] || 'CheckCanDeleteSLOResponse'
71
71
 
72
72
  # auth_names
73
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
73
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
74
74
 
75
75
  new_options = opts.merge(
76
76
  :operation => :check_can_delete_slo,
@@ -137,7 +137,7 @@ module DatadogAPIClient::V1
137
137
  return_type = opts[:debug_return_type] || 'SLOListResponse'
138
138
 
139
139
  # auth_names
140
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
140
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
141
141
 
142
142
  new_options = opts.merge(
143
143
  :operation => :create_slo,
@@ -207,7 +207,7 @@ module DatadogAPIClient::V1
207
207
  return_type = opts[:debug_return_type] || 'SLODeleteResponse'
208
208
 
209
209
  # auth_names
210
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
210
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
211
211
 
212
212
  new_options = opts.merge(
213
213
  :operation => :delete_slo,
@@ -278,7 +278,7 @@ module DatadogAPIClient::V1
278
278
  return_type = opts[:debug_return_type] || 'SLOBulkDeleteResponse'
279
279
 
280
280
  # auth_names
281
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
281
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
282
282
 
283
283
  new_options = opts.merge(
284
284
  :operation => :delete_slo_timeframe_in_bulk,
@@ -345,7 +345,7 @@ module DatadogAPIClient::V1
345
345
  return_type = opts[:debug_return_type] || 'SLOResponse'
346
346
 
347
347
  # auth_names
348
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
348
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
349
349
 
350
350
  new_options = opts.merge(
351
351
  :operation => :get_slo,
@@ -410,7 +410,7 @@ module DatadogAPIClient::V1
410
410
  return_type = opts[:debug_return_type] || 'SLOCorrectionListResponse'
411
411
 
412
412
  # auth_names
413
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
413
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
414
414
 
415
415
  new_options = opts.merge(
416
416
  :operation => :get_slo_corrections,
@@ -504,7 +504,7 @@ module DatadogAPIClient::V1
504
504
  return_type = opts[:debug_return_type] || 'SLOHistoryResponse'
505
505
 
506
506
  # auth_names
507
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
507
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
508
508
 
509
509
  new_options = opts.merge(
510
510
  :operation => :get_slo_history,
@@ -576,7 +576,7 @@ module DatadogAPIClient::V1
576
576
  return_type = opts[:debug_return_type] || 'SLOListResponse'
577
577
 
578
578
  # auth_names
579
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
579
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
580
580
 
581
581
  new_options = opts.merge(
582
582
  :operation => :list_slos,
@@ -644,7 +644,7 @@ module DatadogAPIClient::V1
644
644
  return_type = opts[:debug_return_type] || 'SearchSLOResponse'
645
645
 
646
646
  # auth_names
647
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
647
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
648
648
 
649
649
  new_options = opts.merge(
650
650
  :operation => :search_slo,
@@ -716,7 +716,7 @@ module DatadogAPIClient::V1
716
716
  return_type = opts[:debug_return_type] || 'SLOListResponse'
717
717
 
718
718
  # auth_names
719
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
719
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
720
720
 
721
721
  new_options = opts.merge(
722
722
  :operation => :update_slo,
@@ -152,7 +152,7 @@ module DatadogAPIClient::V1
152
152
  fail ArgumentError, "Missing the required parameter 'usage_type' when calling UsageMeteringAPI.get_hourly_usage_attribution"
153
153
  end
154
154
  # verify enum value
155
- allowable_values = ['api_usage', 'apm_fargate_usage', 'apm_host_usage', 'appsec_fargate_usage', 'appsec_usage', 'browser_usage', 'container_excl_agent_usage', 'container_usage', 'cspm_containers_usage', 'cspm_hosts_usage', 'custom_ingested_timeseries_usage', 'custom_timeseries_usage', 'cws_containers_usage', 'cws_hosts_usage', 'dbm_hosts_usage', 'dbm_queries_usage', 'estimated_indexed_logs_usage', 'estimated_ingested_logs_usage', 'estimated_indexed_spans_usage', 'estimated_ingested_spans_usage', 'fargate_usage', 'functions_usage', 'infra_host_usage', 'invocations_usage', 'npm_host_usage', 'obs_pipeline_bytes_usage', 'profiled_container_usage', 'profiled_fargate_usage', 'profiled_host_usage', 'snmp_usage', 'estimated_rum_sessions_usage', 'universal_service_monitoring_usage', 'vuln_management_hosts_usage']
155
+ allowable_values = ['api_usage', 'apm_fargate_usage', 'apm_host_usage', 'apm_usm_usage', 'appsec_fargate_usage', 'appsec_usage', 'browser_usage', 'container_excl_agent_usage', 'ci_visibility_itr_usage', 'container_usage', 'cspm_containers_usage', 'cspm_hosts_usage', 'custom_ingested_timeseries_usage', 'custom_timeseries_usage', 'cws_containers_usage', 'cws_hosts_usage', 'dbm_hosts_usage', 'dbm_queries_usage', 'estimated_indexed_logs_usage', 'estimated_ingested_logs_usage', 'estimated_indexed_spans_usage', 'estimated_ingested_spans_usage', 'fargate_usage', 'functions_usage', 'infra_host_usage', 'invocations_usage', 'npm_host_usage', 'obs_pipeline_bytes_usage', 'profiled_container_usage', 'profiled_fargate_usage', 'profiled_host_usage', 'snmp_usage', 'estimated_rum_sessions_usage', 'universal_service_monitoring_usage', 'vuln_management_hosts_usage', 'sds_scanned_bytes_usage']
156
156
  if @api_client.config.client_side_validation && !allowable_values.include?(usage_type)
157
157
  fail ArgumentError, "invalid value for \"usage_type\", must be one of #{allowable_values}"
158
158
  end
@@ -472,7 +472,7 @@ module DatadogAPIClient::V1
472
472
  fail ArgumentError, "Missing the required parameter 'fields' when calling UsageMeteringAPI.get_monthly_usage_attribution"
473
473
  end
474
474
  # verify enum value
475
- allowable_values = ['api_usage', 'api_percentage', 'apm_fargate_usage', 'apm_fargate_percentage', 'appsec_fargate_usage', 'appsec_fargate_percentage', 'apm_host_usage', 'apm_host_percentage', 'appsec_usage', 'appsec_percentage', 'browser_usage', 'browser_percentage', 'container_excl_agent_usage', 'container_excl_agent_percentage', 'container_usage', 'container_percentage', 'cspm_containers_percentage', 'cspm_containers_usage', 'cspm_hosts_percentage', 'cspm_hosts_usage', 'custom_timeseries_usage', 'custom_timeseries_percentage', 'custom_ingested_timeseries_usage', 'custom_ingested_timeseries_percentage', 'cws_containers_percentage', 'cws_containers_usage', 'cws_hosts_percentage', 'cws_hosts_usage', 'dbm_hosts_percentage', 'dbm_hosts_usage', 'dbm_queries_percentage', 'dbm_queries_usage', 'estimated_indexed_logs_usage', 'estimated_indexed_logs_percentage', 'estimated_ingested_logs_usage', 'estimated_ingested_logs_percentage', 'estimated_indexed_spans_usage', 'estimated_indexed_spans_percentage', 'estimated_ingested_spans_usage', 'estimated_ingested_spans_percentage', 'fargate_usage', 'fargate_percentage', 'functions_usage', 'functions_percentage', 'infra_host_usage', 'infra_host_percentage', 'invocations_usage', 'invocations_percentage', 'npm_host_usage', 'npm_host_percentage', 'obs_pipeline_bytes_usage', 'obs_pipeline_bytes_percentage', 'profiled_container_usage', 'profiled_container_percentage', 'profiled_fargate_usage', 'profiled_fargate_percentage', 'profiled_host_usage', 'profiled_host_percentage', 'snmp_usage', 'snmp_percentage', 'estimated_rum_sessions_usage', 'estimated_rum_sessions_percentage', 'universal_service_monitoring_usage', 'universal_service_monitoring_percentage', 'vuln_management_hosts_usage', 'vuln_management_hosts_percentage', '*']
475
+ allowable_values = ['api_usage', 'api_percentage', 'apm_fargate_usage', 'apm_fargate_percentage', 'appsec_fargate_usage', 'appsec_fargate_percentage', 'apm_host_usage', 'apm_host_percentage', 'apm_usm_usage', 'apm_usm_percentage', 'appsec_usage', 'appsec_percentage', 'browser_usage', 'browser_percentage', 'ci_visibility_itr_usage', 'ci_visibility_itr_percentage', 'container_excl_agent_usage', 'container_excl_agent_percentage', 'container_usage', 'container_percentage', 'cspm_containers_percentage', 'cspm_containers_usage', 'cspm_hosts_percentage', 'cspm_hosts_usage', 'custom_timeseries_usage', 'custom_timeseries_percentage', 'custom_ingested_timeseries_usage', 'custom_ingested_timeseries_percentage', 'cws_containers_percentage', 'cws_containers_usage', 'cws_hosts_percentage', 'cws_hosts_usage', 'dbm_hosts_percentage', 'dbm_hosts_usage', 'dbm_queries_percentage', 'dbm_queries_usage', 'estimated_indexed_logs_usage', 'estimated_indexed_logs_percentage', 'estimated_ingested_logs_usage', 'estimated_ingested_logs_percentage', 'estimated_indexed_spans_usage', 'estimated_indexed_spans_percentage', 'estimated_ingested_spans_usage', 'estimated_ingested_spans_percentage', 'fargate_usage', 'fargate_percentage', 'functions_usage', 'functions_percentage', 'infra_host_usage', 'infra_host_percentage', 'invocations_usage', 'invocations_percentage', 'npm_host_usage', 'npm_host_percentage', 'obs_pipeline_bytes_usage', 'obs_pipeline_bytes_percentage', 'profiled_container_usage', 'profiled_container_percentage', 'profiled_fargate_usage', 'profiled_fargate_percentage', 'profiled_host_usage', 'profiled_host_percentage', 'snmp_usage', 'snmp_percentage', 'estimated_rum_sessions_usage', 'estimated_rum_sessions_percentage', 'universal_service_monitoring_usage', 'universal_service_monitoring_percentage', 'vuln_management_hosts_usage', 'vuln_management_hosts_percentage', 'sds_scanned_bytes_usage', 'sds_scanned_bytes_percentage', '*']
476
476
  if @api_client.config.client_side_validation && !allowable_values.include?(fields)
477
477
  fail ArgumentError, "invalid value for \"fields\", must be one of #{allowable_values}"
478
478
  end
@@ -480,7 +480,7 @@ module DatadogAPIClient::V1
480
480
  if @api_client.config.client_side_validation && opts[:'sort_direction'] && !allowable_values.include?(opts[:'sort_direction'])
481
481
  fail ArgumentError, "invalid value for \"sort_direction\", must be one of #{allowable_values}"
482
482
  end
483
- allowable_values = ['api_usage', 'api_percentage', 'apm_fargate_usage', 'apm_fargate_percentage', 'appsec_fargate_usage', 'appsec_fargate_percentage', 'apm_host_usage', 'apm_host_percentage', 'appsec_usage', 'appsec_percentage', 'browser_usage', 'browser_percentage', 'container_excl_agent_usage', 'container_excl_agent_percentage', 'container_usage', 'container_percentage', 'cspm_containers_percentage', 'cspm_containers_usage', 'cspm_hosts_percentage', 'cspm_hosts_usage', 'custom_timeseries_usage', 'custom_timeseries_percentage', 'custom_ingested_timeseries_usage', 'custom_ingested_timeseries_percentage', 'cws_containers_percentage', 'cws_containers_usage', 'cws_hosts_percentage', 'cws_hosts_usage', 'dbm_hosts_percentage', 'dbm_hosts_usage', 'dbm_queries_percentage', 'dbm_queries_usage', 'estimated_indexed_logs_usage', 'estimated_indexed_logs_percentage', 'estimated_ingested_logs_usage', 'estimated_ingested_logs_percentage', 'estimated_indexed_spans_usage', 'estimated_indexed_spans_percentage', 'estimated_ingested_spans_usage', 'estimated_ingested_spans_percentage', 'fargate_usage', 'fargate_percentage', 'functions_usage', 'functions_percentage', 'infra_host_usage', 'infra_host_percentage', 'invocations_usage', 'invocations_percentage', 'npm_host_usage', 'npm_host_percentage', 'obs_pipeline_bytes_usage', 'obs_pipeline_bytes_percentage', 'profiled_container_usage', 'profiled_container_percentage', 'profiled_fargate_usage', 'profiled_fargate_percentage', 'profiled_host_usage', 'profiled_host_percentage', 'snmp_usage', 'snmp_percentage', 'estimated_rum_sessions_usage', 'estimated_rum_sessions_percentage', 'universal_service_monitoring_usage', 'universal_service_monitoring_percentage', 'vuln_management_hosts_usage', 'vuln_management_hosts_percentage', '*']
483
+ allowable_values = ['api_usage', 'api_percentage', 'apm_fargate_usage', 'apm_fargate_percentage', 'appsec_fargate_usage', 'appsec_fargate_percentage', 'apm_host_usage', 'apm_host_percentage', 'apm_usm_usage', 'apm_usm_percentage', 'appsec_usage', 'appsec_percentage', 'browser_usage', 'browser_percentage', 'ci_visibility_itr_usage', 'ci_visibility_itr_percentage', 'container_excl_agent_usage', 'container_excl_agent_percentage', 'container_usage', 'container_percentage', 'cspm_containers_percentage', 'cspm_containers_usage', 'cspm_hosts_percentage', 'cspm_hosts_usage', 'custom_timeseries_usage', 'custom_timeseries_percentage', 'custom_ingested_timeseries_usage', 'custom_ingested_timeseries_percentage', 'cws_containers_percentage', 'cws_containers_usage', 'cws_hosts_percentage', 'cws_hosts_usage', 'dbm_hosts_percentage', 'dbm_hosts_usage', 'dbm_queries_percentage', 'dbm_queries_usage', 'estimated_indexed_logs_usage', 'estimated_indexed_logs_percentage', 'estimated_ingested_logs_usage', 'estimated_ingested_logs_percentage', 'estimated_indexed_spans_usage', 'estimated_indexed_spans_percentage', 'estimated_ingested_spans_usage', 'estimated_ingested_spans_percentage', 'fargate_usage', 'fargate_percentage', 'functions_usage', 'functions_percentage', 'infra_host_usage', 'infra_host_percentage', 'invocations_usage', 'invocations_percentage', 'npm_host_usage', 'npm_host_percentage', 'obs_pipeline_bytes_usage', 'obs_pipeline_bytes_percentage', 'profiled_container_usage', 'profiled_container_percentage', 'profiled_fargate_usage', 'profiled_fargate_percentage', 'profiled_host_usage', 'profiled_host_percentage', 'snmp_usage', 'snmp_percentage', 'estimated_rum_sessions_usage', 'estimated_rum_sessions_percentage', 'universal_service_monitoring_usage', 'universal_service_monitoring_percentage', 'vuln_management_hosts_usage', 'vuln_management_hosts_percentage', 'sds_scanned_bytes_usage', 'sds_scanned_bytes_percentage', '*']
484
484
  if @api_client.config.client_side_validation && opts[:'sort_name'] && !allowable_values.include?(opts[:'sort_name'])
485
485
  fail ArgumentError, "invalid value for \"sort_name\", must be one of #{allowable_values}"
486
486
  end