datadog_api_client 2.47.0 → 2.48.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 (165) hide show
  1. checksums.yaml +4 -4
  2. data/.generator/schemas/v1/openapi.yaml +96 -5
  3. data/.generator/schemas/v2/openapi.yaml +2453 -707
  4. data/CHANGELOG.md +20 -0
  5. data/examples/v2/incidents/CreateIncidentAttachment.rb +22 -0
  6. data/examples/v2/incidents/DeleteIncidentAttachment.rb +8 -0
  7. data/examples/v2/incidents/ListIncidentAttachments.rb +1 -1
  8. data/examples/v2/incidents/UpdateIncidentAttachment.rb +20 -0
  9. data/examples/v2/on-call/CreateUserNotificationRule.rb +29 -0
  10. data/examples/v2/on-call/DeleteUserNotificationRule.rb +11 -0
  11. data/examples/v2/on-call/GetUserNotificationRule.rb +14 -0
  12. data/examples/v2/on-call/ListUserNotificationRules.rb +11 -0
  13. data/examples/v2/on-call/UpdateUserNotificationRule.rb +36 -0
  14. data/examples/v2/product-analytics/SubmitProductAnalyticsEvent.rb +24 -0
  15. data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_2323193894.rb +48 -0
  16. data/examples/v2/synthetics/PatchGlobalVariable.rb +19 -0
  17. data/examples/v2/teams/CreateTeamNotificationRule.rb +23 -0
  18. data/examples/v2/teams/DeleteTeamConnections.rb +0 -3
  19. data/examples/v2/teams/DeleteTeamNotificationRule.rb +11 -0
  20. data/examples/v2/teams/GetTeamNotificationRule.rb +11 -0
  21. data/examples/v2/teams/GetTeamNotificationRules.rb +8 -0
  22. data/examples/v2/teams/GetTeamSync.rb +0 -3
  23. data/examples/v2/teams/ListTeamConnections.rb +0 -3
  24. data/examples/v2/teams/ListTeamConnections_2418873869.rb +0 -3
  25. data/examples/v2/teams/SyncTeams.rb +0 -3
  26. data/examples/v2/teams/SyncTeams_3215592344.rb +0 -3
  27. data/examples/v2/teams/UpdateTeamNotificationRule.rb +27 -0
  28. data/lib/datadog_api_client/configuration.rb +55 -6
  29. data/lib/datadog_api_client/inflector.rb +92 -20
  30. data/lib/datadog_api_client/v1/api/synthetics_api.rb +3 -3
  31. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +6 -4
  32. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +3 -0
  33. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +6 -0
  34. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +61 -1
  35. data/lib/datadog_api_client/v1/models/synthetics_list_tests_response.rb +1 -1
  36. data/lib/datadog_api_client/v1/models/synthetics_test_details.rb +1 -1
  37. data/lib/datadog_api_client/v1/models/synthetics_test_details_without_steps.rb +221 -0
  38. data/lib/datadog_api_client/v2/api/dora_metrics_api.rb +8 -8
  39. data/lib/datadog_api_client/v2/api/incidents_api.rb +188 -36
  40. data/lib/datadog_api_client/v2/api/on_call_api.rb +360 -0
  41. data/lib/datadog_api_client/v2/api/product_analytics_api.rb +121 -0
  42. data/lib/datadog_api_client/v2/api/software_catalog_api.rb +4 -0
  43. data/lib/datadog_api_client/v2/api/synthetics_api.rb +79 -0
  44. data/lib/datadog_api_client/v2/api/teams_api.rb +339 -30
  45. data/lib/datadog_api_client/v2/models/attachment.rb +117 -0
  46. data/lib/datadog_api_client/v2/models/{incident_attachments_response.rb → attachment_array.rb} +7 -7
  47. data/lib/datadog_api_client/v2/models/{incident_attachment_data.rb → attachment_data.rb} +8 -8
  48. data/lib/datadog_api_client/v2/models/attachment_data_attributes.rb +125 -0
  49. data/lib/datadog_api_client/v2/models/attachment_data_attributes_attachment.rb +115 -0
  50. data/lib/datadog_api_client/v2/models/{incident_attachment_attachment_type.rb → attachment_data_attributes_attachment_type.rb} +3 -3
  51. data/lib/datadog_api_client/v2/models/{incident_attachment_relationships.rb → attachment_data_relationships.rb} +5 -5
  52. data/lib/datadog_api_client/v2/models/{incident_attachment_update_request.rb → attachment_data_relationships_last_modified_by_user.rb} +6 -11
  53. data/lib/datadog_api_client/v2/models/attachment_data_relationships_last_modified_by_user_data.rb +144 -0
  54. data/lib/datadog_api_client/v2/models/{incident_attachments_response_included_item.rb → attachment_included.rb} +3 -3
  55. data/lib/datadog_api_client/v2/models/case_create_attributes.rb +11 -1
  56. data/lib/datadog_api_client/v2/models/{dora_fetch_response.rb → create_attachment_request.rb} +5 -5
  57. data/lib/datadog_api_client/v2/models/{incident_attachment_update_data.rb → create_attachment_request_data.rb} +6 -6
  58. data/lib/datadog_api_client/v2/models/create_attachment_request_data_attributes.rb +115 -0
  59. data/lib/datadog_api_client/v2/models/create_attachment_request_data_attributes_attachment.rb +115 -0
  60. data/lib/datadog_api_client/v2/models/create_on_call_notification_rule_request.rb +123 -0
  61. data/lib/datadog_api_client/v2/models/create_on_call_notification_rule_request_data.rb +143 -0
  62. data/lib/datadog_api_client/v2/models/custom_attribute_type.rb +1 -0
  63. data/lib/datadog_api_client/v2/models/dora_deployment_fetch_response.rb +105 -0
  64. data/lib/datadog_api_client/v2/models/dora_deployment_object.rb +125 -0
  65. data/lib/datadog_api_client/v2/models/dora_deployment_object_attributes.rb +225 -0
  66. data/lib/datadog_api_client/v2/models/dora_deployment_request_attributes.rb +1 -1
  67. data/lib/datadog_api_client/v2/models/dora_deployments_list_response.rb +107 -0
  68. data/lib/datadog_api_client/v2/models/dora_failure_fetch_response.rb +105 -0
  69. data/lib/datadog_api_client/v2/models/dora_failure_request_attributes.rb +1 -1
  70. data/lib/datadog_api_client/v2/models/{dora_list_response.rb → dora_failures_list_response.rb} +5 -5
  71. data/lib/datadog_api_client/v2/models/{dora_event.rb → dora_incident_object.rb} +8 -8
  72. data/lib/datadog_api_client/v2/models/dora_incident_object_attributes.rb +225 -0
  73. data/lib/datadog_api_client/v2/models/global_variable_data.rb +125 -0
  74. data/lib/datadog_api_client/v2/models/global_variable_json_patch_request.rb +123 -0
  75. data/lib/datadog_api_client/v2/models/global_variable_json_patch_request_data.rb +115 -0
  76. data/lib/datadog_api_client/v2/models/global_variable_json_patch_request_data_attributes.rb +107 -0
  77. data/lib/datadog_api_client/v2/models/global_variable_json_patch_type.rb +26 -0
  78. data/lib/datadog_api_client/v2/models/global_variable_response.rb +105 -0
  79. data/lib/datadog_api_client/v2/models/{incident_attachment_link_attachment_type.rb → global_variable_type.rb} +3 -3
  80. data/lib/datadog_api_client/v2/models/incident_response_included_item.rb +1 -1
  81. data/lib/datadog_api_client/v2/models/{incident_attachments_postmortem_attributes_attachment_object.rb → json_patch_operation.rb} +40 -30
  82. data/lib/datadog_api_client/v2/models/json_patch_operation_op.rb +31 -0
  83. data/lib/datadog_api_client/v2/models/list_on_call_notification_rules_response.rb +119 -0
  84. data/lib/datadog_api_client/v2/models/observability_pipeline_add_env_vars_processor.rb +11 -1
  85. data/lib/datadog_api_client/v2/models/observability_pipeline_add_fields_processor.rb +11 -1
  86. data/lib/datadog_api_client/v2/models/observability_pipeline_config_processor_group.rb +11 -1
  87. data/lib/datadog_api_client/v2/models/observability_pipeline_custom_processor.rb +11 -1
  88. data/lib/datadog_api_client/v2/models/observability_pipeline_datadog_tags_processor.rb +11 -1
  89. data/lib/datadog_api_client/v2/models/observability_pipeline_dedupe_processor.rb +11 -1
  90. data/lib/datadog_api_client/v2/models/observability_pipeline_enrichment_table_processor.rb +11 -1
  91. data/lib/datadog_api_client/v2/models/observability_pipeline_filter_processor.rb +11 -1
  92. data/lib/datadog_api_client/v2/models/observability_pipeline_generate_metrics_processor.rb +11 -1
  93. data/lib/datadog_api_client/v2/models/observability_pipeline_ocsf_mapper_processor.rb +11 -1
  94. data/lib/datadog_api_client/v2/models/observability_pipeline_parse_grok_processor.rb +11 -1
  95. data/lib/datadog_api_client/v2/models/observability_pipeline_parse_json_processor.rb +11 -1
  96. data/lib/datadog_api_client/v2/models/observability_pipeline_quota_processor.rb +11 -1
  97. data/lib/datadog_api_client/v2/models/observability_pipeline_reduce_processor.rb +11 -1
  98. data/lib/datadog_api_client/v2/models/observability_pipeline_remove_fields_processor.rb +11 -1
  99. data/lib/datadog_api_client/v2/models/observability_pipeline_rename_fields_processor.rb +11 -1
  100. data/lib/datadog_api_client/v2/models/observability_pipeline_sample_processor.rb +11 -1
  101. data/lib/datadog_api_client/v2/models/observability_pipeline_sensitive_data_scanner_processor.rb +11 -1
  102. data/lib/datadog_api_client/v2/models/observability_pipeline_throttle_processor.rb +11 -1
  103. data/lib/datadog_api_client/v2/models/{incident_attachment_update_response.rb → on_call_notification_rule.rb} +8 -11
  104. data/lib/datadog_api_client/v2/models/on_call_notification_rule_attributes.rb +125 -0
  105. data/lib/datadog_api_client/v2/models/on_call_notification_rule_category.rb +27 -0
  106. data/lib/datadog_api_client/v2/models/on_call_notification_rule_channel_relationship.rb +123 -0
  107. data/lib/datadog_api_client/v2/models/on_call_notification_rule_channel_relationship_data.rb +115 -0
  108. data/lib/datadog_api_client/v2/models/{incident_attachment_update_attributes.rb → on_call_notification_rule_channel_settings.rb} +3 -4
  109. data/lib/datadog_api_client/v2/models/on_call_notification_rule_data.rb +153 -0
  110. data/lib/datadog_api_client/v2/models/on_call_notification_rule_relationships.rb +105 -0
  111. data/lib/datadog_api_client/v2/models/on_call_notification_rule_request_attributes.rb +125 -0
  112. data/lib/datadog_api_client/v2/models/on_call_notification_rule_type.rb +26 -0
  113. data/lib/datadog_api_client/v2/models/{incident_attachment_attributes.rb → on_call_notification_rules_included.rb} +3 -4
  114. data/lib/datadog_api_client/v2/models/on_call_phone_notification_rule_method.rb +27 -0
  115. data/lib/datadog_api_client/v2/models/{incident_attachment_link_attributes_attachment_object.rb → on_call_phone_notification_rule_settings.rb} +30 -30
  116. data/lib/datadog_api_client/v2/models/patch_attachment_request.rb +105 -0
  117. data/lib/datadog_api_client/v2/models/patch_attachment_request_data.rb +143 -0
  118. data/lib/datadog_api_client/v2/models/patch_attachment_request_data_attributes.rb +105 -0
  119. data/lib/datadog_api_client/v2/models/patch_attachment_request_data_attributes_attachment.rb +115 -0
  120. data/lib/datadog_api_client/v2/models/product_analytics_server_side_event_error.rb +125 -0
  121. data/lib/datadog_api_client/v2/models/product_analytics_server_side_event_errors.rb +107 -0
  122. data/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item.rb +195 -0
  123. data/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_account.rb +123 -0
  124. data/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_application.rb +124 -0
  125. data/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_event.rb +123 -0
  126. data/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_session.rb +123 -0
  127. data/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_type.rb +26 -0
  128. data/lib/datadog_api_client/v2/models/product_analytics_server_side_event_item_usr.rb +123 -0
  129. data/lib/datadog_api_client/v2/models/security_monitoring_rule_anomaly_detection_options.rb +155 -0
  130. data/lib/datadog_api_client/v2/models/security_monitoring_rule_anomaly_detection_options_bucket_duration.rb +32 -0
  131. data/lib/datadog_api_client/v2/models/security_monitoring_rule_anomaly_detection_options_detection_tolerance.rb +31 -0
  132. data/lib/datadog_api_client/v2/models/security_monitoring_rule_anomaly_detection_options_learning_duration.rb +32 -0
  133. data/lib/datadog_api_client/v2/models/security_monitoring_rule_options.rb +11 -1
  134. data/lib/datadog_api_client/v2/models/synthetics_global_variable.rb +248 -0
  135. data/lib/datadog_api_client/v2/models/synthetics_global_variable_attributes.rb +107 -0
  136. data/lib/datadog_api_client/v2/models/synthetics_global_variable_options.rb +105 -0
  137. data/lib/datadog_api_client/v2/models/{incident_attachment_postmortem_attributes.rb → synthetics_global_variable_parse_test_options.rb} +44 -35
  138. data/lib/datadog_api_client/v2/models/synthetics_global_variable_parse_test_options_type.rb +29 -0
  139. data/lib/datadog_api_client/v2/models/synthetics_global_variable_parser_type.rb +29 -0
  140. data/lib/datadog_api_client/v2/models/{incident_attachment_link_attributes.rb → synthetics_global_variable_totp_parameters.rb} +38 -40
  141. data/lib/datadog_api_client/v2/models/synthetics_global_variable_value.rb +126 -0
  142. data/lib/datadog_api_client/v2/models/synthetics_variable_parser.rb +133 -0
  143. data/lib/datadog_api_client/v2/models/team_notification_rule.rb +154 -0
  144. data/lib/datadog_api_client/v2/models/team_notification_rule_attributes.rb +135 -0
  145. data/lib/datadog_api_client/v2/models/team_notification_rule_attributes_email.rb +105 -0
  146. data/lib/datadog_api_client/v2/models/team_notification_rule_attributes_ms_teams.rb +105 -0
  147. data/lib/datadog_api_client/v2/models/team_notification_rule_attributes_pagerduty.rb +105 -0
  148. data/lib/datadog_api_client/v2/models/team_notification_rule_attributes_slack.rb +115 -0
  149. data/lib/datadog_api_client/v2/models/team_notification_rule_request.rb +123 -0
  150. data/lib/datadog_api_client/v2/models/team_notification_rule_response.rb +105 -0
  151. data/lib/datadog_api_client/v2/models/{incident_attachment_postmortem_attachment_type.rb → team_notification_rule_type.rb} +3 -3
  152. data/lib/datadog_api_client/v2/models/team_notification_rules_response.rb +117 -0
  153. data/lib/datadog_api_client/v2/models/team_notification_rules_response_meta.rb +105 -0
  154. data/lib/datadog_api_client/v2/models/team_notification_rules_response_meta_page.rb +184 -0
  155. data/lib/datadog_api_client/v2/models/threat_hunting_job_options.rb +11 -1
  156. data/lib/datadog_api_client/v2/models/update_on_call_notification_rule_request.rb +123 -0
  157. data/lib/datadog_api_client/v2/models/update_on_call_notification_rule_request_attributes.rb +125 -0
  158. data/lib/datadog_api_client/v2/models/update_on_call_notification_rule_request_data.rb +153 -0
  159. data/lib/datadog_api_client/v2/models/user140420082644000.rb +143 -0
  160. data/lib/datadog_api_client/v2/models/{incident_attachment_related_object.rb → user_type.rb} +2 -2
  161. data/lib/datadog_api_client/version.rb +1 -1
  162. metadata +109 -24
  163. data/examples/v2/incidents/ListIncidentAttachments_2457735435.rb +0 -11
  164. data/examples/v2/incidents/UpdateIncidentAttachments.rb +0 -38
  165. data/examples/v2/incidents/UpdateIncidentAttachments_3881702075.rb +0 -26
