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

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

Archive case.



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

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



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
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 42

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.



101
102
103
104
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 101

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



114
115
116
117
118
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
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 114

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

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

Comment case.



173
174
175
176
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 173

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



186
187
188
189
190
191
192
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
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 186

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

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

Create a case.



173
174
175
176
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 173

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

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

Create Jira issue for case.



312
313
314
315
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 312

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



325
326
327
328
329
330
331
332
333
334
335
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
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 325

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_case_notebook(case_id, body, opts = {}) ⇒ Object

Create investigation notebook for case.



390
391
392
393
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 390

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



403
404
405
406
407
408
409
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
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 403

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.



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

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



481
482
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
537
538
539
540
541
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 481

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_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



185
186
187
188
189
190
191
192
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
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 185

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_project(body, opts = {}) ⇒ Object

Create a project.



240
241
242
243
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 240

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.



613
614
615
616
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 613

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:



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
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 626

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



252
253
254
255
256
257
258
259
260
261
262
263
264
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
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 252

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_comment(case_id, cell_id, opts = {}) ⇒ Object

Delete case comment.



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

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)

    Timeline cell's UUID

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



698
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
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 698

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.



755
756
757
758
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 755

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



768
769
770
771
772
773
774
775
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
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 768

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_project(project_id, opts = {}) ⇒ Object

Remove a project.



307
308
309
310
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 307

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.



890
891
892
893
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 890

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



903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
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
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 903

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



319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
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
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 319

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

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

Get the details of a case.



372
373
374
375
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 372

def get_case(case_id, opts = {})
  data, _status_code, _headers = get_case_with_http_info(case_id, opts)
  data
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



384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 384

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.



437
438
439
440
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 437

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.



1090
1091
1092
1093
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1090

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:



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
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1102

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



449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 449

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.



502
503
504
505
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 502

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



513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 513

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.



1215
1216
1217
1218
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1215

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



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
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1228

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.



1293
1294
1295
1296
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1293

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



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
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1306

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

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

Update case project.



1371
1372
1373
1374
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1371

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



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
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1384

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

#search_cases(opts = {}) ⇒ Object

Search cases.



562
563
564
565
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 562

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



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
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 578

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



640
641
642
643
644
645
646
647
648
649
650
651
652
653
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 640

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, 0)
    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", 0) + 1)
    end
end

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

Unarchive case.



658
659
660
661
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 658

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



671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
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
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 671

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.



730
731
732
733
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 730

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



743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 743

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

Remove Jira issue link from case.



1689
1690
1691
1692
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1689

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



1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
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
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1701

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

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

Update case attributes.



1760
1761
1762
1763
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1760

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



1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
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
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1773

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_custom_attribute(case_id, custom_attribute_key, body, opts = {}) ⇒ Object

Update case custom attribute.



1832
1833
1834
1835
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1832

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



1846
1847
1848
1849
1850
1851
1852
1853
1854
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
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1846

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.



1909
1910
1911
1912
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1909

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



1922
1923
1924
1925
1926
1927
1928
1929
1930
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
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1922

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_title(case_id, body, opts = {}) ⇒ Object

Update case title.



1981
1982
1983
1984
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1981

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



1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
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
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 1994

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_priority(case_id, body, opts = {}) ⇒ Object

Update case priority.



802
803
804
805
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 802

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



815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 815

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.



2125
2126
2127
2128
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2125

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.



2197
2198
2199
2200
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2197

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



2211
2212
2213
2214
2215
2216
2217
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
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2211

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



2138
2139
2140
2141
2142
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
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 2138

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.



874
875
876
877
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 874

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



887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
# File 'lib/datadog_api_client/v2/api/case_management_api.rb', line 887

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