datadog_api_client 2.0.2 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +6 -6
  3. data/.generator/poetry.lock +21 -14
  4. data/.generator/pyproject.toml +1 -1
  5. data/.generator/schemas/v1/openapi.yaml +840 -908
  6. data/.generator/schemas/v2/openapi.yaml +1304 -913
  7. data/.generator/src/generator/formatter.py +1 -1
  8. data/.generator/src/generator/templates/api_client.j2 +5 -1
  9. data/.generator/src/generator/templates/configuration.j2 +17 -0
  10. data/.github/workflows/test.yml +4 -1
  11. data/.github/workflows/test_integration.yml +5 -0
  12. data/.pre-commit-config.yaml +1 -1
  13. data/CHANGELOG.md +49 -0
  14. data/README.md +11 -0
  15. data/examples/v1/dashboards/CreateDashboard_1094917386.rb +37 -0
  16. data/examples/v1/dashboards/CreateDashboard_1307120899.rb +61 -0
  17. data/examples/v1/dashboards/CreateDashboard_1423904722.rb +38 -0
  18. data/examples/v1/dashboards/CreateDashboard_2652180930.rb +43 -0
  19. data/examples/v1/dashboards/CreateDashboard_2850365602.rb +55 -0
  20. data/examples/v1/dashboards/CreateDashboard_3117424216.rb +33 -0
  21. data/examples/v1/dashboards/CreateDashboard_3669695268.rb +50 -0
  22. data/examples/v1/dashboards/CreateDashboard_858397694.rb +41 -0
  23. data/examples/v1/monitors/ValidateExistingMonitor.rb +1 -0
  24. data/examples/v1/monitors/ValidateMonitor.rb +1 -0
  25. data/examples/v1/monitors/ValidateMonitor_4247196452.rb +38 -0
  26. data/examples/v1/synthetics/CreateGlobalVariable.rb +1 -0
  27. data/examples/v1/synthetics/CreateGlobalVariable_1068962881.rb +23 -0
  28. data/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.rb +10 -0
  29. data/examples/v1/synthetics/CreateSyntheticsBrowserTest_2932742688.rb +6 -0
  30. data/examples/v1/synthetics/EditGlobalVariable.rb +1 -0
  31. data/examples/v1/synthetics/UpdateBrowserTest.rb +1 -0
  32. data/examples/v1/usage-metering/GetDailyCustomReports.rb +0 -3
  33. data/examples/v1/usage-metering/GetMonthlyCustomReports.rb +0 -3
  34. data/examples/v1/usage-metering/GetSpecifiedDailyCustomReports.rb +0 -3
  35. data/examples/v1/usage-metering/GetSpecifiedMonthlyCustomReports.rb +0 -3
  36. data/examples/v1/usage-metering/GetUsageAttribution.rb +0 -3
  37. data/examples/v2/incidents/ListIncidentAttachments.rb +8 -0
  38. data/examples/v2/incidents/ListIncidentAttachments_2457735435.rb +11 -0
  39. data/examples/v2/incidents/UpdateIncidentAttachments.rb +38 -0
  40. data/examples/v2/incidents/UpdateIncidentAttachments_3881702075.rb +26 -0
  41. data/examples/v2/metrics/ListActiveMetricConfigurations.rb +5 -0
  42. data/examples/v2/metrics/ListTagConfigurations.rb +1 -1
  43. data/examples/v2/metrics/ListTagConfigurations_265033704.rb +8 -0
  44. data/examples/v2/metrics/{ListTagConfigurations_103226315.rb → ListTagConfigurations_2739018321.rb} +1 -1
  45. data/examples/v2/metrics/SubmitMetrics_1762007427.rb +23 -0
  46. data/examples/v2/roles/UpdateRole.rb +13 -0
  47. data/examples/v2/rum/CreateRUMApplication.rb +15 -0
  48. data/examples/v2/rum/DeleteRUMApplication.rb +8 -0
  49. data/examples/v2/rum/GetRUMApplication.rb +8 -0
  50. data/examples/v2/rum/GetRUMApplications.rb +5 -0
  51. data/examples/v2/rum/UpdateRUMApplication.rb +16 -0
  52. data/examples/v2/security-monitoring/CreateSecurityMonitoringRule.rb +3 -2
  53. data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_461183901.rb +2 -2
  54. data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_498211763.rb +2 -2
  55. data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_914562040.rb +50 -0
  56. data/examples/v2/security-monitoring/GetSecurityMonitoringSignal.rb +5 -0
  57. data/examples/v2/security-monitoring/UpdateSecurityMonitoringRule.rb +2 -1
  58. data/examples/v2/usage-metering/GetEstimatedCostByOrg.rb +1 -4
  59. data/examples/v2/usage-metering/GetEstimatedCostByOrg_2734954020.rb +2 -4
  60. data/examples/v2/usage-metering/GetEstimatedCostByOrg_3186693804.rb +2 -4
  61. data/examples/v2/usage-metering/GetHistoricalCostByOrg.rb +8 -0
  62. data/examples/v2/usage-metering/GetHourlyUsage.rb +5 -0
  63. data/generate.sh +30 -0
  64. data/lib/datadog_api_client/api_client.rb +5 -1
  65. data/lib/datadog_api_client/configuration.rb +20 -6
  66. data/lib/datadog_api_client/inflector.rb +67 -1
  67. data/lib/datadog_api_client/v1/api/metrics_api.rb +1 -1
  68. data/lib/datadog_api_client/v1/api/service_level_objectives_api.rb +3 -1
  69. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +42 -62
  70. data/lib/datadog_api_client/v1/models/dashboard_template_variable.rb +14 -2
  71. data/lib/datadog_api_client/v1/models/dashboard_template_variable_preset_value.rb +28 -5
  72. data/lib/datadog_api_client/v1/models/formula_and_function_event_query_definition.rb +14 -4
  73. data/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb +1 -0
  74. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +2 -0
  75. data/lib/datadog_api_client/v1/models/list_stream_query.rb +14 -4
  76. data/lib/datadog_api_client/v1/models/list_stream_source.rb +1 -0
  77. data/lib/datadog_api_client/v1/models/metric_content_encoding.rb +1 -0
  78. data/lib/datadog_api_client/v1/models/monitor_options.rb +28 -1
  79. data/lib/datadog_api_client/v1/models/monitor_summary_widget_definition.rb +13 -1
  80. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +4 -0
  81. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +41 -1
  82. data/lib/datadog_api_client/v1/models/on_missing_data_option.rb +33 -0
  83. data/lib/datadog_api_client/v1/models/search_service_level_objective.rb +111 -0
  84. data/lib/datadog_api_client/v1/models/search_service_level_objective_attributes.rb +286 -0
  85. data/lib/datadog_api_client/v1/models/search_service_level_objective_data.rb +134 -0
  86. data/lib/datadog_api_client/v1/models/search_slo_query.rb +137 -0
  87. data/lib/datadog_api_client/v1/models/search_slo_response_data_attributes.rb +8 -8
  88. data/lib/datadog_api_client/v1/models/search_slo_response_links.rb +2 -0
  89. data/lib/datadog_api_client/v1/models/search_slo_threshold.rb +184 -0
  90. data/lib/datadog_api_client/v1/models/search_slo_timeframe.rb +28 -0
  91. data/lib/datadog_api_client/v1/models/slo_creator.rb +131 -0
  92. data/lib/datadog_api_client/v1/models/slo_list_widget_definition.rb +185 -0
  93. data/lib/datadog_api_client/v1/models/slo_list_widget_definition_type.rb +26 -0
  94. data/lib/datadog_api_client/v1/models/slo_list_widget_query.rb +149 -0
  95. data/lib/datadog_api_client/v1/models/slo_list_widget_request.rb +143 -0
  96. data/lib/datadog_api_client/v1/models/slo_list_widget_request_type.rb +26 -0
  97. data/lib/datadog_api_client/v1/models/slo_overall_statuses.rb +174 -0
  98. data/lib/datadog_api_client/v1/models/slo_raw_error_budget_remaining.rb +121 -0
  99. data/lib/datadog_api_client/v1/models/synthetics_assertion_operator.rb +1 -0
  100. data/lib/datadog_api_client/v1/models/synthetics_basic_auth.rb +2 -1
  101. data/lib/datadog_api_client/v1/models/synthetics_basic_auth_digest.rb +155 -0
  102. data/lib/datadog_api_client/v1/models/synthetics_basic_auth_digest_type.rb +26 -0
  103. data/lib/datadog_api_client/v1/models/synthetics_global_variable_parse_test_options.rb +11 -12
  104. data/lib/datadog_api_client/v1/models/synthetics_global_variable_parse_test_options_type.rb +1 -0
  105. data/lib/datadog_api_client/v1/models/synthetics_test_options.rb +31 -1
  106. data/lib/datadog_api_client/v1/models/synthetics_test_process_status.rb +0 -1
  107. data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +15 -1
  108. data/lib/datadog_api_client/v1/models/topology_map_widget_definition.rb +193 -0
  109. data/lib/datadog_api_client/v1/models/topology_map_widget_definition_type.rb +26 -0
  110. data/lib/datadog_api_client/v1/models/topology_query.rb +144 -0
  111. data/lib/datadog_api_client/v1/models/topology_query_data_source.rb +27 -0
  112. data/lib/datadog_api_client/v1/models/topology_request.rb +121 -0
  113. data/lib/datadog_api_client/v1/models/topology_request_type.rb +26 -0
  114. data/lib/datadog_api_client/v1/models/usage_attribution_sort.rb +4 -0
  115. data/lib/datadog_api_client/v1/models/usage_attribution_supported_metrics.rb +4 -0
  116. data/lib/datadog_api_client/v1/models/usage_attribution_values.rb +41 -1
  117. data/lib/datadog_api_client/v1/models/usage_billable_summary_hour.rb +11 -1
  118. data/lib/datadog_api_client/v1/models/usage_cloud_security_posture_management_hour.rb +12 -1
  119. data/lib/datadog_api_client/v1/models/usage_fargate_hour.rb +11 -1
  120. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +21 -1
  121. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +31 -1
  122. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +21 -1
  123. data/lib/datadog_api_client/v1/models/widget_definition.rb +3 -1
  124. data/lib/datadog_api_client/v1/models/widget_monitor_summary_sort.rb +2 -0
  125. data/lib/datadog_api_client/v2/api/events_api.rb +1 -1
  126. data/lib/datadog_api_client/v2/api/incident_services_api.rb +2 -2
  127. data/lib/datadog_api_client/v2/api/incident_teams_api.rb +2 -2
  128. data/lib/datadog_api_client/v2/api/incidents_api.rb +155 -0
  129. data/lib/datadog_api_client/v2/api/logs_api.rb +1 -1
  130. data/lib/datadog_api_client/v2/api/metrics_api.rb +77 -9
  131. data/lib/datadog_api_client/v2/api/rum_api.rb +329 -0
  132. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +68 -3
  133. data/lib/datadog_api_client/v2/api/usage_metering_api.rb +83 -17
  134. data/lib/datadog_api_client/v2/models/content_encoding.rb +1 -0
  135. data/lib/datadog_api_client/v2/models/incident_attachment_attachment_type.rb +27 -0
  136. data/lib/datadog_api_client/v2/models/incident_attachment_attributes.rb +63 -0
  137. data/lib/datadog_api_client/v2/models/incident_attachment_data.rb +187 -0
  138. data/lib/datadog_api_client/v2/models/incident_attachment_link_attachment_type.rb +26 -0
  139. data/lib/datadog_api_client/v2/models/incident_attachment_link_attributes.rb +145 -0
  140. data/lib/datadog_api_client/v2/models/incident_attachment_link_attributes_attachment_object.rb +143 -0
  141. data/lib/datadog_api_client/v2/models/incident_attachment_postmortem_attachment_type.rb +26 -0
  142. data/lib/datadog_api_client/v2/models/incident_attachment_postmortem_attributes.rb +145 -0
  143. data/lib/datadog_api_client/v2/models/incident_attachment_related_object.rb +26 -0
  144. data/lib/datadog_api_client/v2/models/incident_attachment_relationships.rb +111 -0
  145. data/lib/datadog_api_client/v2/models/incident_attachment_type.rb +26 -0
  146. data/lib/datadog_api_client/v2/models/incident_attachment_update_attributes.rb +63 -0
  147. data/lib/datadog_api_client/v2/models/incident_attachment_update_data.rb +144 -0
  148. data/lib/datadog_api_client/v2/models/incident_attachment_update_request.rb +127 -0
  149. data/lib/datadog_api_client/v2/models/incident_attachment_update_response.rb +137 -0
  150. data/lib/datadog_api_client/v2/models/incident_attachments_postmortem_attributes_attachment_object.rb +143 -0
  151. data/lib/datadog_api_client/v2/models/incident_attachments_response.rb +136 -0
  152. data/lib/datadog_api_client/v2/models/incident_attachments_response_included_item.rb +62 -0
  153. data/lib/datadog_api_client/v2/models/incident_related_object.rb +1 -0
  154. data/lib/datadog_api_client/v2/models/incident_response_attributes.rb +1 -11
  155. data/lib/datadog_api_client/v2/models/incident_response_included_item.rb +2 -1
  156. data/lib/datadog_api_client/v2/models/incident_response_relationships.rb +14 -14
  157. data/lib/datadog_api_client/v2/models/metric_active_configuration_type.rb +26 -0
  158. data/lib/datadog_api_client/v2/models/metric_content_encoding.rb +2 -0
  159. data/lib/datadog_api_client/v2/models/metric_suggested_tags_and_aggregations.rb +133 -0
  160. data/lib/datadog_api_client/v2/models/metric_suggested_tags_and_aggregations_response.rb +111 -0
  161. data/lib/datadog_api_client/v2/models/metric_suggested_tags_attributes.rb +125 -0
  162. data/lib/datadog_api_client/v2/models/relationship_to_incident_attachment.rb +124 -0
  163. data/lib/datadog_api_client/v2/models/relationship_to_incident_attachment_data.rb +145 -0
  164. data/lib/datadog_api_client/v2/models/role_update_data.rb +11 -1
  165. data/lib/datadog_api_client/v2/models/rum_application.rb +166 -0
  166. data/lib/datadog_api_client/v2/models/rum_application_attributes.rb +279 -0
  167. data/lib/datadog_api_client/v2/models/rum_application_create.rb +145 -0
  168. data/lib/datadog_api_client/v2/models/rum_application_create_attributes.rb +132 -0
  169. data/lib/datadog_api_client/v2/models/rum_application_create_request.rb +122 -0
  170. data/lib/datadog_api_client/v2/models/rum_application_create_type.rb +26 -0
  171. data/lib/datadog_api_client/v2/models/rum_application_response.rb +111 -0
  172. data/lib/datadog_api_client/v2/models/rum_application_type.rb +26 -0
  173. data/lib/datadog_api_client/v2/models/rum_application_update.rb +155 -0
  174. data/lib/datadog_api_client/v2/models/rum_application_update_attributes.rb +121 -0
  175. data/lib/datadog_api_client/v2/models/rum_application_update_request.rb +122 -0
  176. data/lib/datadog_api_client/v2/models/rum_application_update_type.rb +26 -0
  177. data/lib/datadog_api_client/v2/models/rum_applications_response.rb +113 -0
  178. data/lib/datadog_api_client/v2/models/security_monitoring_rule_create_payload.rb +36 -248
  179. data/lib/datadog_api_client/v2/models/security_monitoring_rule_query.rb +36 -151
  180. data/lib/datadog_api_client/v2/models/security_monitoring_rule_query_aggregation.rb +1 -0
  181. data/lib/datadog_api_client/v2/models/security_monitoring_rule_response.rb +37 -253
  182. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_create_payload.rb +275 -0
  183. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_query.rb +187 -0
  184. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_response.rb +279 -0
  185. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_type.rb +26 -0
  186. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_create_payload.rb +275 -0
  187. data/lib/datadog_api_client/v2/models/{security_monitoring_rule_query_create.rb → security_monitoring_standard_rule_query.rb} +3 -3
  188. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_response.rb +279 -0
  189. data/lib/datadog_api_client/version.rb +1 -1
  190. metadata +97 -6
  191. data/Makefile +0 -7
  192. data/examples/v2/metrics/ListTagConfigurations_1799362914.rb +0 -8