@@ -96,6 +96,86 @@ module DatadogAPIClient::V2
96
96
  return data, status_code, headers
97
97
  end
98
98
 
99
+ # Create incident attachment.
100
+ #
101
+ # @see #create_incident_attachment_with_http_info
102
+ def create_incident_attachment(incident_id, body, opts = {})
103
+ data, _status_code, _headers = create_incident_attachment_with_http_info(incident_id, body, opts)
104
+ data
105
+ end
106
+
107
+ # Create incident attachment.
108
+ #
109
+ # Create an incident attachment.
110
+ #
111
+ # @param incident_id [String] The UUID of the incident.
112
+ # @param body [CreateAttachmentRequest]
113
+ # @param opts [Hash] the optional parameters
114
+ # @option opts [String] :include Resource to include in the response. Supported value: `last_modified_by_user`.
115
+ # @return [Array<(Attachment, Integer, Hash)>] Attachment data, response status code and response headers
116
+ def create_incident_attachment_with_http_info(incident_id, body, opts = {})
117
+ unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_attachment".to_sym]
118
+ if unstable_enabled
119
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_attachment")
120
+ else
121
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_attachment"))
122
+ end
123
+
124
+ if @api_client.config.debugging
125
+ @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_attachment ...'
126
+ end
127
+ # verify the required parameter 'incident_id' is set
128
+ if @api_client.config.client_side_validation && incident_id.nil?
129
+ fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.create_incident_attachment"
130
+ end
131
+ # verify the required parameter 'body' is set
132
+ if @api_client.config.client_side_validation && body.nil?
133
+ fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_attachment"
134
+ end
135
+ # resource path
136
+ local_var_path = '/api/v2/incidents/{incident_id}/attachments'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/'))
137
+
138
+ # query parameters
139
+ query_params = opts[:query_params] || {}
140
+ query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
141
+
142
+ # header parameters
143
+ header_params = opts[:header_params] || {}
144
+ # HTTP header 'Accept' (if needed)
145
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
146
+ # HTTP header 'Content-Type'
147
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
148
+
149
+ # form parameters
150
+ form_params = opts[:form_params] || {}
151
+
152
+ # http body (model)
153
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
154
+
155
+ # return_type
156
+ return_type = opts[:debug_return_type] || 'Attachment'
157
+
158
+ # auth_names
159
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
160
+
161
+ new_options = opts.merge(
162
+ :operation => :create_incident_attachment,
163
+ :header_params => header_params,
164
+ :query_params => query_params,
165
+ :form_params => form_params,
166
+ :body => post_body,
167
+ :auth_names => auth_names,
168
+ :return_type => return_type,
169
+ :api_version => "V2"
170
+ )
171
+
172
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
173
+ if @api_client.config.debugging
174
+ @api_client.config.logger.debug "API called: IncidentsAPI#create_incident_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
175
+ end
176
+ return data, status_code, headers
177
+ end
178
+
99
179
  # Create an incident impact.
