datadog_api_client 2.8.0 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/schemas/v1/openapi.yaml +66 -5
  4. data/.generator/schemas/v2/openapi.yaml +860 -20
  5. data/.generator/src/generator/formatter.py +1 -0
  6. data/.generator/src/generator/templates/model_base.j2 +8 -4
  7. data/CHANGELOG.md +24 -0
  8. data/examples/v1/dashboards/CreateDashboard_2800096921.rb +62 -0
  9. data/examples/v1/dashboards/CreateDashboard_3195475781.rb +32 -0
  10. data/examples/v2/incidents/CreateIncidentIntegration.rb +31 -0
  11. data/examples/v2/incidents/DeleteIncidentIntegration.rb +14 -0
  12. data/examples/v2/incidents/GetIncidentIntegration.rb +14 -0
  13. data/examples/v2/incidents/ListIncidentIntegrations.rb +11 -0
  14. data/examples/v2/incidents/UpdateIncidentIntegration.rb +34 -0
  15. data/examples/v2/ip-allowlist/GetIPAllowlist.rb +5 -0
  16. data/examples/v2/ip-allowlist/UpdateIPAllowlist.rb +25 -0
  17. data/examples/v2/logs-metrics/CreateLogsMetric.rb +1 -1
  18. data/examples/v2/restriction-policies/DeleteRestrictionPolicy.rb +5 -0
  19. data/examples/v2/restriction-policies/GetRestrictionPolicy.rb +5 -0
  20. data/examples/v2/restriction-policies/UpdateRestrictionPolicy.rb +25 -0
  21. data/examples/v2/synthetics/GetOnDemandConcurrencyCap.rb +5 -0
  22. data/examples/v2/synthetics/GetOnDemandConcurrencyCap_2633566918.rb +5 -0
  23. data/examples/v2/synthetics/SetOnDemandConcurrencyCap.rb +7 -0
  24. data/examples/v2/synthetics/SetOnDemandConcurrencyCap_2850884405.rb +9 -0
  25. data/lib/datadog_api_client/configuration.rb +5 -0
  26. data/lib/datadog_api_client/inflector.rb +35 -0
  27. data/lib/datadog_api_client/v1/api/snapshots_api.rb +2 -2
  28. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +3 -3
  29. data/lib/datadog_api_client/v1/model_base.rb +7 -3
  30. data/lib/datadog_api_client/v1/models/application_key.rb +16 -16
  31. data/lib/datadog_api_client/v1/models/cancel_downtimes_by_scope_request.rb +1 -1
  32. data/lib/datadog_api_client/v1/models/downtime.rb +1 -1
  33. data/lib/datadog_api_client/v1/models/downtime_child.rb +1 -1
  34. data/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb +1 -0
  35. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +1 -0
  36. data/lib/datadog_api_client/v1/models/list_stream_source.rb +3 -0
  37. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +2 -0
  38. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +21 -1
  39. data/lib/datadog_api_client/v1/models/usage_rum_sessions_hour.rb +12 -1
  40. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +21 -1
  41. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +21 -1
  42. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +21 -1
  43. data/lib/datadog_api_client/v2/api/incidents_api.rb +384 -0
  44. data/lib/datadog_api_client/v2/api/ip_allowlist_api.rb +153 -0
  45. data/lib/datadog_api_client/v2/api/logs_api.rb +1 -0
  46. data/lib/datadog_api_client/v2/api/restriction_policies_api.rb +236 -0
  47. data/lib/datadog_api_client/v2/api/synthetics_api.rb +153 -0
  48. data/lib/datadog_api_client/v2/api/usage_metering_api.rb +1 -1
  49. data/lib/datadog_api_client/v2/model_base.rb +7 -3
  50. data/lib/datadog_api_client/v2/models/events_data_source.rb +1 -0
  51. data/lib/datadog_api_client/v2/models/incident_integration_metadata_attributes.rb +161 -0
  52. data/lib/datadog_api_client/v2/models/incident_integration_metadata_create_data.rb +123 -0
  53. data/lib/datadog_api_client/v2/models/incident_integration_metadata_create_request.rb +102 -0
  54. data/lib/datadog_api_client/v2/models/incident_integration_metadata_list_response.rb +126 -0
  55. data/lib/datadog_api_client/v2/models/incident_integration_metadata_metadata.rb +63 -0
  56. data/lib/datadog_api_client/v2/models/incident_integration_metadata_patch_data.rb +123 -0
  57. data/lib/datadog_api_client/v2/models/incident_integration_metadata_patch_request.rb +102 -0
  58. data/lib/datadog_api_client/v2/models/incident_integration_metadata_response.rb +114 -0
  59. data/lib/datadog_api_client/v2/models/incident_integration_metadata_response_data.rb +133 -0
  60. data/lib/datadog_api_client/v2/models/incident_integration_metadata_response_included_item.rb +62 -0
  61. data/lib/datadog_api_client/v2/models/incident_update_data.rb +1 -1
  62. data/lib/datadog_api_client/v2/models/ip_allowlist_attributes.rb +103 -0
  63. data/lib/datadog_api_client/v2/models/ip_allowlist_data.rb +122 -0
  64. data/lib/datadog_api_client/v2/models/ip_allowlist_entry.rb +102 -0
  65. data/lib/datadog_api_client/v2/models/ip_allowlist_entry_attributes.rb +121 -0
  66. data/lib/datadog_api_client/v2/models/ip_allowlist_entry_data.rb +122 -0
  67. data/lib/datadog_api_client/v2/models/ip_allowlist_entry_type.rb +26 -0
  68. data/lib/datadog_api_client/v2/models/ip_allowlist_response.rb +91 -0
  69. data/lib/datadog_api_client/v2/models/ip_allowlist_type.rb +26 -0
  70. data/lib/datadog_api_client/v2/models/ip_allowlist_update_request.rb +102 -0
  71. data/lib/datadog_api_client/v2/models/jira_integration_metadata.rb +104 -0
  72. data/lib/datadog_api_client/v2/models/jira_integration_metadata_issues_item.rb +153 -0
  73. data/lib/datadog_api_client/v2/models/metrics_aggregator.rb +4 -0
  74. data/lib/datadog_api_client/v2/models/on_demand_concurrency_cap.rb +91 -0
  75. data/lib/datadog_api_client/v2/models/on_demand_concurrency_cap_attributes.rb +91 -0
  76. data/lib/datadog_api_client/v2/models/on_demand_concurrency_cap_response.rb +91 -0
  77. data/lib/datadog_api_client/v2/models/relationship_to_incident_integration_metadatas.rb +1 -1
  78. data/lib/datadog_api_client/v2/models/restriction_policy.rb +144 -0
  79. data/lib/datadog_api_client/v2/models/restriction_policy_attributes.rb +104 -0
  80. data/lib/datadog_api_client/v2/models/restriction_policy_binding.rb +127 -0
  81. data/lib/datadog_api_client/v2/models/restriction_policy_response.rb +102 -0
  82. data/lib/datadog_api_client/v2/models/restriction_policy_type.rb +26 -0
  83. data/lib/datadog_api_client/v2/models/restriction_policy_update_request.rb +102 -0
  84. data/lib/datadog_api_client/v2/models/rum_application_attributes.rb +7 -7
  85. data/lib/datadog_api_client/v2/models/rum_application_list_attributes.rb +7 -7
  86. data/lib/datadog_api_client/v2/models/security_monitoring_rule_type_read.rb +1 -0
  87. data/lib/datadog_api_client/v2/models/slack_integration_metadata.rb +104 -0
  88. data/lib/datadog_api_client/v2/models/slack_integration_metadata_channel_item.rb +154 -0
  89. data/lib/datadog_api_client/version.rb +1 -1
  90. metadata +53 -2