@@ -90,6 +90,263 @@ module DatadogAPIClient::V2
90
90
  return data, status_code, headers
91
91
  end
92
92
 
93
+ # Create a new RUM application.
94
+ #
95
+ # @see #create_rum_application_with_http_info
96
+ def create_rum_application(body, opts = {})
97
+ data, _status_code, _headers = create_rum_application_with_http_info(body, opts)
98
+ data
99
+ end
100
+
101
+ # Create a new RUM application.
102
+ #
103
+ # Create a new RUM application in your organization.
104
+ #
105
+ # @param body [RUMApplicationCreateRequest]
106
+ # @param opts [Hash] the optional parameters
107
+ # @return [Array<(RUMApplicationResponse, Integer, Hash)>] RUMApplicationResponse data, response status code and response headers
108
+ def create_rum_application_with_http_info(body, opts = {})
109
+
110
+ if @api_client.config.debugging
111
+ @api_client.config.logger.debug 'Calling API: RUMAPI.create_rum_application ...'
112
+ end
113
+ # verify the required parameter 'body' is set
114
+ if @api_client.config.client_side_validation && body.nil?
115
+ fail ArgumentError, "Missing the required parameter 'body' when calling RUMAPI.create_rum_application"
116
+ end
117
+ # resource path
118
+ local_var_path = '/api/v2/rum/applications'
119
+
120
+ # query parameters
121
+ query_params = opts[:query_params] || {}
122
+
123
+ # header parameters
124
+ header_params = opts[:header_params] || {}
125
+ # HTTP header 'Accept' (if needed)
126
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
127
+ # HTTP header 'Content-Type'
128
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
129
+
130
+ # form parameters
131
+ form_params = opts[:form_params] || {}
132
+
133
+ # http body (model)
134
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
135
+
136
+ # return_type
137
+ return_type = opts[:debug_return_type] || 'RUMApplicationResponse'
138
+
139
+ # auth_names
140
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
141
+
142
+ new_options = opts.merge(
143
+ :operation => :create_rum_application,
144
+ :header_params => header_params,
145
+ :query_params => query_params,
146
+ :form_params => form_params,
147
+ :body => post_body,
148
+ :auth_names => auth_names,
149
+ :return_type => return_type,
150
+ :api_version => "V2"
151
+ )
152
+
153
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
154
+ if @api_client.config.debugging
155
+ @api_client.config.logger.debug "API called: RUMAPI#create_rum_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
156
+ end
157
+ return data, status_code, headers
158
+ end
159
+
160
+ # Delete a RUM application.
161
+ #
162
+ # @see #delete_rum_application_with_http_info
163
+ def delete_rum_application(id, opts = {})
164
+ delete_rum_application_with_http_info(id, opts)
165
+ nil
166
+ end
167
+
168
+ # Delete a RUM application.
169
+ #
170
+ # Delete an existing RUM application in your organization.
171
+ #
172
+ # @param id [String] RUM application ID.
173
+ # @param opts [Hash] the optional parameters
174
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
175
+ def delete_rum_application_with_http_info(id, opts = {})
176
+
177
+ if @api_client.config.debugging
178
+ @api_client.config.logger.debug 'Calling API: RUMAPI.delete_rum_application ...'
179
+ end
180
+ # verify the required parameter 'id' is set
181
+ if @api_client.config.client_side_validation && id.nil?
182
+ fail ArgumentError, "Missing the required parameter 'id' when calling RUMAPI.delete_rum_application"
183
+ end
184
+ # resource path
185
+ local_var_path = '/api/v2/rum/applications/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))
186
+
187
+ # query parameters
188
+ query_params = opts[:query_params] || {}
189
+
190
+ # header parameters
191
+ header_params = opts[:header_params] || {}
192
+ # HTTP header 'Accept' (if needed)
193
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
194
+
195
+ # form parameters
196
+ form_params = opts[:form_params] || {}
197
+
198
+ # http body (model)
199
+ post_body = opts[:debug_body]
200
+
201
+ # return_type
202
+ return_type = opts[:debug_return_type]
203
+
204
+ # auth_names
205
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
206
+
207
+ new_options = opts.merge(
208
+ :operation => :delete_rum_application,
209
+ :header_params => header_params,
210
+ :query_params => query_params,
211
+ :form_params => form_params,
212
+ :body => post_body,
213
+ :auth_names => auth_names,
214
+ :return_type => return_type,
215
+ :api_version => "V2"
216
+ )
217
+
218
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
219
+ if @api_client.config.debugging
220
+ @api_client.config.logger.debug "API called: RUMAPI#delete_rum_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
221
+ end
222
+ return data, status_code, headers
223
+ end
224
+
225
+ # Get a RUM application.
226
+ #
227
+ # @see #get_rum_application_with_http_info
228
+ def get_rum_application(id, opts = {})
229
+ data, _status_code, _headers = get_rum_application_with_http_info(id, opts)
230
+ data
231
+ end
232
+
233
+ # Get a RUM application.
234
+ #
235
+ # Get the RUM application with given ID in your organization.
236
+ #
237
+ # @param id [String] RUM application ID.
238
+ # @param opts [Hash] the optional parameters
239
+ # @return [Array<(RUMApplicationResponse, Integer, Hash)>] RUMApplicationResponse data, response status code and response headers
240
+ def get_rum_application_with_http_info(id, opts = {})
241
+
242
+ if @api_client.config.debugging
243
+ @api_client.config.logger.debug 'Calling API: RUMAPI.get_rum_application ...'
244
+ end
245
+ # verify the required parameter 'id' is set
246
+ if @api_client.config.client_side_validation && id.nil?
247
+ fail ArgumentError, "Missing the required parameter 'id' when calling RUMAPI.get_rum_application"
248
+ end
249
+ # resource path
250
+ local_var_path = '/api/v2/rum/applications/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))
251
+
252
+ # query parameters
253
+ query_params = opts[:query_params] || {}
254
+
255
+ # header parameters
256
+ header_params = opts[:header_params] || {}
257
+ # HTTP header 'Accept' (if needed)
258
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
259
+
260
+ # form parameters
261
+ form_params = opts[:form_params] || {}
262
+
263
+ # http body (model)
264
+ post_body = opts[:debug_body]
265
+
266
+ # return_type
267
+ return_type = opts[:debug_return_type] || 'RUMApplicationResponse'
268
+
269
+ # auth_names
270
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
271
+
272
+ new_options = opts.merge(
273
+ :operation => :get_rum_application,
274
+ :header_params => header_params,
275
+ :query_params => query_params,
276
+ :form_params => form_params,
277
+ :body => post_body,
278
+ :auth_names => auth_names,
279
+ :return_type => return_type,
280
+ :api_version => "V2"
281
+ )
282
+
283
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
284
+ if @api_client.config.debugging
285
+ @api_client.config.logger.debug "API called: RUMAPI#get_rum_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
286
+ end
287
+ return data, status_code, headers
288
+ end
289
+
290
+ # List all the RUM applications.
291
+ #
292
+ # @see #get_rum_applications_with_http_info
293
+ def get_rum_applications(opts = {})
294
+ data, _status_code, _headers = get_rum_applications_with_http_info(opts)
295
+ data
296
+ end
297
+
298
+ # List all the RUM applications.
299
+ #
300
+ # List all the RUM applications in your organization.
301
+ #
302
+ # @param opts [Hash] the optional parameters
303
+ # @return [Array<(RUMApplicationsResponse, Integer, Hash)>] RUMApplicationsResponse data, response status code and response headers
304
+ def get_rum_applications_with_http_info(opts = {})
305
+
306
+ if @api_client.config.debugging
307
+ @api_client.config.logger.debug 'Calling API: RUMAPI.get_rum_applications ...'
308
+ end
309
+ # resource path
310
+ local_var_path = '/api/v2/rum/applications'
311
+
312
+ # query parameters
313
+ query_params = opts[:query_params] || {}
314
+
315
+ # header parameters
316
+ header_params = opts[:header_params] || {}
317
+ # HTTP header 'Accept' (if needed)
318
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
319
+
320
+ # form parameters
321
+ form_params = opts[:form_params] || {}
322
+
323
+ # http body (model)
324
+ post_body = opts[:debug_body]
325
+
326
+ # return_type
327
+ return_type = opts[:debug_return_type] || 'RUMApplicationsResponse'
328
+
329
+ # auth_names
330
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
331
+
332
+ new_options = opts.merge(
333
+ :operation => :get_rum_applications,
334
+ :header_params => header_params,
335
+ :query_params => query_params,
336
+ :form_params => form_params,
337
+ :body => post_body,
338
+ :auth_names => auth_names,
339
+ :return_type => return_type,
340
+ :api_version => "V2"
341
+ )
342
+
343
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
344
+ if @api_client.config.debugging
345
+ @api_client.config.logger.debug "API called: RUMAPI#get_rum_applications\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
346
+ end
347
+ return data, status_code, headers
348
+ end
349
+
93
350
  # Get a list of RUM events.