100
180
  #
101
181
  # @see #create_incident_impact_with_http_info
@@ -616,6 +696,79 @@ module DatadogAPIClient::V2
616
696
  return data, status_code, headers
617
697
  end
618
698
 
699
+ # Delete incident attachment.
700
+ #
701
+ # @see #delete_incident_attachment_with_http_info
702
+ def delete_incident_attachment(incident_id, attachment_id, opts = {})
703
+ delete_incident_attachment_with_http_info(incident_id, attachment_id, opts)
704
+ nil
705
+ end
706
+
707
+ # Delete incident attachment.
708
+ # @param incident_id [String] The UUID of the incident.
709
+ # @param attachment_id [Object] The ID of the attachment.
710
+ # @param opts [Hash] the optional parameters
711
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
712
+ def delete_incident_attachment_with_http_info(incident_id, attachment_id, opts = {})
713
+ unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_attachment".to_sym]
714
+ if unstable_enabled
715
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_attachment")
716
+ else
717
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_attachment"))
718
+ end
719
+
720
+ if @api_client.config.debugging
721
+ @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_attachment ...'
722
+ end
723
+ # verify the required parameter 'incident_id' is set
724
+ if @api_client.config.client_side_validation && incident_id.nil?
725
+ fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.delete_incident_attachment"
726
+ end
727
+ # verify the required parameter 'attachment_id' is set
728
+ if @api_client.config.client_side_validation && attachment_id.nil?
729
+ fail ArgumentError, "Missing the required parameter 'attachment_id' when calling IncidentsAPI.delete_incident_attachment"
730
+ end
731
+ # resource path
732
+ local_var_path = '/api/v2/incidents/{incident_id}/attachments/{attachment_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{attachment_id}', CGI.escape(attachment_id.to_s).gsub('%2F', '/'))
733
+
734
+ # query parameters
735
+ query_params = opts[:query_params] || {}
736
+
737
+ # header parameters
738
+ header_params = opts[:header_params] || {}
739
+ # HTTP header 'Accept' (if needed)
740
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
741
+
742
+ # form parameters
743
+ form_params = opts[:form_params] || {}
744
+
745
+ # http body (model)
746
+ post_body = opts[:debug_body]
747
+
748
+ # return_type
749
+ return_type = opts[:debug_return_type]
750
+
751
+ # auth_names
752
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
753
+
754
+ new_options = opts.merge(
755
+ :operation => :delete_incident_attachment,
756
+ :header_params => header_params,
757
+ :query_params => query_params,
758
+ :form_params => form_params,
759
+ :body => post_body,
760
+ :auth_names => auth_names,
761
+ :return_type => return_type,
762
+ :api_version => "V2"
763
+ )
764
+
765
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
766
+ if @api_client.config.debugging
767
+ @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
768
+ end
769
+ return data, status_code, headers
770
+ end
771
+
619
772
  # Delete an incident impact.