@@ -96,6 +96,84 @@ module DatadogAPIClient::V2
96
96
  return data, status_code, headers
97
97
  end
98
98
 
99
+ # Create an incident integration metadata.
100
+ #
101
+ # @see #create_incident_integration_with_http_info
102
+ def create_incident_integration(incident_id, body, opts = {})
103
+ data, _status_code, _headers = create_incident_integration_with_http_info(incident_id, body, opts)
104
+ data
105
+ end
106
+
107
+ # Create an incident integration metadata.
108
+ #
109
+ # Create an incident integration metadata.
110
+ #
111
+ # @param incident_id [String] The UUID of the incident.
112
+ # @param body [IncidentIntegrationMetadataCreateRequest] Incident integration metadata payload.
113
+ # @param opts [Hash] the optional parameters
114
+ # @return [Array<(IncidentIntegrationMetadataResponse, Integer, Hash)>] IncidentIntegrationMetadataResponse data, response status code and response headers
115
+ def create_incident_integration_with_http_info(incident_id, body, opts = {})
116
+ unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_integration".to_sym]
117
+ if unstable_enabled
118
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_integration")
119
+ else
120
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_integration"))
121
+ end
122
+
123
+ if @api_client.config.debugging
124
+ @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_integration ...'
125
+ end
126
+ # verify the required parameter 'incident_id' is set
127
+ if @api_client.config.client_side_validation && incident_id.nil?
128
+ fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.create_incident_integration"
129
+ end
130
+ # verify the required parameter 'body' is set
131
+ if @api_client.config.client_side_validation && body.nil?
132
+ fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_integration"
133
+ end
134
+ # resource path
135
+ local_var_path = '/api/v2/incidents/{incident_id}/relationships/integrations'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/'))
136
+
137
+ # query parameters
138
+ query_params = opts[:query_params] || {}
139
+
140
+ # header parameters
141
+ header_params = opts[:header_params] || {}
142
+ # HTTP header 'Accept' (if needed)
143
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
144
+ # HTTP header 'Content-Type'
145
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
146
+
147
+ # form parameters
148
+ form_params = opts[:form_params] || {}
149
+
150
+ # http body (model)
151
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
152
+
153
+ # return_type
154
+ return_type = opts[:debug_return_type] || 'IncidentIntegrationMetadataResponse'
155
+
156
+ # auth_names
157
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
158
+
159
+ new_options = opts.merge(
160
+ :operation => :create_incident_integration,
161
+ :header_params => header_params,
162
+ :query_params => query_params,
163
+ :form_params => form_params,
164
+ :body => post_body,
165
+ :auth_names => auth_names,
166
+ :return_type => return_type,
167
+ :api_version => "V2"
168
+ )
169
+
170
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
171
+ if @api_client.config.debugging
172
+ @api_client.config.logger.debug "API called: IncidentsAPI#create_incident_integration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
173
+ end
174
+ return data, status_code, headers
175
+ end
176
+
99
177
  # Delete an existing incident.
