Class: DatadogAPIClient::V2::CaseManagementAPI

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog_api_client/v2/api/case_management_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ CaseManagementAPI

Returns a new instance of CaseManagementAPI.



22
23
24
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 22

def initialize(api_client = DatadogAPIClient::APIClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



20
21
22
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 20

def api_client
  @api_client
end

Instance Method Details

#add_case_insights(case_id, body, opts = {}) ⇒ Object

Add insights to a case.



29
30
31
32
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 29

def add_case_insights(case_id, body, opts = {})
  data, _status_code, _headers = add_case_insights_with_http_info(case_id, body, opts)
  data
end

#add_case_insights_with_http_info(case_id, body, opts = {}) ⇒ Array<(CaseResponse, Integer, Hash)>

Add insights to a case.

Adds one or more insights to a case. Insights are references to related Datadog resources (such as monitors, security signals, incidents, or error tracking issues) that provide investigative context. Up to 100 insights can be added per request. Each insight requires a type (see CaseInsightType for allowed values), a ref (URL path to the resource), and a resource_id.

Parameters:

  • case_id (String)

    Case's UUID or key

  • body (CaseInsightsRequest)

    Case insights request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseResponse, Integer, Hash)>)

    CaseResponse data, response status code and response headers



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 42

def add_case_insights_with_http_info(case_id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.add_case_insights".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.add_case_insights")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.add_case_insights"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.add_case_insights ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.add_case_insights"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.add_case_insights"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/insights'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :add_case_insights,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#add_case_insights\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#aggregate_cases(body, opts = {}) ⇒ Object

Aggregate cases.



107
108
109
110
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 107

def aggregate_cases(body, opts = {})
  data, _status_code, _headers = aggregate_cases_with_http_info(body, opts)
  data
end

#aggregate_cases_with_http_info(body, opts = {}) ⇒ Array<(CaseAggregateResponse, Integer, Hash)>

Aggregate cases.

Performs an aggregation query over cases, grouping results by specified fields and returning counts per group along with a total. Useful for dashboards and analytics.

Parameters:

  • body (CaseAggregateRequest)

    Case aggregate request payload.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseAggregateResponse, Integer, Hash)>)

    CaseAggregateResponse data, response status code and response headers



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 119

def aggregate_cases_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.aggregate_cases".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.aggregate_cases")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.aggregate_cases"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.aggregate_cases ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.aggregate_cases"
  end
  # resource path
  local_var_path = '/api/v2/cases/aggregate'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseAggregateResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :aggregate_cases,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#aggregate_cases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#archive_case(case_id, body, opts = {}) ⇒ Object

Archive case.



180
181
182
183
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 180

def archive_case(case_id, body, opts = {})
  data, _status_code, _headers = archive_case_with_http_info(case_id, body, opts)
  data
end

#archive_case_with_http_info(case_id, body, opts = {}) ⇒ Array<(CaseResponse, Integer, Hash)>

Archive case.

Archive case

Parameters:

  • case_id (String)

    Case's UUID or key

  • body (CaseEmptyRequest)

    Archive case payload

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseResponse, Integer, Hash)>)

    CaseResponse data, response status code and response headers



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 193

def archive_case_with_http_info(case_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.archive_case ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.archive_case"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.archive_case"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/archive'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :archive_case,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#archive_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#assign_case(case_id, body, opts = {}) ⇒ Object

Assign case.



252
253
254
255
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 252

def assign_case(case_id, body, opts = {})
  data, _status_code, _headers = assign_case_with_http_info(case_id, body, opts)
  data
end

#assign_case_with_http_info(case_id, body, opts = {}) ⇒ Array<(CaseResponse, Integer, Hash)>

Assign case.

Assign case to a user

Parameters:

  • case_id (String)

    Case's UUID or key

  • body (CaseAssignRequest)

    Assign case payload

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseResponse, Integer, Hash)>)

    CaseResponse data, response status code and response headers



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 265

def assign_case_with_http_info(case_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.assign_case ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.assign_case"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.assign_case"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/assign'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :assign_case,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#assign_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#bulk_update_cases(body, opts = {}) ⇒ Object

Bulk update cases.



324
325
326
327
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 324

def bulk_update_cases(body, opts = {})
  bulk_update_cases_with_http_info(body, opts)
  nil
end

#bulk_update_cases_with_http_info(body, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Bulk update cases.

Applies a single action (such as changing priority, status, assignment, or archiving) to multiple cases at once. The list of case IDs and the action type with its payload are specified in the request body.

Parameters:

  • body (CaseBulkUpdateRequest)

    Case bulk update request payload.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 336

def bulk_update_cases_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.bulk_update_cases".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.bulk_update_cases")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.bulk_update_cases"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.bulk_update_cases ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.bulk_update_cases"
  end
  # resource path
  local_var_path = '/api/v2/cases/bulk'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :bulk_update_cases,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#bulk_update_cases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#comment_case(case_id, body, opts = {}) ⇒ Object

Comment case.



397
398
399
400
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 397

def comment_case(case_id, body, opts = {})
  data, _status_code, _headers = comment_case_with_http_info(case_id, body, opts)
  data
end

#comment_case_with_http_info(case_id, body, opts = {}) ⇒ Array<(TimelineResponse, Integer, Hash)>

Comment case.

Comment case

Parameters:

  • case_id (String)

    Case's UUID or key

  • body (CaseCommentRequest)

    Case comment payload

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(TimelineResponse, Integer, Hash)>)

    TimelineResponse data, response status code and response headers



410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 410

def comment_case_with_http_info(case_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.comment_case ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.comment_case"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.comment_case"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/comment'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'TimelineResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :comment_case,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#comment_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#count_cases(opts = {}) ⇒ Object

Count cases.



469
470
471
472
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 469

def count_cases(opts = {})
  data, _status_code, _headers = count_cases_with_http_info(opts)
  data
end

#count_cases_with_http_info(opts = {}) ⇒ Array<(CaseCountResponse, Integer, Hash)>

Count cases.

Returns case counts, optionally grouped by one or more fields (for example, status, priority). Supports a query filter to narrow the scope.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :query_filter (String)

    Filter query for cases.

  • :group_bys (String)

    Comma-separated fields to group by.

  • :limit (Integer)

    Maximum facet values to return.

Returns:

  • (Array<(CaseCountResponse, Integer, Hash)>)

    CaseCountResponse data, response status code and response headers



483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 483

def count_cases_with_http_info(opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.count_cases".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.count_cases")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.count_cases"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.count_cases ...'
  end
  # resource path
  local_var_path = '/api/v2/cases/count'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'query_filter'] = opts[:'query_filter'] if !opts[:'query_filter'].nil?
  query_params[:'group_bys'] = opts[:'group_bys'] if !opts[:'group_bys'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CaseCountResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :count_cases,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#count_cases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_case(body, opts = {}) ⇒ Object

Create a case.



541
542
543
544
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 541

def create_case(body, opts = {})
  data, _status_code, _headers = create_case_with_http_info(body, opts)
  data
end

#create_case_automation_rule(project_id, body, opts = {}) ⇒ Object

Create an automation rule.



608
609
610
611
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 608

def create_case_automation_rule(project_id, body, opts = {})
  data, _status_code, _headers = create_case_automation_rule_with_http_info(project_id, body, opts)
  data
end

#create_case_automation_rule_with_http_info(project_id, body, opts = {}) ⇒ Array<(AutomationRuleResponse, Integer, Hash)>

Create an automation rule.

Creates an automation rule for a project. The rule defines a trigger event (for example, case created, status transitioned) and an action to execute.

Parameters:

  • project_id (String)

    The UUID of the project that owns the automation rules.

  • body (AutomationRuleCreateRequest)

    Automation rule payload.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AutomationRuleResponse, Integer, Hash)>)

    AutomationRuleResponse data, response status code and response headers



621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 621

def create_case_automation_rule_with_http_info(project_id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.create_case_automation_rule".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_case_automation_rule")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_case_automation_rule"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.create_case_automation_rule ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling CaseManagementAPI.create_case_automation_rule"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.create_case_automation_rule"
  end
  # resource path
  local_var_path = '/api/v2/cases/projects/{project_id}/rules'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AutomationRuleResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_case_automation_rule,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#create_case_automation_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_case_jira_issue(case_id, body, opts = {}) ⇒ Object

Create Jira issue for case.