94
351
  #
95
352
  # @see #list_rum_events_with_http_info
@@ -287,5 +544,77 @@ module DatadogAPIClient::V2
287
544
  @api_client.set_attribute_from_path(api_version, body, "page.cursor", RUMSearchEventsRequest, @api_client.get_attribute_from_path(response, "meta.page.after"))
288
545
  end
289
546
  end
547
+
548
+ # Update a RUM application.
549
+ #
550
+ # @see #update_rum_application_with_http_info
551
+ def update_rum_application(id, body, opts = {})
552
+ data, _status_code, _headers = update_rum_application_with_http_info(id, body, opts)
553
+ data
554
+ end
555
+
556
+ # Update a RUM application.
557
+ #
558
+ # Update the RUM application with given ID in your organization.
559
+ #
560
+ # @param id [String] RUM application ID.
561
+ # @param body [RUMApplicationUpdateRequest]
562
+ # @param opts [Hash] the optional parameters
563
+ # @return [Array<(RUMApplicationResponse, Integer, Hash)>] RUMApplicationResponse data, response status code and response headers
564
+ def update_rum_application_with_http_info(id, body, opts = {})
565
+
566
+ if @api_client.config.debugging
567
+ @api_client.config.logger.debug 'Calling API: RUMAPI.update_rum_application ...'
568
+ end
569
+ # verify the required parameter 'id' is set
570
+ if @api_client.config.client_side_validation && id.nil?
571
+ fail ArgumentError, "Missing the required parameter 'id' when calling RUMAPI.update_rum_application"
572
+ end
573
+ # verify the required parameter 'body' is set
574
+ if @api_client.config.client_side_validation && body.nil?
575
+ fail ArgumentError, "Missing the required parameter 'body' when calling RUMAPI.update_rum_application"
576
+ end
577
+ # resource path
578
+ local_var_path = '/api/v2/rum/applications/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))
579
+
580
+ # query parameters
581
+ query_params = opts[:query_params] || {}
582
+
583
+ # header parameters
584
+ header_params = opts[:header_params] || {}
585
+ # HTTP header 'Accept' (if needed)
586
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
587
+ # HTTP header 'Content-Type'
588
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
589
+
590
+ # form parameters
591
+ form_params = opts[:form_params] || {}
592
+
593
+ # http body (model)
594
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
595
+
596
+ # return_type
597
+ return_type = opts[:debug_return_type] || 'RUMApplicationResponse'
598
+
599
+ # auth_names
600
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
601
+
602
+ new_options = opts.merge(
603
+ :operation => :update_rum_application,
604
+ :header_params => header_params,
605
+ :query_params => query_params,
606
+ :form_params => form_params,
607
+ :body => post_body,
608
+ :auth_names => auth_names,
609
+ :return_type => return_type,
610
+ :api_version => "V2"
611
+ )
612
+
613
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
614
+ if @api_client.config.debugging
615
+ @api_client.config.logger.debug "API called: RUMAPI#update_rum_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
616
+ end
617
+ return data, status_code, headers
618
+ end
290
619
  end