100
178
  #
101
179
  # @see #delete_incident_with_http_info
@@ -167,6 +245,82 @@ module DatadogAPIClient::V2
167
245
  return data, status_code, headers
168
246
  end
169
247
 
248
+ # Delete an incident integration metadata.
249
+ #
250
+ # @see #delete_incident_integration_with_http_info
251
+ def delete_incident_integration(incident_id, integration_metadata_id, opts = {})
252
+ delete_incident_integration_with_http_info(incident_id, integration_metadata_id, opts)
253
+ nil
254
+ end
255
+
256
+ # Delete an incident integration metadata.
257
+ #
258
+ # Delete an incident integration metadata.
259
+ #
260
+ # @param incident_id [String] The UUID of the incident.
261
+ # @param integration_metadata_id [String] The UUID of the incident integration metadata.
262
+ # @param opts [Hash] the optional parameters
263
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
264
+ def delete_incident_integration_with_http_info(incident_id, integration_metadata_id, opts = {})
265
+ unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_integration".to_sym]
266
+ if unstable_enabled
267
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_integration")
268
+ else
269
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_integration"))
270
+ end
271
+
272
+ if @api_client.config.debugging
273
+ @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_integration ...'
274
+ end
275
+ # verify the required parameter 'incident_id' is set
276
+ if @api_client.config.client_side_validation && incident_id.nil?
277
+ fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.delete_incident_integration"
278
+ end
279
+ # verify the required parameter 'integration_metadata_id' is set
280
+ if @api_client.config.client_side_validation && integration_metadata_id.nil?
281
+ fail ArgumentError, "Missing the required parameter 'integration_metadata_id' when calling IncidentsAPI.delete_incident_integration"
282
+ end
283
+ # resource path
284
+ local_var_path = '/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{integration_metadata_id}', CGI.escape(integration_metadata_id.to_s).gsub('%2F', '/'))
285
+
286
+ # query parameters
287
+ query_params = opts[:query_params] || {}
288
+
289
+ # header parameters
290
+ header_params = opts[:header_params] || {}
291
+ # HTTP header 'Accept' (if needed)
292
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
293
+
294
+ # form parameters
295
+ form_params = opts[:form_params] || {}
296
+
297
+ # http body (model)
298
+ post_body = opts[:debug_body]
299
+
300
+ # return_type
301
+ return_type = opts[:debug_return_type]
302
+
303
+ # auth_names
304
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
305
+
306
+ new_options = opts.merge(
307
+ :operation => :delete_incident_integration,
308
+ :header_params => header_params,
309
+ :query_params => query_params,
310
+ :form_params => form_params,
311
+ :body => post_body,
312
+ :auth_names => auth_names,
313
+ :return_type => return_type,
314
+ :api_version => "V2"
315
+ )
316
+
317
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
318
+ if @api_client.config.debugging
319
+ @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_integration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
320
+ end
321
+ return data, status_code, headers
322
+ end
323
+
170
324
  # Get the details of an incident.