686
687
688
689
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 686

def create_case_jira_issue(case_id, body, opts = {})
  create_case_jira_issue_with_http_info(case_id, body, opts)
  nil
end

#create_case_jira_issue_with_http_info(case_id, body, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Create Jira issue for case.

Create a new Jira issue and link it to a case

Parameters:

  • case_id (String)

    Case's UUID or key

  • body (JiraIssueCreateRequest)

    Jira issue creation request

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 699

def create_case_jira_issue_with_http_info(case_id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.create_case_jira_issue".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_case_jira_issue")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_case_jira_issue"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.create_case_jira_issue ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.create_case_jira_issue"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.create_case_jira_issue"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/relationships/jira_issues'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_case_jira_issue,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#create_case_jira_issue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Create a case link.



764
765
766
767
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 764

def create_case_link(body, opts = {})
  data, _status_code, _headers = create_case_link_with_http_info(body, opts)
  data
end

Create a case link.

Creates a directional link between two cases (for example, case A blocks case B). The parent and child cases and their relationship type must be specified.

Parameters:

  • body (CaseLinkCreateRequest)

    Case link create request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseLinkResponse, Integer, Hash)>)

    CaseLinkResponse data, response status code and response headers



776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 776

def create_case_link_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.create_case_link".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_case_link")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_case_link"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.create_case_link ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.create_case_link"
  end
  # resource path
  local_var_path = '/api/v2/cases/link'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseLinkResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_case_link,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#create_case_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_case_notebook(case_id, body, opts = {}) ⇒ Object

Create investigation notebook for case.



837
838
839
840
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 837

def create_case_notebook(case_id, body, opts = {})
  create_case_notebook_with_http_info(case_id, body, opts)
  nil
end

#create_case_notebook_with_http_info(case_id, body, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Create investigation notebook for case.

Create a new investigation notebook and link it to a case

Parameters:

  • case_id (String)

    Case's UUID or key

  • body (NotebookCreateRequest)

    Notebook creation request

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 850

def create_case_notebook_with_http_info(case_id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.create_case_notebook".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_case_notebook")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_case_notebook"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.create_case_notebook ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.create_case_notebook"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.create_case_notebook"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/relationships/notebook'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_case_notebook,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#create_case_notebook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_case_service_now_ticket(case_id, body, opts = {}) ⇒ Object

Create ServiceNow ticket for case.



915
916
917
918
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 915

def create_case_service_now_ticket(case_id, body, opts = {})
  create_case_service_now_ticket_with_http_info(case_id, body, opts)
  nil
end

#create_case_service_now_ticket_with_http_info(case_id, body, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Create ServiceNow ticket for case.

Create a new ServiceNow incident ticket and link it to a case

Parameters:

  • case_id (String)

    Case's UUID or key

  • body (ServiceNowTicketCreateRequest)

    ServiceNow ticket creation request

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 928

def create_case_service_now_ticket_with_http_info(case_id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.create_case_service_now_ticket".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_case_service_now_ticket")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_case_service_now_ticket"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.create_case_service_now_ticket ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.create_case_service_now_ticket"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.create_case_service_now_ticket"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/relationships/servicenow_tickets'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_case_service_now_ticket,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#create_case_service_now_ticket\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_case_view(body, opts = {}) ⇒ Object

Create a case view.



993
994
995
996
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 993

def create_case_view(body, opts = {})
  data, _status_code, _headers = create_case_view_with_http_info(body, opts)
  data
end

#create_case_view_with_http_info(body, opts = {}) ⇒ Array<(CaseViewResponse, Integer, Hash)>

Create a case view.

Creates a new saved case view with a name, filter query, and associated project. Optionally, a notification rule can be linked to the view.

Parameters:

  • body (CaseViewCreateRequest)

    Case view payload.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseViewResponse, Integer, Hash)>)

    CaseViewResponse data, response status code and response headers



1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1005

def create_case_view_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.create_case_view".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_case_view")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_case_view"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.create_case_view ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.create_case_view"
  end
  # resource path
  local_var_path = '/api/v2/cases/views'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseViewResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_case_view,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#create_case_view\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_case_with_http_info(body, opts = {}) ⇒ Array<(CaseResponse, Integer, Hash)>

Create a case.

Create a Case

Parameters:

  • body (CaseCreateRequest)

    Case payload

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseResponse, Integer, Hash)>)

    CaseResponse data, response status code and response headers



553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 553

def create_case_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.create_case ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.create_case"
  end
  # resource path
  local_var_path = '/api/v2/cases'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_case,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#create_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_maintenance_window(body, opts = {}) ⇒ Object

Create a maintenance window.



1066
1067
1068
1069
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1066

def create_maintenance_window(body, opts = {})
  data, _status_code, _headers = create_maintenance_window_with_http_info(body, opts)
  data
end

#create_maintenance_window_with_http_info(body, opts = {}) ⇒ Array<(MaintenanceWindowResponse, Integer, Hash)>

Create a maintenance window.

Creates a maintenance window for event management cases with a name, case filter query, and time range (start and end).

Parameters:

Returns:

  • (Array<(MaintenanceWindowResponse, Integer, Hash)>)

    MaintenanceWindowResponse data, response status code and response headers



1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1078

def create_maintenance_window_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.create_maintenance_window".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_maintenance_window")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_maintenance_window"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.create_maintenance_window ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.create_maintenance_window"
  end
  # resource path
  local_var_path = '/api/v2/maintenance_windows'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'MaintenanceWindowResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_maintenance_window,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#create_maintenance_window\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_project(body, opts = {}) ⇒ Object

Create a project.



1139
1140
1141
1142
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1139

def create_project(body, opts = {})
  data, _status_code, _headers = create_project_with_http_info(body, opts)
  data
end

#create_project_notification_rule(project_id, body, opts = {}) ⇒ Object

Create a notification rule.



1206
1207
1208
1209
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1206

def create_project_notification_rule(project_id, body, opts = {})
  data, _status_code, _headers = create_project_notification_rule_with_http_info(project_id, body, opts)
  data
end

#create_project_notification_rule_with_http_info(project_id, body, opts = {}) ⇒ Array<(CaseNotificationRuleResponse, Integer, Hash)>

Create a notification rule.

Create a notification rule for a project.

Parameters:

  • project_id (String)

    Project UUID

  • body (CaseNotificationRuleCreateRequest)

    Notification rule payload

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1219

def create_project_notification_rule_with_http_info(project_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.create_project_notification_rule ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling CaseManagementAPI.create_project_notification_rule"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.create_project_notification_rule"
  end
  # resource path
  local_var_path = '/api/v2/cases/projects/{project_id}/notification_rules'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseNotificationRuleResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_project_notification_rule,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#create_project_notification_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_project_with_http_info(body, opts = {}) ⇒ Array<(ProjectResponse, Integer, Hash)>

Create a project.

Create a project.

Parameters:

  • body (ProjectCreateRequest)

    Project payload.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ProjectResponse, Integer, Hash)>)

    ProjectResponse data, response status code and response headers



1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1151

def create_project_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.create_project ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.create_project"
  end
  # resource path
  local_var_path = '/api/v2/cases/projects'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'ProjectResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_project,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#create_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_case_automation_rule(project_id, rule_id, opts = {}) ⇒ Object

Delete an automation rule.



1278
1279
1280
1281
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1278

def delete_case_automation_rule(project_id, rule_id, opts = {})
  delete_case_automation_rule_with_http_info(project_id, rule_id, opts)
  nil
end

#delete_case_automation_rule_with_http_info(project_id, rule_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an automation rule.

Permanently deletes an automation rule from a project.

Parameters:

  • project_id (String)

    The UUID of the project that owns the automation rules.

  • rule_id (String)

    The UUID of the automation rule.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1291

def delete_case_automation_rule_with_http_info(project_id, rule_id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.delete_case_automation_rule".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_case_automation_rule")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_case_automation_rule"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.delete_case_automation_rule ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling CaseManagementAPI.delete_case_automation_rule"
  end
  # verify the required parameter 'rule_id' is set
  if @api_client.config.client_side_validation && rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'rule_id' when calling CaseManagementAPI.delete_case_automation_rule"
  end
  # resource path
  local_var_path = '/api/v2/cases/projects/{project_id}/rules/{rule_id}'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_case_automation_rule,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#delete_case_automation_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_case_comment(case_id, cell_id, opts = {}) ⇒ Object