620
773
  #
621
774
  # @see #delete_incident_impact_with_http_info
@@ -1497,7 +1650,7 @@ module DatadogAPIClient::V2
1497
1650
  return data, status_code, headers
1498
1651
  end
1499
1652
 
1500
- # Get a list of attachments.
1653
+ # List incident attachments.
1501
1654
  #
1502
1655
  # @see #list_incident_attachments_with_http_info
1503
1656
  def list_incident_attachments(incident_id, opts = {})
@@ -1505,15 +1658,15 @@ module DatadogAPIClient::V2
1505
1658
  data
1506
1659
  end
1507
1660
 
1508
- # Get a list of attachments.
1661
+ # List incident attachments.
1509
1662
  #
1510
- # Get all attachments for a given incident.
1663
+ # List incident attachments.
1511
1664
  #
1512
1665
  # @param incident_id [String] The UUID of the incident.
1513
1666
  # @param opts [Hash] the optional parameters
1514
- # @option opts [Array<IncidentAttachmentRelatedObject>] :include Specifies which types of related objects are included in the response.
1515
- # @option opts [Array<IncidentAttachmentAttachmentType>] :filter_attachment_type Specifies which types of attachments are included in the response.
1516
- # @return [Array<(IncidentAttachmentsResponse, Integer, Hash)>] IncidentAttachmentsResponse data, response status code and response headers
1667
+ # @option opts [String] :filter_attachment_type Filter attachments by type. Supported values are `1` (`postmortem`) and `2` (`link`).
1668
+ # @option opts [String] :include Resource to include in the response. Supported value: `last_modified_by_user`.
1669
+ # @return [Array<(AttachmentArray, Integer, Hash)>] AttachmentArray data, response status code and response headers
1517
1670
  def list_incident_attachments_with_http_info(incident_id, opts = {})