171
325
  #
172
326
  # @see #get_incident_with_http_info
@@ -240,6 +394,82 @@ module DatadogAPIClient::V2
240
394
  return data, status_code, headers
241
395
  end
242
396
 
397
+ # Get incident integration metadata details.
398
+ #
399
+ # @see #get_incident_integration_with_http_info
400
+ def get_incident_integration(incident_id, integration_metadata_id, opts = {})
401
+ data, _status_code, _headers = get_incident_integration_with_http_info(incident_id, integration_metadata_id, opts)
402
+ data
403
+ end
404
+
405
+ # Get incident integration metadata details.
406
+ #
407
+ # Get incident integration metadata details.
408
+ #
409
+ # @param incident_id [String] The UUID of the incident.
410
+ # @param integration_metadata_id [String] The UUID of the incident integration metadata.
411
+ # @param opts [Hash] the optional parameters
412
+ # @return [Array<(IncidentIntegrationMetadataResponse, Integer, Hash)>] IncidentIntegrationMetadataResponse data, response status code and response headers
413
+ def get_incident_integration_with_http_info(incident_id, integration_metadata_id, opts = {})
414
+ unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_integration".to_sym]
415
+ if unstable_enabled
416
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_integration")
417
+ else
418
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_integration"))
419
+ end
420
+
421
+ if @api_client.config.debugging
422
+ @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_integration ...'
423
+ end
424
+ # verify the required parameter 'incident_id' is set
425
+ if @api_client.config.client_side_validation && incident_id.nil?
426
+ fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.get_incident_integration"
427
+ end
428
+ # verify the required parameter 'integration_metadata_id' is set
429
+ if @api_client.config.client_side_validation && integration_metadata_id.nil?
430
+ fail ArgumentError, "Missing the required parameter 'integration_metadata_id' when calling IncidentsAPI.get_incident_integration"
431
+ end
432
+ # resource path
433
+ local_var_path = '/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{integration_metadata_id}', CGI.escape(integration_metadata_id.to_s).gsub('%2F', '/'))
434
+
435
+ # query parameters
436
+ query_params = opts[:query_params] || {}
437
+
438
+ # header parameters
439
+ header_params = opts[:header_params] || {}
440
+ # HTTP header 'Accept' (if needed)
441
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
442
+
443
+ # form parameters
444
+ form_params = opts[:form_params] || {}
445
+
446
+ # http body (model)
447
+ post_body = opts[:debug_body]
448
+
449
+ # return_type
450
+ return_type = opts[:debug_return_type] || 'IncidentIntegrationMetadataResponse'
451
+
452
+ # auth_names
453
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
454
+
455
+ new_options = opts.merge(
456
+ :operation => :get_incident_integration,
457
+ :header_params => header_params,
458
+ :query_params => query_params,
459
+ :form_params => form_params,
460
+ :body => post_body,
461
+ :auth_names => auth_names,
462
+ :return_type => return_type,
463
+ :api_version => "V2"
464
+ )
465
+
466
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
467
+ if @api_client.config.debugging
468
+ @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_integration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
469
+ end
470
+ return data, status_code, headers
471
+ end
472
+
243
473
  # Get a list of attachments.