Delete case comment.



1354
1355
1356
1357
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1354

def delete_case_comment(case_id, cell_id, opts = {})
  delete_case_comment_with_http_info(case_id, cell_id, opts)
  nil
end

#delete_case_comment_with_http_info(case_id, cell_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete case comment.

Delete case comment

Parameters:

  • case_id (String)

    Case's UUID or key

  • cell_id (String)

    The UUID of the timeline cell (comment) to update.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1367

def delete_case_comment_with_http_info(case_id, cell_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.delete_case_comment ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.delete_case_comment"
  end
  # verify the required parameter 'cell_id' is set
  if @api_client.config.client_side_validation && cell_id.nil?
    fail ArgumentError, "Missing the required parameter 'cell_id' when calling CaseManagementAPI.delete_case_comment"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/comment/{cell_id}'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')).sub('{cell_id}', CGI.escape(cell_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :delete_case_comment,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#delete_case_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_case_custom_attribute(case_id, custom_attribute_key, opts = {}) ⇒ Object

Delete custom attribute from case.



1424
1425
1426
1427
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1424

def delete_case_custom_attribute(case_id, custom_attribute_key, opts = {})
  data, _status_code, _headers = delete_case_custom_attribute_with_http_info(case_id, custom_attribute_key, opts)
  data
end

#delete_case_custom_attribute_with_http_info(case_id, custom_attribute_key, opts = {}) ⇒ Array<(CaseResponse, Integer, Hash)>

Delete custom attribute from case.

Delete custom attribute from case

Parameters:

  • case_id (String)

    Case's UUID or key

  • custom_attribute_key (String)

    Case Custom attribute's key

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseResponse, Integer, Hash)>)

    CaseResponse data, response status code and response headers



1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1437