291
620
  end
@@ -342,7 +342,7 @@ module DatadogAPIClient::V2
342
342
  return_type = opts[:debug_return_type] || 'SecurityMonitoringSignalTriageUpdateResponse'
343
343
 
344
344
  # auth_names
345
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
345
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
346
346
 
347
347
  new_options = opts.merge(
348
348
  :operation => :edit_security_monitoring_signal_assignee,
@@ -414,7 +414,7 @@ module DatadogAPIClient::V2
414
414
  return_type = opts[:debug_return_type] || 'SecurityMonitoringSignalTriageUpdateResponse'
415
415
 
416
416
  # auth_names
417
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
417
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
418
418
 
419
419
  new_options = opts.merge(
420
420
  :operation => :edit_security_monitoring_signal_incidents,
@@ -486,7 +486,7 @@ module DatadogAPIClient::V2
486
486
  return_type = opts[:debug_return_type] || 'SecurityMonitoringSignalTriageUpdateResponse'
487
487
 
488
488
  # auth_names
489
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
489
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
490
490
 
491
491
  new_options = opts.merge(
492
492
  :operation => :edit_security_monitoring_signal_state,
@@ -639,6 +639,71 @@ module DatadogAPIClient::V2
639
639
  return data, status_code, headers
640
640
  end
641
641
 
642
+ # Get a signal's details.
643
+ #
644
+ # @see #get_security_monitoring_signal_with_http_info
645
+ def get_security_monitoring_signal(signal_id, opts = {})
646
+ data, _status_code, _headers = get_security_monitoring_signal_with_http_info(signal_id, opts)
647
+ data
648
+ end
649
+
650
+ # Get a signal's details.
651
+ #
652
+ # Get a signal's details.
653
+ #
654
+ # @param signal_id [String] The ID of the signal.
655
+ # @param opts [Hash] the optional parameters
656
+ # @return [Array<(SecurityMonitoringSignal, Integer, Hash)>] SecurityMonitoringSignal data, response status code and response headers
657
+ def get_security_monitoring_signal_with_http_info(signal_id, opts = {})
658
+
659
+ if @api_client.config.debugging
660
+ @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_security_monitoring_signal ...'
661
+ end
662
+ # verify the required parameter 'signal_id' is set
663
+ if @api_client.config.client_side_validation && signal_id.nil?
664
+ fail ArgumentError, "Missing the required parameter 'signal_id' when calling SecurityMonitoringAPI.get_security_monitoring_signal"
665
+ end
666
+ # resource path
667
+ local_var_path = '/api/v2/security_monitoring/signals/{signal_id}'.sub('{signal_id}', CGI.escape(signal_id.to_s).gsub('%2F', '/'))
668
+
669
+ # query parameters
670
+ query_params = opts[:query_params] || {}
671
+
672
+ # header parameters
673
+ header_params = opts[:header_params] || {}
674
+ # HTTP header 'Accept' (if needed)
675
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
676
+
677
+ # form parameters
678
+ form_params = opts[:form_params] || {}
679
+
680
+ # http body (model)
681
+ post_body = opts[:debug_body]
682
+
683
+ # return_type
684
+ return_type = opts[:debug_return_type] || 'SecurityMonitoringSignal'
685
+
686
+ # auth_names
687
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
688
+
689
+ new_options = opts.merge(
690
+ :operation => :get_security_monitoring_signal,
691
+ :header_params => header_params,
692
+ :query_params => query_params,
693
+ :form_params => form_params,
694
+ :body => post_body,
695
+ :auth_names => auth_names,
696
+ :return_type => return_type,
697
+ :api_version => "V2"
698
+ )
699
+
700
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
701
+ if @api_client.config.debugging
702
+ @api_client.config.logger.debug "API called: SecurityMonitoringAPI#get_security_monitoring_signal\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
703
+ end
704
+ return data, status_code, headers
705
+ end
706
+
642
707
  # Get all security filters.
643
708
  #
644
709
  # @see #list_security_filters_with_http_info
@@ -33,7 +33,11 @@ module DatadogAPIClient::V2
33
33
 
34
34
  # Get cost across multi-org account.
35
35
  #
36
- # Get cost across multi-org account. Cost by org data for a given month becomes available no later than the 16th of the following month.
36
+ # Get cost across multi-org account.
37
+ # Cost by org data for a given month becomes available no later than the 16th of the following month.
38
+ # **Note:** This endpoint has been deprecated. Please use the new endpoint
39
+ # [`/historical_cost`](https://docs.datadoghq.com/api/latest/usage-metering/#get-historical-cost-across-your-account)
40
+ # instead.
37
41
  #
38
42
  # @param start_month [Time] Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost beginning this month.
39
43
  # @param opts [Hash] the optional parameters
@@ -94,44 +98,35 @@ module DatadogAPIClient::V2
94
98
  # Get estimated cost across your account.
95
99
  #
96
100
  # @see #get_estimated_cost_by_org_with_http_info
97
- def get_estimated_cost_by_org(view, opts = {})
98
- data, _status_code, _headers = get_estimated_cost_by_org_with_http_info(view, opts)
101
+ def get_estimated_cost_by_org(opts = {})
102
+ data, _status_code, _headers = get_estimated_cost_by_org_with_http_info(opts)
99
103
  data
100
104
  end
101
105
 
102
106
  # Get estimated cost across your account.
103
107
  #
104
108
  # Get estimated cost across multi-org and single root-org accounts.
105
- # Estimated cost data is only available for the current month and previous month. To access historical costs prior to this, use the /cost_by_org endpoint.
109
+ # Estimated cost data is only available for the current month and previous month.
110
+ # To access historical costs prior to this, use the `/historical_cost` endpoint.
106
111
  #
107
- # @param view [String] String to specify whether cost is broken down at a parent-org level or at the sub-org level. Currently, only the 'sub-org' view is supported.
108
112
  # @param opts [Hash] the optional parameters
113
+ # @option opts [String] :view String to specify whether cost is broken down at a parent-org level or at the sub-org level. Available views are `summary` and `sub-org`. Defaults to `summary`.
109
114
  # @option opts [Time] :start_month Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost beginning this month. Either start_month or start_date should be specified, but not both. (start_month cannot go beyond two months in the past)
110
115
  # @option opts [Time] :end_month Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost ending this month.
111
116
  # @option opts [Time] :start_date Datetime in ISO-8601 format, UTC, precise to day: `[YYYY-MM-DD]` for cost beginning this day. Either start_month or start_date should be specified, but not both. (start_date cannot go beyond two months in the past)
112
117
  # @option opts [Time] :end_date Datetime in ISO-8601 format, UTC, precise to day: `[YYYY-MM-DD]` for cost ending this day.
113
118
  # @return [Array<(CostByOrgResponse, Integer, Hash)>] CostByOrgResponse data, response status code and response headers
114
- def get_estimated_cost_by_org_with_http_info(view, opts = {})
115
- unstable_enabled = @api_client.config.unstable_operations["v2.get_estimated_cost_by_org".to_sym]
116
- if unstable_enabled
117
- @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_estimated_cost_by_org")
118
- else
119
- raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_estimated_cost_by_org"))
120
- end
119
+ def get_estimated_cost_by_org_with_http_info(opts = {})
121
120
 
122
121
  if @api_client.config.debugging
123
122
  @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_estimated_cost_by_org ...'
124
123
  end
125
- # verify the required parameter 'view' is set
126
- if @api_client.config.client_side_validation && view.nil?
127
- fail ArgumentError, "Missing the required parameter 'view' when calling UsageMeteringAPI.get_estimated_cost_by_org"
128
- end
129
124
  # resource path
130
125
  local_var_path = '/api/v2/usage/estimated_cost'
131
126
 
132
127
  # query parameters
133
128
  query_params = opts[:query_params] || {}
134
- query_params[:'view'] = view
129
+ query_params[:'view'] = opts[:'view'] if !opts[:'view'].nil?
135
130
  query_params[:'start_month'] = opts[:'start_month'] if !opts[:'start_month'].nil?
136
131
  query_params[:'end_month'] = opts[:'end_month'] if !opts[:'end_month'].nil?
137
132
  query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
@@ -172,6 +167,77 @@ module DatadogAPIClient::V2
172
167
  return data, status_code, headers
173
168
  end
174
169
 
170
+ # Get historical cost across your account.
171
+ #
172
+ # @see #get_historical_cost_by_org_with_http_info
173
+ def get_historical_cost_by_org(start_month, opts = {})
174
+ data, _status_code, _headers = get_historical_cost_by_org_with_http_info(start_month, opts)
175
+ data
176
+ end
177
+
178
+ # Get historical cost across your account.
179
+ #
180
+ # Get historical cost across multi-org and single root-org accounts.
181
+ # Cost data for a given month becomes available no later than the 16th of the following month.
182
+ #
183
+ # @param start_month [Time] Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost beginning this month.
184
+ # @param opts [Hash] the optional parameters
185
+ # @option opts [String] :view String to specify whether cost is broken down at a parent-org level or at the sub-org level. Available views are `summary` and `sub-org`. Defaults to `summary`.
186
+ # @option opts [Time] :end_month Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost ending this month.
187
+ # @return [Array<(CostByOrgResponse, Integer, Hash)>] CostByOrgResponse data, response status code and response headers
188
+ def get_historical_cost_by_org_with_http_info(start_month, opts = {})
189
+
190
+ if @api_client.config.debugging
191
+ @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_historical_cost_by_org ...'
192
+ end
193
+ # verify the required parameter 'start_month' is set
194
+ if @api_client.config.client_side_validation && start_month.nil?
195
+ fail ArgumentError, "Missing the required parameter 'start_month' when calling UsageMeteringAPI.get_historical_cost_by_org"
196
+ end
197
+ # resource path
198
+ local_var_path = '/api/v2/usage/historical_cost'
199
+
200
+ # query parameters
201
+ query_params = opts[:query_params] || {}
202
+ query_params[:'start_month'] = start_month
203
+ query_params[:'view'] = opts[:'view'] if !opts[:'view'].nil?
204
+ query_params[:'end_month'] = opts[:'end_month'] if !opts[:'end_month'].nil?
205
+
206
+ # header parameters
207
+ header_params = opts[:header_params] || {}
208
+ # HTTP header 'Accept' (if needed)
209
+ header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])
210
+
211
+ # form parameters
212
+ form_params = opts[:form_params] || {}
213
+
214
+ # http body (model)
215
+ post_body = opts[:debug_body]
216
+
217
+ # return_type
218
+ return_type = opts[:debug_return_type] || 'CostByOrgResponse'
219
+
220
+ # auth_names
221
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
222
+
223
+ new_options = opts.merge(
224
+ :operation => :get_historical_cost_by_org,
225
+ :header_params => header_params,
226
+ :query_params => query_params,
227
+ :form_params => form_params,
228
+ :body => post_body,
229
+ :auth_names => auth_names,
230
+ :return_type => return_type,
231
+ :api_version => "V2"
232
+ )
233
+
234
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
235
+ if @api_client.config.debugging
236
+ @api_client.config.logger.debug "API called: UsageMeteringAPI#get_historical_cost_by_org\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
237
+ end
238
+ return data, status_code, headers
239
+ end
240
+
175
241
  # Get hourly usage by product family.
176
242
  #
177
243
  # @see #get_hourly_usage_with_http_info
@@ -21,6 +21,7 @@ module DatadogAPIClient::V2
21
21
  class ContentEncoding
22
22
  include BaseEnumModel
23
23
 
24
+ IDENTITY = "identity".freeze
24
25
  GZIP = "gzip".freeze
25
26
  DEFLATE = "deflate".freeze
26
27
  end
@@ -0,0 +1,27 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # The type of the incident attachment attributes.
21
+ class IncidentAttachmentAttachmentType
22
+ include BaseEnumModel
23
+
24
+ LINK = "link".freeze
25
+ POSTMORTEM = "postmortem".freeze
26
+ end
27
+ end
@@ -0,0 +1,63 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # The attributes object for an attachment.
21
+ module IncidentAttachmentAttributes
22
+ class << self
23
+ include BaseOneOfModel
24
+ include BaseOneOfModelNoDiscriminator
25
+
26
+ # List of class defined in oneOf (OpenAPI v3)
27
+ def openapi_one_of
28
+ [
29
+ :'IncidentAttachmentPostmortemAttributes',
30
+ :'IncidentAttachmentLinkAttributes'
31
+ ]
32
+ end
33
+ # Builds the object
34
+ # @param [Mixed] Data to be matched against the list of oneOf items
35
+ # @return [Object] Returns the model or the data itself
36
+ def build(data)
37
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
38
+ # Note:
39
+ # - We do not attempt to check whether exactly one item matches.
40
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
41
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
42
+ # - TODO: scalar values are de facto behaving as if they were nullable.
43
+ # - TODO: logging when debugging is set.
44
+ openapi_one_of.each do |klass|
45
+ begin
46
+ next if klass == :AnyType # "nullable: true"
47
+ typed_data = find_and_cast_into_type(klass, data)
48
+ next if typed_data._unparsed
49
+ return typed_data if typed_data
50
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
51
+ end
52
+ end
53
+
54
+ if openapi_one_of.include?(:AnyType)
55
+ data
56
+ else
57
+ self._unparsed = true
58
+ DatadogAPIClient::UnparsedObject.new(data)
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end