244
474
  #
245
475
  # @see #list_incident_attachments_with_http_info
@@ -315,6 +545,77 @@ module DatadogAPIClient::V2
315
545
  return data, status_code, headers
316
546
  end
317
547
 
548
+ # Get a list of an incident's integration metadata.
549
+ #
550
+ # @see #list_incident_integrations_with_http_info
551
+ def list_incident_integrations(incident_id, opts = {})
552
+ data, _status_code, _headers = list_incident_integrations_with_http_info(incident_id, opts)
553
+ data
554
+ end
555
+
556
+ # Get a list of an incident's integration metadata.
557
+ #
558
+ # Get all integration metadata for an incident.
559
+ #
560
+ # @param incident_id [String] The UUID of the incident.
561
+ # @param opts [Hash] the optional parameters
562
+ # @return [Array<(IncidentIntegrationMetadataListResponse, Integer, Hash)>] IncidentIntegrationMetadataListResponse data, response status code and response headers
563
+ def list_incident_integrations_with_http_info(incident_id, opts = {})
564
+ unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_integrations".to_sym]
565
+ if unstable_enabled
566
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_integrations")
567
+ else
568
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_integrations"))
569
+ end
570
+
571
+ if @api_client.config.debugging
572
+ @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_integrations ...'
573
+ end
574
+ # verify the required parameter 'incident_id' is set
575
+ if @api_client.config.client_side_validation && incident_id.nil?
576
+ fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.list_incident_integrations"
577
+ end
578
+ # resource path
579
+ local_var_path = '/api/v2/incidents/{incident_id}/relationships/integrations'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/'))
580
+
581
+ # query parameters
582
+ query_params = opts[:query_params] || {}
583
+
584
+ # header parameters
585
+ header_params = opts[:header_params] || {}
586
+ # HTTP header 'Accept' (if needed)
587
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
588
+
589
+ # form parameters
590
+ form_params = opts[:form_params] || {}
591
+
592
+ # http body (model)
593
+ post_body = opts[:debug_body]
594
+
595
+ # return_type
596
+ return_type = opts[:debug_return_type] || 'IncidentIntegrationMetadataListResponse'
597
+
598
+ # auth_names
599
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
600
+
601
+ new_options = opts.merge(
602
+ :operation => :list_incident_integrations,
603
+ :header_params => header_params,
604
+ :query_params => query_params,
605
+ :form_params => form_params,
606
+ :body => post_body,
607
+ :auth_names => auth_names,
608
+ :return_type => return_type,
609
+ :api_version => "V2"
610
+ )
611
+
612
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
613
+ if @api_client.config.debugging
614
+ @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_integrations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
615
+ end
616
+ return data, status_code, headers
617
+ end
618
+
318
619
  # Get a list of incidents.
319
620
  #
320
621
  # @see #list_incidents_with_http_info
@@ -651,5 +952,88 @@ module DatadogAPIClient::V2
651
952
  end
652
953
  return data, status_code, headers
653
954
  end