def delete_case_custom_attribute_with_http_info(case_id, custom_attribute_key, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.delete_case_custom_attribute ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.delete_case_custom_attribute"
  end
  # verify the required parameter 'custom_attribute_key' is set
  if @api_client.config.client_side_validation && custom_attribute_key.nil?
    fail ArgumentError, "Missing the required parameter 'custom_attribute_key' when calling CaseManagementAPI.delete_case_custom_attribute"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')).sub('{custom_attribute_key}', CGI.escape(custom_attribute_key.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_case_custom_attribute,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#delete_case_custom_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Delete a case link.



1494
1495
1496
1497
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1494

def delete_case_link(link_id, opts = {})
  delete_case_link_with_http_info(link_id, opts)
  nil
end

Delete a case link.

Deletes an existing link between cases by link ID.

Parameters:

  • link_id (String)

    The UUID of the case link.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1506

def delete_case_link_with_http_info(link_id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.delete_case_link".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_case_link")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_case_link"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.delete_case_link ...'
  end
  # verify the required parameter 'link_id' is set
  if @api_client.config.client_side_validation && link_id.nil?
    fail ArgumentError, "Missing the required parameter 'link_id' when calling CaseManagementAPI.delete_case_link"
  end
  # resource path
  local_var_path = '/api/v2/cases/link/{link_id}'.sub('{link_id}', CGI.escape(link_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_case_link,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#delete_case_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_case_view(view_id, opts = {}) ⇒ Object

Delete a case view.



1565
1566
1567
1568
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1565

def delete_case_view(view_id, opts = {})
  delete_case_view_with_http_info(view_id, opts)
  nil
end

#delete_case_view_with_http_info(view_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a case view.

Permanently deletes a saved case view.

Parameters:

  • view_id (String)

    The UUID of the case view.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1577

def delete_case_view_with_http_info(view_id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.delete_case_view".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_case_view")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_case_view"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.delete_case_view ...'
  end
  # verify the required parameter 'view_id' is set
  if @api_client.config.client_side_validation && view_id.nil?
    fail ArgumentError, "Missing the required parameter 'view_id' when calling CaseManagementAPI.delete_case_view"
  end
  # resource path
  local_var_path = '/api/v2/cases/views/{view_id}'.sub('{view_id}', CGI.escape(view_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_case_view,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#delete_case_view\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_maintenance_window(maintenance_window_id, opts = {}) ⇒ Object

Delete a maintenance window.



1636
1637
1638
1639
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1636

def delete_maintenance_window(maintenance_window_id, opts = {})
  delete_maintenance_window_with_http_info(maintenance_window_id, opts)
  nil
end

#delete_maintenance_window_with_http_info(maintenance_window_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a maintenance window.

Permanently deletes a maintenance window.

Parameters:

  • maintenance_window_id (String)

    The UUID of the maintenance window.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1648

def delete_maintenance_window_with_http_info(maintenance_window_id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.delete_maintenance_window".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_maintenance_window")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_maintenance_window"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.delete_maintenance_window ...'
  end
  # verify the required parameter 'maintenance_window_id' is set
  if @api_client.config.client_side_validation && maintenance_window_id.nil?
    fail ArgumentError, "Missing the required parameter 'maintenance_window_id' when calling CaseManagementAPI.delete_maintenance_window"
  end
  # resource path
  local_var_path = '/api/v2/maintenance_windows/{maintenance_window_id}'.sub('{maintenance_window_id}', CGI.escape(maintenance_window_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_maintenance_window,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#delete_maintenance_window\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_project(project_id, opts = {}) ⇒ Object

Remove a project.



1707
1708
1709
1710
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1707

def delete_project(project_id, opts = {})
  delete_project_with_http_info(project_id, opts)
  nil
end

#delete_project_notification_rule(project_id, notification_rule_id, opts = {}) ⇒ Object

Delete a notification rule.



1772
1773
1774
1775
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1772

def delete_project_notification_rule(project_id, notification_rule_id, opts = {})
  delete_project_notification_rule_with_http_info(project_id, notification_rule_id, opts)
  nil
end

#delete_project_notification_rule_with_http_info(project_id, notification_rule_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a notification rule.

Delete a notification rule using the notification rule's id.

Parameters:

  • project_id (String)

    Project UUID

  • notification_rule_id (String)

    Notification Rule UUID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1785

def delete_project_notification_rule_with_http_info(project_id, notification_rule_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.delete_project_notification_rule ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling CaseManagementAPI.delete_project_notification_rule"
  end
  # verify the required parameter 'notification_rule_id' is set
  if @api_client.config.client_side_validation && notification_rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'notification_rule_id' when calling CaseManagementAPI.delete_project_notification_rule"
  end
  # resource path
  local_var_path = '/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{notification_rule_id}', CGI.escape(notification_rule_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_project_notification_rule,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#delete_project_notification_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_project_with_http_info(project_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Remove a project.

Remove a project using the project's id.

Parameters:

  • project_id (String)

    Project UUID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1719

def delete_project_with_http_info(project_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.delete_project ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling CaseManagementAPI.delete_project"
  end
  # resource path
  local_var_path = '/api/v2/cases/projects/{project_id}'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_project,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#delete_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#disable_case_automation_rule(project_id, rule_id, opts = {}) ⇒ Object

Disable an automation rule.



1842
1843
1844
1845
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1842

def disable_case_automation_rule(project_id, rule_id, opts = {})
  data, _status_code, _headers = disable_case_automation_rule_with_http_info(project_id, rule_id, opts)
  data
end

#disable_case_automation_rule_with_http_info(project_id, rule_id, opts = {}) ⇒ Array<(AutomationRuleResponse, Integer, Hash)>

Disable an automation rule.

Disables an automation rule so it no longer triggers on case events. The rule configuration is preserved.

Parameters:

  • project_id (String)

    The UUID of the project that owns the automation rules.

  • rule_id (String)

    The UUID of the automation rule.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AutomationRuleResponse, Integer, Hash)>)

    AutomationRuleResponse data, response status code and response headers



1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1855

def disable_case_automation_rule_with_http_info(project_id, rule_id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.disable_case_automation_rule".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.disable_case_automation_rule")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.disable_case_automation_rule"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.disable_case_automation_rule ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling CaseManagementAPI.disable_case_automation_rule"
  end
  # verify the required parameter 'rule_id' is set
  if @api_client.config.client_side_validation && rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'rule_id' when calling CaseManagementAPI.disable_case_automation_rule"
  end
  # resource path
  local_var_path = '/api/v2/cases/projects/{project_id}/rules/{rule_id}/disable'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AutomationRuleResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :disable_case_automation_rule,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#disable_case_automation_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#enable_case_automation_rule(project_id, rule_id, opts = {}) ⇒ Object

Enable an automation rule.



1918
1919
1920
1921
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1918

def enable_case_automation_rule(project_id, rule_id, opts = {})
  data, _status_code, _headers = enable_case_automation_rule_with_http_info(project_id, rule_id, opts)
  data
end

#enable_case_automation_rule_with_http_info(project_id, rule_id, opts = {}) ⇒ Array<(AutomationRuleResponse, Integer, Hash)>

Enable an automation rule.

Enables a previously disabled automation rule so it triggers on matching case events.

Parameters:

  • project_id (String)

    The UUID of the project that owns the automation rules.

  • rule_id (String)

    The UUID of the automation rule.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AutomationRuleResponse, Integer, Hash)>)

    AutomationRuleResponse data, response status code and response headers



1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1931

def enable_case_automation_rule_with_http_info(project_id, rule_id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.enable_case_automation_rule".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.enable_case_automation_rule")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.enable_case_automation_rule"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.enable_case_automation_rule ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling CaseManagementAPI.enable_case_automation_rule"
  end
  # verify the required parameter 'rule_id' is set
  if @api_client.config.client_side_validation && rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'rule_id' when calling CaseManagementAPI.enable_case_automation_rule"
  end
  # resource path
  local_var_path = '/api/v2/cases/projects/{project_id}/rules/{rule_id}/enable'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AutomationRuleResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :enable_case_automation_rule,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#enable_case_automation_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#favorite_case_project(project_id, opts = {}) ⇒ Object

Favorite a project.



1994
1995
1996
1997
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1994

def favorite_case_project(project_id, opts = {})
  favorite_case_project_with_http_info(project_id, opts)
  nil
end

#favorite_case_project_with_http_info(project_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Favorite a project.

Marks a case project as a favorite for the current authenticated user.

Parameters:

  • project_id (String)

    Project UUID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2006

def favorite_case_project_with_http_info(project_id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.favorite_case_project".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.favorite_case_project")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.favorite_case_project"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.favorite_case_project ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling CaseManagementAPI.favorite_case_project"
  end
  # resource path
  local_var_path = '/api/v2/cases/projects/{project_id}/favorites'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :favorite_case_project,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#favorite_case_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_case(case_id, opts = {}) ⇒ Object

Get the details of a case.



2065
2066
2067
2068
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2065

def get_case(case_id, opts = {})
  data, _status_code, _headers = get_case_with_http_info(case_id, opts)
  data
end

#get_case_automation_rule(project_id, rule_id, opts = {}) ⇒ Object

Get an automation rule.



2130
2131
2132
2133
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2130

def get_case_automation_rule(project_id, rule_id, opts = {})
  data, _status_code, _headers = get_case_automation_rule_with_http_info(project_id, rule_id, opts)
  data
end

#get_case_automation_rule_with_http_info(project_id, rule_id, opts = {}) ⇒ Array<(AutomationRuleResponse, Integer, Hash)>

Get an automation rule.

Returns a single automation rule identified by its UUID, including its trigger, action, and current state (enabled/disabled).

Parameters:

  • project_id (String)

    The UUID of the project that owns the automation rules.

  • rule_id (String)

    The UUID of the automation rule.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AutomationRuleResponse, Integer, Hash)>)

    AutomationRuleResponse data, response status code and response headers



2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2143

def get_case_automation_rule_with_http_info(project_id, rule_id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_case_automation_rule".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_case_automation_rule")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_case_automation_rule"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.get_case_automation_rule ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling CaseManagementAPI.get_case_automation_rule"
  end
  # verify the required parameter 'rule_id' is set
  if @api_client.config.client_side_validation && rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'rule_id' when calling CaseManagementAPI.get_case_automation_rule"
  end
  # resource path
  local_var_path = '/api/v2/cases/projects/{project_id}/rules/{rule_id}'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AutomationRuleResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_case_automation_rule,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#get_case_automation_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_case_view(view_id, opts = {}) ⇒ Object

Get a case view.



2206
2207
2208
2209
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2206

def get_case_view(view_id, opts = {})
  data, _status_code, _headers = get_case_view_with_http_info(view_id, opts)
  data
end

#get_case_view_with_http_info(view_id, opts = {}) ⇒ Array<(CaseViewResponse, Integer, Hash)>

Get a case view.

Returns a single saved case view identified by its UUID, including its query, associated project, and timestamps.

Parameters:

  • view_id (String)

    The UUID of the case view.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseViewResponse, Integer, Hash)>)

    CaseViewResponse data, response status code and response headers



2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2218

def get_case_view_with_http_info(view_id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_case_view".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_case_view")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_case_view"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.get_case_view ...'
  end
  # verify the required parameter 'view_id' is set
  if @api_client.config.client_side_validation && view_id.nil?
    fail ArgumentError, "Missing the required parameter 'view_id' when calling CaseManagementAPI.get_case_view"
  end
  # resource path
  local_var_path = '/api/v2/cases/views/{view_id}'.sub('{view_id}', CGI.escape(view_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CaseViewResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_case_view,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#get_case_view\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_case_with_http_info(case_id, opts = {}) ⇒ Array<(CaseResponse, Integer, Hash)>

Get the details of a case.

Get the details of case by case_id

Parameters:

  • case_id (String)

    Case's UUID or key

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseResponse, Integer, Hash)>)

    CaseResponse data, response status code and response headers



2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2077

def get_case_with_http_info(case_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.get_case ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.get_case"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_case,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#get_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_project(project_id, opts = {}) ⇒ Object

Get the details of a project.



2277
2278
2279
2280
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2277

def get_project(project_id, opts = {})
  data, _status_code, _headers = get_project_with_http_info(project_id, opts)
  data
end

#get_project_notification_rules(project_id, opts = {}) ⇒ Object

Get notification rules.



2342
2343
2344
2345
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2342

def get_project_notification_rules(project_id, opts = {})
  data, _status_code, _headers = get_project_notification_rules_with_http_info(project_id, opts)
  data
end

#get_project_notification_rules_with_http_info(project_id, opts = {}) ⇒ Array<(CaseNotificationRulesResponse, Integer, Hash)>

Get notification rules.

Get all notification rules for a project.

Parameters:

  • project_id (String)

    Project UUID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2354

def get_project_notification_rules_with_http_info(project_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.get_project_notification_rules ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling CaseManagementAPI.get_project_notification_rules"
  end
  # resource path
  local_var_path = '/api/v2/cases/projects/{project_id}/notification_rules'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CaseNotificationRulesResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_project_notification_rules,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#get_project_notification_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_project_with_http_info(project_id, opts = {}) ⇒ Array<(ProjectResponse, Integer, Hash)>

Get the details of a project.

Get the details of a project by project_id.

Parameters:

  • project_id (String)

    Project UUID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ProjectResponse, Integer, Hash)>)

    ProjectResponse data, response status code and response headers



2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2289

def get_project_with_http_info(project_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.get_project ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling CaseManagementAPI.get_project"
  end
  # resource path
  local_var_path = '/api/v2/cases/projects/{project_id}'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ProjectResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_project,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#get_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_projects(opts = {}) ⇒ Object

Get all projects.



2407
2408
2409
2410
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2407

def get_projects(opts = {})
  data, _status_code, _headers = get_projects_with_http_info(opts)
  data
end

#get_projects_with_http_info(opts = {}) ⇒ Array<(ProjectsResponse, Integer, Hash)>

Get all projects.

Get all projects.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ProjectsResponse, Integer, Hash)>)

    ProjectsResponse data, response status code and response headers



2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2418

def get_projects_with_http_info(opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.get_projects ...'
  end
  # resource path
  local_var_path = '/api/v2/cases/projects'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ProjectsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_projects,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#get_projects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Link incident to case.



2467
2468
2469
2470
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2467

def link_incident(case_id, body, opts = {})
  data, _status_code, _headers = link_incident_with_http_info(case_id, body, opts)
  data
end

Link incident to case.

Link an incident to a case

Parameters:

  • case_id (String)

    Case's UUID or key

  • body (RelationshipToIncidentRequest)

    Incident link request

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseResponse, Integer, Hash)>)

    CaseResponse data, response status code and response headers



2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2480