1518
1671
  unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_attachments".to_sym]
1519
1672
  if unstable_enabled
@@ -1534,8 +1687,8 @@ module DatadogAPIClient::V2
1534
1687
 
1535
1688
  # query parameters
1536
1689
  query_params = opts[:query_params] || {}
1537
- query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
1538
- query_params[:'filter[attachment_type]'] = @api_client.build_collection_param(opts[:'filter_attachment_type'], :csv) if !opts[:'filter_attachment_type'].nil?
1690
+ query_params[:'filter[attachment_type]'] = opts[:'filter_attachment_type'] if !opts[:'filter_attachment_type'].nil?
1691
+ query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
1539
1692
 
1540
1693
  # header parameters
1541
1694
  header_params = opts[:header_params] || {}
@@ -1549,7 +1702,7 @@ module DatadogAPIClient::V2
1549
1702
  post_body = opts[:debug_body]
1550
1703
 
1551
1704
  # return_type
1552
- return_type = opts[:debug_return_type] || 'IncidentAttachmentsResponse'
1705
+ return_type = opts[:debug_return_type] || 'AttachmentArray'
1553
1706
 
1554
1707
  # auth_names
1555
1708
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
@@ -2269,51 +2422,50 @@ module DatadogAPIClient::V2
2269
2422
  return data, status_code, headers