955
+
956
+ # Update an existing incident integration metadata.
957
+ #
958
+ # @see #update_incident_integration_with_http_info
959
+ def update_incident_integration(incident_id, integration_metadata_id, body, opts = {})
960
+ data, _status_code, _headers = update_incident_integration_with_http_info(incident_id, integration_metadata_id, body, opts)
961
+ data
962
+ end
963
+
964
+ # Update an existing incident integration metadata.
965
+ #
966
+ # Update an existing incident integration metadata.
967
+ #
968
+ # @param incident_id [String] The UUID of the incident.
969
+ # @param integration_metadata_id [String] The UUID of the incident integration metadata.
970
+ # @param body [IncidentIntegrationMetadataPatchRequest] Incident integration metadata payload.
971
+ # @param opts [Hash] the optional parameters
972
+ # @return [Array<(IncidentIntegrationMetadataResponse, Integer, Hash)>] IncidentIntegrationMetadataResponse data, response status code and response headers
973
+ def update_incident_integration_with_http_info(incident_id, integration_metadata_id, body, opts = {})
974
+ unstable_enabled = @api_client.config.unstable_operations["v2.update_incident_integration".to_sym]
975
+ if unstable_enabled
976
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_incident_integration")
977
+ else
978
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_incident_integration"))
979
+ end
980
+
981
+ if @api_client.config.debugging
982
+ @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_incident_integration ...'
983
+ end
984
+ # verify the required parameter 'incident_id' is set
985
+ if @api_client.config.client_side_validation && incident_id.nil?
986
+ fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.update_incident_integration"
987
+ end
988
+ # verify the required parameter 'integration_metadata_id' is set
989
+ if @api_client.config.client_side_validation && integration_metadata_id.nil?
990
+ fail ArgumentError, "Missing the required parameter 'integration_metadata_id' when calling IncidentsAPI.update_incident_integration"
991
+ end
992
+ # verify the required parameter 'body' is set
993
+ if @api_client.config.client_side_validation && body.nil?
994
+ fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_incident_integration"
995
+ end
996
+ # resource path
997
+ local_var_path = '/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{integration_metadata_id}', CGI.escape(integration_metadata_id.to_s).gsub('%2F', '/'))
998
+
999
+ # query parameters
1000
+ query_params = opts[:query_params] || {}
1001
+
1002
+ # header parameters
1003
+ header_params = opts[:header_params] || {}
1004
+ # HTTP header 'Accept' (if needed)
1005
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1006
+ # HTTP header 'Content-Type'
1007
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1008
+
1009
+ # form parameters
1010
+ form_params = opts[:form_params] || {}
1011
+
1012
+ # http body (model)
1013
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
1014
+
1015
+ # return_type
1016
+ return_type = opts[:debug_return_type] || 'IncidentIntegrationMetadataResponse'
1017
+
1018
+ # auth_names
1019
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
1020
+
1021
+ new_options = opts.merge(
1022
+ :operation => :update_incident_integration,
1023
+ :header_params => header_params,
1024
+ :query_params => query_params,
1025
+ :form_params => form_params,
1026
+ :body => post_body,
1027
+ :auth_names => auth_names,
1028
+ :return_type => return_type,
1029
+ :api_version => "V2"
1030
+ )
1031
+
1032
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
1033
+ if @api_client.config.debugging
1034
+ @api_client.config.logger.debug "API called: IncidentsAPI#update_incident_integration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1035
+ end
1036
+ return data, status_code, headers
1037
+ end
654
1038
  end
655
1039
  end