def link_incident_with_http_info(case_id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.link_incident".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.link_incident")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.link_incident"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.link_incident ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.link_incident"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.link_incident"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/relationships/incidents'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :link_incident,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#link_incident\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Link existing Jira issue to case.



2545
2546
2547
2548
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2545

def link_jira_issue_to_case(case_id, body, opts = {})
  link_jira_issue_to_case_with_http_info(case_id, body, opts)
  nil
end

Link existing Jira issue to case.

Link an existing Jira issue to a case

Parameters:

  • case_id (String)

    Case's UUID or key

  • body (JiraIssueLinkRequest)

    Jira issue link request

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2558

def link_jira_issue_to_case_with_http_info(case_id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.link_jira_issue_to_case".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.link_jira_issue_to_case")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.link_jira_issue_to_case"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.link_jira_issue_to_case ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.link_jira_issue_to_case"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.link_jira_issue_to_case"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/relationships/jira_issues'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :link_jira_issue_to_case,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#link_jira_issue_to_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_case_automation_rules(project_id, opts = {}) ⇒ Object

List automation rules.



2623
2624
2625
2626
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2623

def list_case_automation_rules(project_id, opts = {})
  data, _status_code, _headers = list_case_automation_rules_with_http_info(project_id, opts)
  data
end

#list_case_automation_rules_with_http_info(project_id, opts = {}) ⇒ Array<(AutomationRulesResponse, Integer, Hash)>

List automation rules.

Returns all automation rules configured for a project. Automation rules allow automatic actions to be triggered by case events like creation, status transitions, or attribute changes.

Parameters:

  • project_id (String)

    The UUID of the project that owns the automation rules.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AutomationRulesResponse, Integer, Hash)>)

    AutomationRulesResponse data, response status code and response headers



2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2635

def list_case_automation_rules_with_http_info(project_id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_case_automation_rules".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_case_automation_rules")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_case_automation_rules"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.list_case_automation_rules ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling CaseManagementAPI.list_case_automation_rules"
  end
  # resource path
  local_var_path = '/api/v2/cases/projects/{project_id}/rules'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AutomationRulesResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_case_automation_rules,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#list_case_automation_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

List case links.



2694
2695
2696
2697
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2694

def list_case_links(entity_type, entity_id, opts = {})
  data, _status_code, _headers = list_case_links_with_http_info(entity_type, entity_id, opts)
  data
end

List case links.

Returns all links associated with a case. Links define relationships (for example, BLOCKS) between cases. Requires entity_type and entity_id query parameters.

Parameters:

  • entity_type (String)

    The entity type to look up links for. Use CASE to find links for a specific case.

  • entity_id (String)

    The UUID of the entity to look up links for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :relationship (String)

    Optional filter to only return links of a specific relationship type (for example, BLOCKS or CAUSES).

Returns:

  • (Array<(CaseLinksResponse, Integer, Hash)>)

    CaseLinksResponse data, response status code and response headers



2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2708

def list_case_links_with_http_info(entity_type, entity_id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_case_links".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_case_links")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_case_links"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.list_case_links ...'
  end
  # verify the required parameter 'entity_type' is set
  if @api_client.config.client_side_validation && entity_type.nil?
    fail ArgumentError, "Missing the required parameter 'entity_type' when calling CaseManagementAPI.list_case_links"
  end
  # verify the required parameter 'entity_id' is set
  if @api_client.config.client_side_validation && entity_id.nil?
    fail ArgumentError, "Missing the required parameter 'entity_id' when calling CaseManagementAPI.list_case_links"
  end
  # resource path
  local_var_path = '/api/v2/cases/link'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'entity_type'] = entity_type
  query_params[:'entity_id'] = entity_id
  query_params[:'relationship'] = opts[:'relationship'] if !opts[:'relationship'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CaseLinksResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_case_links,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#list_case_links\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_case_timeline(case_id, opts = {}) ⇒ Object

Get case timeline.



2774
2775
2776
2777
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2774

def list_case_timeline(case_id, opts = {})
  data, _status_code, _headers = list_case_timeline_with_http_info(case_id, opts)
  data
end

#list_case_timeline_with_http_info(case_id, opts = {}) ⇒ Array<(TimelineResponse, Integer, Hash)>

Get case timeline.

Returns the timeline of events for a case, including comments, status changes, and other activity. Supports pagination and sort order.

Parameters:

  • case_id (String)

    Case's UUID or key

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    Number of timeline cells to return per page.

  • :page_number (Integer)

    Zero-based page number for pagination.

  • :sort_ascending (Boolean)

    If true, returns timeline cells in chronological order (oldest first). Defaults to false (newest first).

Returns:

  • (Array<(TimelineResponse, Integer, Hash)>)

    TimelineResponse data, response status code and response headers



2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2789

def list_case_timeline_with_http_info(case_id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_case_timeline".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_case_timeline")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_case_timeline"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.list_case_timeline ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.list_case_timeline"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/timelines'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
  query_params[:'sort[ascending]'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'TimelineResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_case_timeline,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#list_case_timeline\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_case_views(project_id, opts = {}) ⇒ Object

List case views.



2851
2852
2853
2854
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2851

def list_case_views(project_id, opts = {})
  data, _status_code, _headers = list_case_views_with_http_info(project_id, opts)
  data
end

#list_case_views_with_http_info(project_id, opts = {}) ⇒ Array<(CaseViewsResponse, Integer, Hash)>

List case views.

Returns all saved case views for a given project. Views are saved search queries that allow quick access to filtered lists of cases.

Parameters:

  • project_id (String)

    Filter views by project identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseViewsResponse, Integer, Hash)>)

    CaseViewsResponse data, response status code and response headers



2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2863

def list_case_views_with_http_info(project_id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_case_views".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_case_views")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_case_views"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.list_case_views ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling CaseManagementAPI.list_case_views"
  end
  # resource path
  local_var_path = '/api/v2/cases/views'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'project_id'] = project_id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CaseViewsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_case_views,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#list_case_views\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_case_watchers(case_id, opts = {}) ⇒ Object

List case watchers.



2923
2924
2925
2926
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2923

def list_case_watchers(case_id, opts = {})
  data, _status_code, _headers = list_case_watchers_with_http_info(case_id, opts)
  data
end

#list_case_watchers_with_http_info(case_id, opts = {}) ⇒ Array<(CaseWatchersResponse, Integer, Hash)>

List case watchers.

Returns the list of users who are watching a case. Watchers receive notifications about updates to the case.

Parameters:

  • case_id (String)

    Case's UUID or key

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseWatchersResponse, Integer, Hash)>)

    CaseWatchersResponse data, response status code and response headers



2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2935

def list_case_watchers_with_http_info(case_id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_case_watchers".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_case_watchers")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_case_watchers"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.list_case_watchers ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.list_case_watchers"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/watchers'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CaseWatchersResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_case_watchers,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#list_case_watchers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_maintenance_windows(opts = {}) ⇒ Object

List maintenance windows.



2994
2995
2996
2997
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2994

def list_maintenance_windows(opts = {})
  data, _status_code, _headers = list_maintenance_windows_with_http_info(opts)
  data
end

#list_maintenance_windows_with_http_info(opts = {}) ⇒ Array<(MaintenanceWindowsResponse, Integer, Hash)>

List maintenance windows.

Returns all configured maintenance windows for event management cases. Maintenance windows define time periods during which case notifications and automation rules are suppressed for cases matching a given query.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(MaintenanceWindowsResponse, Integer, Hash)>)

    MaintenanceWindowsResponse data, response status code and response headers



3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3005

def list_maintenance_windows_with_http_info(opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_maintenance_windows".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_maintenance_windows")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_maintenance_windows"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.list_maintenance_windows ...'
  end
  # resource path
  local_var_path = '/api/v2/maintenance_windows'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'MaintenanceWindowsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_maintenance_windows,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#list_maintenance_windows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_user_case_project_favorites(opts = {}) ⇒ Object

List project favorites.



3060
3061
3062
3063
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3060

def list_user_case_project_favorites(opts = {})
  data, _status_code, _headers = list_user_case_project_favorites_with_http_info(opts)
  data
end

#list_user_case_project_favorites_with_http_info(opts = {}) ⇒ Array<(ProjectFavoritesResponse, Integer, Hash)>

List project favorites.

Returns the list of case projects that the current authenticated user has marked as favorites.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ProjectFavoritesResponse, Integer, Hash)>)

    ProjectFavoritesResponse data, response status code and response headers