2270
2423
  end
2271
2424
 
2272
- # Create, update, and delete incident attachments.
2425
+ # Update incident attachment.
2273
2426
  #
2274
- # @see #update_incident_attachments_with_http_info
2275
- def update_incident_attachments(incident_id, body, opts = {})
2276
- data, _status_code, _headers = update_incident_attachments_with_http_info(incident_id, body, opts)
2427
+ # @see #update_incident_attachment_with_http_info
2428
+ def update_incident_attachment(incident_id, attachment_id, body, opts = {})
2429
+ data, _status_code, _headers = update_incident_attachment_with_http_info(incident_id, attachment_id, body, opts)
2277
2430
  data
2278
2431
  end
2279
2432
 
2280
- # Create, update, and delete incident attachments.
2281
- #
2282
- # The bulk update endpoint for creating, updating, and deleting attachments for a given incident.
2283
- #
2284
- # @deprecated This API is deprecated.
2285
- #
2433
+ # Update incident attachment.
2286
2434
  # @param incident_id [String] The UUID of the incident.
2287
- # @param body [IncidentAttachmentUpdateRequest] Incident Attachment Payload.
2435
+ # @param attachment_id [Object] The ID of the attachment.
2436
+ # @param body [PatchAttachmentRequest]
2288
2437
  # @param opts [Hash] the optional parameters