@@ -0,0 +1,153 @@
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 'cgi'
17
+
18
+ module DatadogAPIClient::V2
19
+ class IPAllowlistAPI
20
+ attr_accessor :api_client
21
+
22
+ def initialize(api_client = DatadogAPIClient::APIClient.default)
23
+ @api_client = api_client
24
+ end
25
+
26
+ # Get IP Allowlist.
27
+ #
28
+ # @see #get_ip_allowlist_with_http_info
29
+ def get_ip_allowlist(opts = {})
30
+ data, _status_code, _headers = get_ip_allowlist_with_http_info(opts)
31
+ data
32
+ end
33
+
34
+ # Get IP Allowlist.
35
+ #
36
+ # Returns the IP allowlist and its enabled or disabled state.
37
+ #
38
+ # @param opts [Hash] the optional parameters
39
+ # @return [Array<(IPAllowlistResponse, Integer, Hash)>] IPAllowlistResponse data, response status code and response headers
40
+ def get_ip_allowlist_with_http_info(opts = {})
41
+
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: IPAllowlistAPI.get_ip_allowlist ...'
44
+ end
45
+ # resource path
46
+ local_var_path = '/api/v2/ip_allowlist'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
55
+
56
+ # form parameters
57
+ form_params = opts[:form_params] || {}
58
+
59
+ # http body (model)
60
+ post_body = opts[:debug_body]
61
+
62
+ # return_type
63
+ return_type = opts[:debug_return_type] || 'IPAllowlistResponse'
64
+
65
+ # auth_names
66
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
67
+
68
+ new_options = opts.merge(
69
+ :operation => :get_ip_allowlist,
70
+ :header_params => header_params,
71
+ :query_params => query_params,
72
+ :form_params => form_params,
73
+ :body => post_body,
74
+ :auth_names => auth_names,
75
+ :return_type => return_type,
76
+ :api_version => "V2"
77
+ )
78
+
79
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
80
+ if @api_client.config.debugging
81
+ @api_client.config.logger.debug "API called: IPAllowlistAPI#get_ip_allowlist\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ end
83
+ return data, status_code, headers
84
+ end
85
+
86
+ # Update IP Allowlist.
87
+ #
88
+ # @see #update_ip_allowlist_with_http_info
89
+ def update_ip_allowlist(body, opts = {})
90
+ data, _status_code, _headers = update_ip_allowlist_with_http_info(body, opts)
91
+ data
92
+ end
93
+
94
+ # Update IP Allowlist.
95
+ #
96
+ # Edit the entries in the IP allowlist, and enable or disable it.
97
+ #
98
+ # @param body [IPAllowlistUpdateRequest]
99
+ # @param opts [Hash] the optional parameters
100
+ # @return [Array<(IPAllowlistResponse, Integer, Hash)>] IPAllowlistResponse data, response status code and response headers
101
+ def update_ip_allowlist_with_http_info(body, opts = {})
102
+
103
+ if @api_client.config.debugging
104
+ @api_client.config.logger.debug 'Calling API: IPAllowlistAPI.update_ip_allowlist ...'
105
+ end
106
+ # verify the required parameter 'body' is set
107
+ if @api_client.config.client_side_validation && body.nil?
108
+ fail ArgumentError, "Missing the required parameter 'body' when calling IPAllowlistAPI.update_ip_allowlist"
109
+ end
110
+ # resource path
111
+ local_var_path = '/api/v2/ip_allowlist'
112
+
113
+ # query parameters
114
+ query_params = opts[:query_params] || {}
115
+
116
+ # header parameters
117
+ header_params = opts[:header_params] || {}
118
+ # HTTP header 'Accept' (if needed)
119
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
120
+ # HTTP header 'Content-Type'
121
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
122
+
123
+ # form parameters
124
+ form_params = opts[:form_params] || {}
125
+
126
+ # http body (model)
127
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
128
+
129
+ # return_type
130
+ return_type = opts[:debug_return_type] || 'IPAllowlistResponse'
131
+
132
+ # auth_names
133
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
134
+
135
+ new_options = opts.merge(
136
+ :operation => :update_ip_allowlist,
137
+ :header_params => header_params,
138
+ :query_params => query_params,
139
+ :form_params => form_params,
140
+ :body => post_body,
141
+ :auth_names => auth_names,
142
+ :return_type => return_type,
143
+ :api_version => "V2"
144
+ )
145
+
146
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
147
+ if @api_client.config.debugging
148
+ @api_client.config.logger.debug "API called: IPAllowlistAPI#update_ip_allowlist\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
149
+ end
150
+ return data, status_code, headers
151
+ end
152
+ end
153
+ end
@@ -324,6 +324,7 @@ module DatadogAPIClient::V2
324
324
  #
325
325
  # Datadog recommends sending your logs compressed.
326
326
  # Add the `Content-Encoding: gzip` header to the request when sending compressed logs.
327
+ # Log events can be submitted up to 18 hours in the past and 2 hours in the future.
327
328
  #
328
329
  # The status codes answered by the HTTP API are:
329
330
  # - 202: Accepted: the request has been accepted for processing