3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3071

def list_user_case_project_favorites_with_http_info(opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_user_case_project_favorites".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_user_case_project_favorites")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_user_case_project_favorites"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.list_user_case_project_favorites ...'
  end
  # resource path
  local_var_path = '/api/v2/cases/projects/favorites'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ProjectFavoritesResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_user_case_project_favorites,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#list_user_case_project_favorites\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#move_case_to_project(case_id, body, opts = {}) ⇒ Object

Update case project.



3126
3127
3128
3129
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3126

def move_case_to_project(case_id, body, opts = {})
  data, _status_code, _headers = move_case_to_project_with_http_info(case_id, body, opts)
  data
end

#move_case_to_project_with_http_info(case_id, body, opts = {}) ⇒ Array<(CaseResponse, Integer, Hash)>

Update case project.

Update the project associated with a case

Parameters:

  • case_id (String)

    Case's UUID or key

  • body (ProjectRelationship)

    Project update request

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseResponse, Integer, Hash)>)

    CaseResponse data, response status code and response headers



3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3139

def move_case_to_project_with_http_info(case_id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.move_case_to_project".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.move_case_to_project")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.move_case_to_project"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.move_case_to_project ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.move_case_to_project"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.move_case_to_project"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/relationships/project'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :move_case_to_project,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#move_case_to_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_case_insights(case_id, body, opts = {}) ⇒ Object

Remove insights from a case.



3204
3205
3206
3207
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3204

def remove_case_insights(case_id, body, opts = {})
  data, _status_code, _headers = remove_case_insights_with_http_info(case_id, body, opts)
  data
end

#remove_case_insights_with_http_info(case_id, body, opts = {}) ⇒ Array<(CaseResponse, Integer, Hash)>

Remove insights from a case.

Removes one or more previously added insights from a case by specifying their type and resource identifier in the request body.

Parameters:

  • case_id (String)

    Case's UUID or key

  • body (CaseInsightsRequest)

    Case insights request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseResponse, Integer, Hash)>)

    CaseResponse data, response status code and response headers



3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3217

def remove_case_insights_with_http_info(case_id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.remove_case_insights".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.remove_case_insights")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.remove_case_insights"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.remove_case_insights ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.remove_case_insights"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.remove_case_insights"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/insights'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :remove_case_insights,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#remove_case_insights\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#search_cases(opts = {}) ⇒ Object

Search cases.



3282
3283
3284
3285
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3282

def search_cases(opts = {})
  data, _status_code, _headers = search_cases_with_http_info(opts)
  data
end

#search_cases_with_http_info(opts = {}) ⇒ Array<(CasesResponse, Integer, Hash)>

Search cases.

Search cases.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    Size for a given page. The maximum allowed value is 100.

  • :page_number (Integer)

    Specific page number to return.

  • :sort_field (CaseSortableField)

    Specify which field to sort

  • :filter (String)

    Search query

  • :sort_asc (Boolean)

    Specify if order is ascending or not

Returns:

  • (Array<(CasesResponse, Integer, Hash)>)

    CasesResponse data, response status code and response headers



3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3298

def search_cases_with_http_info(opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.search_cases ...'
  end
  allowable_values = ['created_at', 'priority', 'status']
  if @api_client.config.client_side_validation && opts[:'sort_field'] && !allowable_values.include?(opts[:'sort_field'])
    fail ArgumentError, "invalid value for \"sort_field\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/v2/cases'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
  query_params[:'sort[field]'] = opts[:'sort_field'] if !opts[:'sort_field'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'sort[asc]'] = opts[:'sort_asc'] if !opts[:'sort_asc'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CasesResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :search_cases,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#search_cases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#search_cases_with_pagination(opts = {}) {|Case| ... } ⇒ Object

Search cases.

Provide a paginated version of #search_cases, returning all items.

To use it you need to use a block: search_cases_with_pagination { |item| p item }

Yields:

  • (Case)

    Paginated items



3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3360

def search_cases_with_pagination(opts = {})
    api_version = "V2"
    page_size = @api_client.get_attribute_from_path(opts, "page_size", 10)
    @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size)
    @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, 1)
    while true do
        response = search_cases(opts)
        @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) }
        if @api_client.get_attribute_from_path(response, "data").length < page_size
          break
        end
        @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, @api_client.get_attribute_from_path(opts, "page_number", 1) + 1)
    end
end

#unarchive_case(case_id, body, opts = {}) ⇒ Object

Unarchive case.



3378
3379
3380
3381
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3378

def unarchive_case(case_id, body, opts = {})
  data, _status_code, _headers = unarchive_case_with_http_info(case_id, body, opts)
  data
end

#unarchive_case_with_http_info(case_id, body, opts = {}) ⇒ Array<(CaseResponse, Integer, Hash)>

Unarchive case.

Unarchive case

Parameters:

  • case_id (String)

    Case's UUID or key

  • body (CaseEmptyRequest)

    Unarchive case payload

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseResponse, Integer, Hash)>)

    CaseResponse data, response status code and response headers



3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3391

def unarchive_case_with_http_info(case_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.unarchive_case ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.unarchive_case"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.unarchive_case"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/unarchive'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :unarchive_case,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#unarchive_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#unassign_case(case_id, body, opts = {}) ⇒ Object

Unassign case.



3450
3451
3452
3453
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3450

def unassign_case(case_id, body, opts = {})
  data, _status_code, _headers = unassign_case_with_http_info(case_id, body, opts)
  data
end

#unassign_case_with_http_info(case_id, body, opts = {}) ⇒ Array<(CaseResponse, Integer, Hash)>

Unassign case.

Unassign case

Parameters:

  • case_id (String)

    Case's UUID or key

  • body (CaseEmptyRequest)

    Unassign case payload

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseResponse, Integer, Hash)>)

    CaseResponse data, response status code and response headers



3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3463

def unassign_case_with_http_info(case_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.unassign_case ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.unassign_case"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.unassign_case"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/unassign'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :unassign_case,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#unassign_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#unfavorite_case_project(project_id, opts = {}) ⇒ Object

Unfavorite a project.



3522
3523
3524
3525
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3522

def unfavorite_case_project(project_id, opts = {})
  unfavorite_case_project_with_http_info(project_id, opts)
  nil
end

#unfavorite_case_project_with_http_info(project_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Unfavorite a project.

Removes a case project from the current user's favorites list.

Parameters:

  • project_id (String)

    Project UUID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3534

def unfavorite_case_project_with_http_info(project_id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.unfavorite_case_project".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.unfavorite_case_project")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.unfavorite_case_project"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.unfavorite_case_project ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling CaseManagementAPI.unfavorite_case_project"
  end
  # resource path
  local_var_path = '/api/v2/cases/projects/{project_id}/favorites'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :unfavorite_case_project,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#unfavorite_case_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Remove Jira issue link from case.



3593
3594
3595
3596
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3593

def unlink_jira_issue(case_id, opts = {})
  unlink_jira_issue_with_http_info(case_id, opts)
  nil
end

Remove Jira issue link from case.

Remove the link between a Jira issue and a case

Parameters:

  • case_id (String)

    Case's UUID or key

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3605

def unlink_jira_issue_with_http_info(case_id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.unlink_jira_issue".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.unlink_jira_issue")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.unlink_jira_issue"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.unlink_jira_issue ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.unlink_jira_issue"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/relationships/jira_issues'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :unlink_jira_issue,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#unlink_jira_issue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#unwatch_case(case_id, user_uuid, opts = {}) ⇒ Object

Unwatch a case.



3664
3665
3666
3667
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3664

def unwatch_case(case_id, user_uuid, opts = {})
  unwatch_case_with_http_info(case_id, user_uuid, opts)
  nil
end

#unwatch_case_with_http_info(case_id, user_uuid, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Unwatch a case.

Removes a user from the watchers list of a case. The user no longer receives notifications about updates to the case.

Parameters:

  • case_id (String)

    Case's UUID or key

  • user_uuid (String)

    The UUID of the user to add or remove as a watcher.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3677

def unwatch_case_with_http_info(case_id, user_uuid, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.unwatch_case".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.unwatch_case")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.unwatch_case"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.unwatch_case ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.unwatch_case"
  end
  # verify the required parameter 'user_uuid' is set
  if @api_client.config.client_side_validation && user_uuid.nil?
    fail ArgumentError, "Missing the required parameter 'user_uuid' when calling CaseManagementAPI.unwatch_case"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/watchers/{user_uuid}'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')).sub('{user_uuid}', CGI.escape(user_uuid.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :unwatch_case,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#unwatch_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_attributes(case_id, body, opts = {}) ⇒ Object

Update case attributes.



3740
3741
3742
3743
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3740

def update_attributes(case_id, body, opts = {})
  data, _status_code, _headers = update_attributes_with_http_info(case_id, body, opts)
  data
end

#update_attributes_with_http_info(case_id, body, opts = {}) ⇒ Array<(CaseResponse, Integer, Hash)>

Update case attributes.

Update case attributes

Parameters:

  • case_id (String)

    Case's UUID or key

  • body (CaseUpdateAttributesRequest)

    Case attributes update payload

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseResponse, Integer, Hash)>)

    CaseResponse data, response status code and response headers