2289
- # @option opts [Array<IncidentAttachmentRelatedObject>] :include Specifies which types of related objects are included in the response.
2290
- # @return [Array<(IncidentAttachmentUpdateResponse, Integer, Hash)>] IncidentAttachmentUpdateResponse data, response status code and response headers
2291
- def update_incident_attachments_with_http_info(incident_id, body, opts = {})
2292
- warn "[DEPRECATION] `UpdateIncidentAttachments` is deprecated."
2293
- unstable_enabled = @api_client.config.unstable_operations["v2.update_incident_attachments".to_sym]
2438
+ # @option opts [String] :include Resource to include in the response. Supported value: `last_modified_by_user`.
2439
+ # @return [Array<(Attachment, Integer, Hash)>] Attachment data, response status code and response headers
2440
+ def update_incident_attachment_with_http_info(incident_id, attachment_id, body, opts = {})
2441
+ unstable_enabled = @api_client.config.unstable_operations["v2.update_incident_attachment".to_sym]
2294
2442
  if unstable_enabled
2295
- @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_incident_attachments")
2443
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_incident_attachment")
2296
2444
  else
2297
- raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_incident_attachments"))
2445
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_incident_attachment"))
2298
2446
  end
2299
2447
 
2300
2448
  if @api_client.config.debugging