3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3753

def update_attributes_with_http_info(case_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.update_attributes ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.update_attributes"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.update_attributes"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/attributes'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_attributes,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#update_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_case_automation_rule(project_id, rule_id, body, opts = {}) ⇒ Object

Update an automation rule.



3812
3813
3814
3815
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3812

def update_case_automation_rule(project_id, rule_id, body, opts = {})
  data, _status_code, _headers = update_case_automation_rule_with_http_info(project_id, rule_id, body, opts)
  data
end

#update_case_automation_rule_with_http_info(project_id, rule_id, body, opts = {}) ⇒ Array<(AutomationRuleResponse, Integer, Hash)>

Update an automation rule.

Updates the trigger, action, name, or state of an existing automation rule.

Parameters:

  • project_id (String)

    The UUID of the project that owns the automation rules.

  • rule_id (String)

    The UUID of the automation rule.

  • body (AutomationRuleUpdateRequest)

    Automation rule payload.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AutomationRuleResponse, Integer, Hash)>)

    AutomationRuleResponse data, response status code and response headers



3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3826

def update_case_automation_rule_with_http_info(project_id, rule_id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.update_case_automation_rule".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_case_automation_rule")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_case_automation_rule"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.update_case_automation_rule ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling CaseManagementAPI.update_case_automation_rule"
  end
  # verify the required parameter 'rule_id' is set
  if @api_client.config.client_side_validation && rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'rule_id' when calling CaseManagementAPI.update_case_automation_rule"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.update_case_automation_rule"
  end
  # resource path
  local_var_path = '/api/v2/cases/projects/{project_id}/rules/{rule_id}'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AutomationRuleResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_case_automation_rule,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#update_case_automation_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_case_comment(case_id, cell_id, body, opts = {}) ⇒ Object

Update case comment.



3895
3896
3897
3898
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3895

def update_case_comment(case_id, cell_id, body, opts = {})
  update_case_comment_with_http_info(case_id, cell_id, body, opts)
  nil
end

#update_case_comment_with_http_info(case_id, cell_id, body, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update case comment.

Updates the text content of an existing comment on a case timeline. The comment is identified by its cell ID.

Parameters:

  • case_id (String)

    Case's UUID or key

  • cell_id (String)

    The UUID of the timeline cell (comment) to update.

  • body (CaseUpdateCommentRequest)

    Case update comment payload.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3909

def update_case_comment_with_http_info(case_id, cell_id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.update_case_comment".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_case_comment")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_case_comment"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.update_case_comment ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.update_case_comment"
  end
  # verify the required parameter 'cell_id' is set
  if @api_client.config.client_side_validation && cell_id.nil?
    fail ArgumentError, "Missing the required parameter 'cell_id' when calling CaseManagementAPI.update_case_comment"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.update_case_comment"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/comment/{cell_id}'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')).sub('{cell_id}', CGI.escape(cell_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_case_comment,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#update_case_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_case_custom_attribute(case_id, custom_attribute_key, body, opts = {}) ⇒ Object

Update case custom attribute.



3978
3979
3980
3981
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3978

def update_case_custom_attribute(case_id, custom_attribute_key, body, opts = {})
  data, _status_code, _headers = update_case_custom_attribute_with_http_info(case_id, custom_attribute_key, body, opts)
  data
end

#update_case_custom_attribute_with_http_info(case_id, custom_attribute_key, body, opts = {}) ⇒ Array<(CaseResponse, Integer, Hash)>

Update case custom attribute.

Update case custom attribute

Parameters:

  • case_id (String)

    Case's UUID or key

  • custom_attribute_key (String)

    Case Custom attribute's key

  • body (CaseUpdateCustomAttributeRequest)

    Update case custom attribute payload

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseResponse, Integer, Hash)>)

    CaseResponse data, response status code and response headers



3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 3992

def update_case_custom_attribute_with_http_info(case_id, custom_attribute_key, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.update_case_custom_attribute ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.update_case_custom_attribute"
  end
  # verify the required parameter 'custom_attribute_key' is set
  if @api_client.config.client_side_validation && custom_attribute_key.nil?
    fail ArgumentError, "Missing the required parameter 'custom_attribute_key' when calling CaseManagementAPI.update_case_custom_attribute"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.update_case_custom_attribute"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')).sub('{custom_attribute_key}', CGI.escape(custom_attribute_key.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_case_custom_attribute,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#update_case_custom_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_case_description(case_id, body, opts = {}) ⇒ Object

Update case description.



4055
4056
4057
4058
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4055

def update_case_description(case_id, body, opts = {})
  data, _status_code, _headers = update_case_description_with_http_info(case_id, body, opts)
  data
end

#update_case_description_with_http_info(case_id, body, opts = {}) ⇒ Array<(CaseResponse, Integer, Hash)>

Update case description.

Update case description

Parameters:

  • case_id (String)

    Case's UUID or key

  • body (CaseUpdateDescriptionRequest)

    Case description update payload

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseResponse, Integer, Hash)>)

    CaseResponse data, response status code and response headers



4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4068

def update_case_description_with_http_info(case_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.update_case_description ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.update_case_description"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.update_case_description"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/description'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_case_description,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#update_case_description\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_case_due_date(case_id, body, opts = {}) ⇒ Object

Update case due date.



4127
4128
4129
4130
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4127

def update_case_due_date(case_id, body, opts = {})
  data, _status_code, _headers = update_case_due_date_with_http_info(case_id, body, opts)
  data
end

#update_case_due_date_with_http_info(case_id, body, opts = {}) ⇒ Array<(CaseResponse, Integer, Hash)>

Update case due date.

Sets or updates the due date for a case. The due date is a calendar date (without a time component) indicating when the case should be resolved.

Parameters:

  • case_id (String)

    Case's UUID or key

  • body (CaseUpdateDueDateRequest)

    Case due date update payload.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseResponse, Integer, Hash)>)

    CaseResponse data, response status code and response headers



4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4140

def update_case_due_date_with_http_info(case_id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.update_case_due_date".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_case_due_date")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_case_due_date"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.update_case_due_date ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.update_case_due_date"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.update_case_due_date"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/due_date'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_case_due_date,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#update_case_due_date\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_case_resolved_reason(case_id, body, opts = {}) ⇒ Object

Update case resolved reason.



4205
4206
4207
4208
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4205

def update_case_resolved_reason(case_id, body, opts = {})
  data, _status_code, _headers = update_case_resolved_reason_with_http_info(case_id, body, opts)
  data
end

#update_case_resolved_reason_with_http_info(case_id, body, opts = {}) ⇒ Array<(CaseResponse, Integer, Hash)>

Update case resolved reason.

Sets the resolved reason for a security case (for example, FALSE_POSITIVE, TRUE_POSITIVE). Applicable to security-type cases.

Parameters:

  • case_id (String)

    Case's UUID or key

  • body (CaseUpdateResolvedReasonRequest)

    Case resolved reason update payload.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseResponse, Integer, Hash)>)

    CaseResponse data, response status code and response headers



4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4218

def update_case_resolved_reason_with_http_info(case_id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.update_case_resolved_reason".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_case_resolved_reason")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_case_resolved_reason"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.update_case_resolved_reason ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.update_case_resolved_reason"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.update_case_resolved_reason"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/resolved_reason'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_case_resolved_reason,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#update_case_resolved_reason\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_case_title(case_id, body, opts = {}) ⇒ Object

Update case title.



4283
4284
4285
4286
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4283

def update_case_title(case_id, body, opts = {})
  data, _status_code, _headers = update_case_title_with_http_info(case_id, body, opts)
  data
end

#update_case_title_with_http_info(case_id, body, opts = {}) ⇒ Array<(CaseResponse, Integer, Hash)>

Update case title.

Update case title

Parameters:

  • case_id (String)

    Case's UUID or key

  • body (CaseUpdateTitleRequest)

    Case title update payload

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseResponse, Integer, Hash)>)

    CaseResponse data, response status code and response headers



4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4296

def update_case_title_with_http_info(case_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.update_case_title ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.update_case_title"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.update_case_title"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/title'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_case_title,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#update_case_title\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_case_view(view_id, body, opts = {}) ⇒ Object

Update a case view.



4355
4356
4357
4358
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4355

def update_case_view(view_id, body, opts = {})
  data, _status_code, _headers = update_case_view_with_http_info(view_id, body, opts)
  data
end

#update_case_view_with_http_info(view_id, body, opts = {}) ⇒ Array<(CaseViewResponse, Integer, Hash)>

Update a case view.

Updates the name, query, or notification rule of an existing case view.

Parameters:

  • view_id (String)

    The UUID of the case view.

  • body (CaseViewUpdateRequest)

    Case view payload.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseViewResponse, Integer, Hash)>)

    CaseViewResponse data, response status code and response headers



4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4368

def update_case_view_with_http_info(view_id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.update_case_view".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_case_view")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_case_view"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.update_case_view ...'
  end
  # verify the required parameter 'view_id' is set
  if @api_client.config.client_side_validation && view_id.nil?
    fail ArgumentError, "Missing the required parameter 'view_id' when calling CaseManagementAPI.update_case_view"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.update_case_view"
  end
  # resource path
  local_var_path = '/api/v2/cases/views/{view_id}'.sub('{view_id}', CGI.escape(view_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseViewResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_case_view,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#update_case_view\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_maintenance_window(maintenance_window_id, body, opts = {}) ⇒ Object

Update a maintenance window.



4433
4434
4435
4436
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4433

def update_maintenance_window(maintenance_window_id, body, opts = {})
  data, _status_code, _headers = update_maintenance_window_with_http_info(maintenance_window_id, body, opts)
  data
end

#update_maintenance_window_with_http_info(maintenance_window_id, body, opts = {}) ⇒ Array<(MaintenanceWindowResponse, Integer, Hash)>

Update a maintenance window.

Updates the name, query, start time, or end time of an existing maintenance window.

Parameters:

  • maintenance_window_id (String)

    The UUID of the maintenance window.

  • body (MaintenanceWindowUpdateRequest)

    Maintenance window payload.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(MaintenanceWindowResponse, Integer, Hash)>)

    MaintenanceWindowResponse data, response status code and response headers



4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4446

def update_maintenance_window_with_http_info(maintenance_window_id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.update_maintenance_window".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_maintenance_window")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_maintenance_window"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.update_maintenance_window ...'
  end
  # verify the required parameter 'maintenance_window_id' is set
  if @api_client.config.client_side_validation && maintenance_window_id.nil?
    fail ArgumentError, "Missing the required parameter 'maintenance_window_id' when calling CaseManagementAPI.update_maintenance_window"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.update_maintenance_window"
  end
  # resource path
  local_var_path = '/api/v2/maintenance_windows/{maintenance_window_id}'.sub('{maintenance_window_id}', CGI.escape(maintenance_window_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'MaintenanceWindowResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_maintenance_window,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#update_maintenance_window\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_priority(case_id, body, opts = {}) ⇒ Object

Update case priority.



4511
4512
4513
4514
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4511

def update_priority(case_id, body, opts = {})
  data, _status_code, _headers = update_priority_with_http_info(case_id, body, opts)
  data
end

#update_priority_with_http_info(case_id, body, opts = {}) ⇒ Array<(CaseResponse, Integer, Hash)>

Update case priority.

Update case priority

Parameters:

  • case_id (String)

    Case's UUID or key

  • body (CaseUpdatePriorityRequest)

    Case priority update payload

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseResponse, Integer, Hash)>)

    CaseResponse data, response status code and response headers



4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4524

def update_priority_with_http_info(case_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.update_priority ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.update_priority"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.update_priority"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/priority'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_priority,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#update_priority\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_project(project_id, body, opts = {}) ⇒ Object

Update a project.



4583
4584
4585
4586
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4583

def update_project(project_id, body, opts = {})
  data, _status_code, _headers = update_project_with_http_info(project_id, body, opts)
  data
end

#update_project_notification_rule(project_id, notification_rule_id, body, opts = {}) ⇒ Object

Update a notification rule.



4655
4656
4657
4658
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4655

def update_project_notification_rule(project_id, notification_rule_id, body, opts = {})
  update_project_notification_rule_with_http_info(project_id, notification_rule_id, body, opts)
  nil
end

#update_project_notification_rule_with_http_info(project_id, notification_rule_id, body, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update a notification rule.

Update a notification rule.

Parameters:

  • project_id (String)

    Project UUID

  • notification_rule_id (String)

    Notification Rule UUID

  • body (CaseNotificationRuleUpdateRequest)

    Notification rule payload

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4669

def update_project_notification_rule_with_http_info(project_id, notification_rule_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.update_project_notification_rule ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling CaseManagementAPI.update_project_notification_rule"
  end
  # verify the required parameter 'notification_rule_id' is set
  if @api_client.config.client_side_validation && notification_rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'notification_rule_id' when calling CaseManagementAPI.update_project_notification_rule"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.update_project_notification_rule"
  end
  # resource path
  local_var_path = '/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{notification_rule_id}', CGI.escape(notification_rule_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_project_notification_rule,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#update_project_notification_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_project_with_http_info(project_id, body, opts = {}) ⇒ Array<(ProjectResponse, Integer, Hash)>

Update a project.

Update a project.

Parameters:

  • project_id (String)

    Project UUID.

  • body (ProjectUpdateRequest)

    Project payload.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ProjectResponse, Integer, Hash)>)

    ProjectResponse data, response status code and response headers



4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4596

def update_project_with_http_info(project_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.update_project ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling CaseManagementAPI.update_project"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.update_project"
  end
  # resource path
  local_var_path = '/api/v2/cases/projects/{project_id}'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'ProjectResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_project,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#update_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_status(case_id, body, opts = {}) ⇒ Object

Update case status.



4732
4733
4734
4735
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4732

def update_status(case_id, body, opts = {})
  data, _status_code, _headers = update_status_with_http_info(case_id, body, opts)
  data
end

#update_status_with_http_info(case_id, body, opts = {}) ⇒ Array<(CaseResponse, Integer, Hash)>

Update case status.

Update case status

Parameters:

  • case_id (String)

    Case's UUID or key

  • body (CaseUpdateStatusRequest)

    Case status update payload

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CaseResponse, Integer, Hash)>)

    CaseResponse data, response status code and response headers



4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4745

def update_status_with_http_info(case_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.update_status ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.update_status"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.update_status"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/status'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_status,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#update_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#watch_case(case_id, user_uuid, opts = {}) ⇒ Object

Watch a case.



4804
4805
4806
4807
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4804

def watch_case(case_id, user_uuid, opts = {})
  watch_case_with_http_info(case_id, user_uuid, opts)
  nil
end

#watch_case_with_http_info(case_id, user_uuid, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Watch a case.

Adds a user (identified by their UUID) as a watcher of a case. The user receives notifications about subsequent updates to the case.

Parameters:

  • case_id (String)

    Case's UUID or key

  • user_uuid (String)

    The UUID of the user to add or remove as a watcher.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 4817

def watch_case_with_http_info(case_id, user_uuid, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.watch_case".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.watch_case")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.watch_case"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CaseManagementAPI.watch_case ...'
  end
  # verify the required parameter 'case_id' is set
  if @api_client.config.client_side_validation && case_id.nil?
    fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.watch_case"
  end
  # verify the required parameter 'user_uuid' is set
  if @api_client.config.client_side_validation && user_uuid.nil?
    fail ArgumentError, "Missing the required parameter 'user_uuid' when calling CaseManagementAPI.watch_case"
  end
  # resource path
  local_var_path = '/api/v2/cases/{case_id}/watchers/{user_uuid}'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')).sub('{user_uuid}', CGI.escape(user_uuid.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :watch_case,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CaseManagementAPI#watch_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end