2301
- @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_incident_attachments ...'
2449
+ @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_incident_attachment ...'
2302
2450
  end
2303
2451
  # verify the required parameter 'incident_id' is set
2304
2452
  if @api_client.config.client_side_validation && incident_id.nil?
2305
- fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.update_incident_attachments"
2453
+ fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.update_incident_attachment"
2454
+ end
2455
+ # verify the required parameter 'attachment_id' is set
2456
+ if @api_client.config.client_side_validation && attachment_id.nil?
2457
+ fail ArgumentError, "Missing the required parameter 'attachment_id' when calling IncidentsAPI.update_incident_attachment"
2306
2458
  end
2307
2459
  # verify the required parameter 'body' is set
2308
2460
  if @api_client.config.client_side_validation && body.nil?
2309
- fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_incident_attachments"
2461
+ fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_incident_attachment"
2310
2462
  end
2311
2463
  # resource path
2312
- local_var_path = '/api/v2/incidents/{incident_id}/attachments'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/'))
2464
+ local_var_path = '/api/v2/incidents/{incident_id}/attachments/{attachment_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{attachment_id}', CGI.escape(attachment_id.to_s).gsub('%2F', '/'))
2313
2465
 
2314
2466
  # query parameters
2315
2467
  query_params = opts[:query_params] || {}
2316
- query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
2468
+ query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
2317
2469
 
2318
2470
  # header parameters
2319
2471
  header_params = opts[:header_params] || {}
@@ -2329,13 +2481,13 @@ module DatadogAPIClient::V2
2329
2481
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
2330
2482
 
2331
2483
  # return_type
2332
- return_type = opts[:debug_return_type] || 'IncidentAttachmentUpdateResponse'
2484
+ return_type = opts[:debug_return_type] || 'Attachment'
2333
2485
 
2334
2486
  # auth_names
2335
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
2487
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
2336
2488
 
2337
2489
  new_options = opts.merge(
2338
- :operation => :update_incident_attachments,
2490
+ :operation => :update_incident_attachment,
2339
2491
  :header_params => header_params,
2340
2492
  :query_params => query_params,
2341
2493
  :form_params => form_params,
@@ -2347,7 +2499,7 @@ module DatadogAPIClient::V2
2347
2499
 
2348
2500
  data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
2349
2501
  if @api_client.config.debugging
2350
- @api_client.config.logger.debug "API called: IncidentsAPI#update_incident_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2502
+ @api_client.config.logger.debug "API called: IncidentsAPI#update_incident_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2351
2503
  end
2352
2504
  return data, status_code, headers
2353
2505
  end