Class: DatadogAPIClient::V2::ReportSchedulesAPI

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of ReportSchedulesAPI.



22
23
24
# File 'lib/datadog_api_client/v2/api/report_schedules_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/report_schedules_api.rb', line 20

def api_client
  @api_client
end

Instance Method Details

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

Create a report schedule.



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

def create_report_schedule(body, opts = {})
  data, _status_code, _headers = create_report_schedule_with_http_info(body, opts)
  data
end

#create_report_schedule_with_http_info(body, opts = {}) ⇒ Array<(ReportScheduleResponse, Integer, Hash)>

Create a report schedule.

Create a new scheduled report. A schedule renders a dashboard or integration dashboard on a recurring cadence and delivers it to the configured recipients over email, Slack, or Microsoft Teams. Requires the generate_dashboard_reports permission.

Parameters:

Returns:

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

    ReportScheduleResponse data, response status code and response headers



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

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReportSchedulesAPI.create_report_schedule ...'
  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 ReportSchedulesAPI.create_report_schedule"
  end
  # resource path
  local_var_path = '/api/v2/reporting/schedule'

  # 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] || 'ReportScheduleResponse'

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

  new_options = opts.merge(
    :operation => :create_report_schedule,
    :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: ReportSchedulesAPI#create_report_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_report_schedule(schedule_uuid, opts = {}) ⇒ Object

Delete a report schedule.



105
106
107
108
# File 'lib/datadog_api_client/v2/api/report_schedules_api.rb', line 105

def delete_report_schedule(schedule_uuid, opts = {})
  data, _status_code, _headers = delete_report_schedule_with_http_info(schedule_uuid, opts)
  data
end

#delete_report_schedule_with_http_info(schedule_uuid, opts = {}) ⇒ Array<(ReportScheduleResponse, Integer, Hash)>

Delete a report schedule.

Delete a report schedule by its unique identifier. The response returns the deleted schedule. Requires a reporting write permission appropriate to the targeted resource type and schedule ownership.

Parameters:

  • schedule_uuid (UUID)

    The unique identifier of the report schedule to delete.

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

    the optional parameters

Returns:

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

    ReportScheduleResponse data, response status code and response headers



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

def delete_report_schedule_with_http_info(schedule_uuid, opts = {})

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

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['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] || 'ReportScheduleResponse'

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

  new_options = opts.merge(
    :operation => :delete_report_schedule,
    :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: ReportSchedulesAPI#delete_report_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_report_schedule(schedule_uuid, opts = {}) ⇒ Object

Get a report schedule.



171
172
173
174
# File 'lib/datadog_api_client/v2/api/report_schedules_api.rb', line 171

def get_report_schedule(schedule_uuid, opts = {})
  data, _status_code, _headers = get_report_schedule_with_http_info(schedule_uuid, opts)
  data
end

#get_report_schedule_with_http_info(schedule_uuid, opts = {}) ⇒ Array<(ReportScheduleResponse, Integer, Hash)>

Get a report schedule.

Get a report schedule by its unique identifier. Requires a reporting read permission appropriate to the targeted resource type.

Parameters:

  • schedule_uuid (UUID)

    The unique identifier of the report schedule to fetch.

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

    the optional parameters

Returns:

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

    ReportScheduleResponse data, response status code and response headers



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

def get_report_schedule_with_http_info(schedule_uuid, opts = {})

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

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['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] || 'ReportScheduleResponse'

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

  new_options = opts.merge(
    :operation => :get_report_schedule,
    :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: ReportSchedulesAPI#get_report_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_report_schedules_for_resource(resource_type, resource_id, opts = {}) ⇒ Object

Get report schedules for a resource.



237
238
239
240
# File 'lib/datadog_api_client/v2/api/report_schedules_api.rb', line 237

def get_report_schedules_for_resource(resource_type, resource_id, opts = {})
  data, _status_code, _headers = get_report_schedules_for_resource_with_http_info(resource_type, resource_id, opts)
  data
end

#get_report_schedules_for_resource_with_http_info(resource_type, resource_id, opts = {}) ⇒ Array<(ReportScheduleListResponse, Integer, Hash)>

Get report schedules for a resource.

Get all report schedules that target a dashboard or integration dashboard resource. Requires a reporting read permission appropriate to the targeted resource type.

Parameters:

  • resource_type (ReportScheduleResourceType)

    The type of resource to fetch report schedules for.

  • resource_id (String)

    The identifier of the resource to fetch report schedules for.

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

    the optional parameters

Returns:

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

    ReportScheduleListResponse data, response status code and response headers



251
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
303
304
305
306
307
308
# File 'lib/datadog_api_client/v2/api/report_schedules_api.rb', line 251

def get_report_schedules_for_resource_with_http_info(resource_type, resource_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReportSchedulesAPI.get_report_schedules_for_resource ...'
  end
  # verify the required parameter 'resource_type' is set
  if @api_client.config.client_side_validation && resource_type.nil?
    fail ArgumentError, "Missing the required parameter 'resource_type' when calling ReportSchedulesAPI.get_report_schedules_for_resource"
  end
  # verify enum value
  allowable_values = ['dashboard', 'integration_dashboard']
  if @api_client.config.client_side_validation && !allowable_values.include?(resource_type)
    fail ArgumentError, "invalid value for \"resource_type\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'resource_id' is set
  if @api_client.config.client_side_validation && resource_id.nil?
    fail ArgumentError, "Missing the required parameter 'resource_id' when calling ReportSchedulesAPI.get_report_schedules_for_resource"
  end
  # resource path
  local_var_path = '/api/v2/reporting/schedule/{resource_type}/{resource_id}'.sub('{resource_type}', CGI.escape(resource_type.to_s).gsub('%2F', '/')).sub('{resource_id}', CGI.escape(resource_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] || 'ReportScheduleListResponse'

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

  new_options = opts.merge(
    :operation => :get_report_schedules_for_resource,
    :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: ReportSchedulesAPI#get_report_schedules_for_resource\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_report_schedules(opts = {}) ⇒ Object

List report schedules.



313
314
315
316
# File 'lib/datadog_api_client/v2/api/report_schedules_api.rb', line 313

def list_report_schedules(opts = {})
  data, _status_code, _headers = list_report_schedules_with_http_info(opts)
  data
end

#list_report_schedules_with_http_info(opts = {}) ⇒ Array<(ReportScheduleListResponse, Integer, Hash)>

List report schedules.

List dashboard and integration dashboard report schedules for the organization. The response is paginated and can be filtered by title, author UUID, or recipients. Requires the generate_dashboard_reports permission.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page_limit (Integer)

    The maximum number of schedules to return. The maximum value is 50.

  • :page_offset (Integer)

    The offset from which to start returning schedules.

  • :filter_title (String)

    Filter schedules by report title.

  • :filter_author_uuid (UUID)

    Filter schedules by author UUID.

  • :filter_recipients (String)

    Filter schedules by a comma-separated list of recipients.

Returns:

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

    ReportScheduleListResponse data, response status code and response headers



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
386
387
388
389
# File 'lib/datadog_api_client/v2/api/report_schedules_api.rb', line 331

def list_report_schedules_with_http_info(opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReportSchedulesAPI.list_report_schedules ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page_limit'].nil? && opts[:'page_limit'] > 50
    fail ArgumentError, 'invalid value for "opts[:"page_limit"]" when calling ReportSchedulesAPI.list_report_schedules, must be smaller than or equal to 50.'
  end
  if @api_client.config.client_side_validation && !opts[:'page_limit'].nil? && opts[:'page_limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_limit"]" when calling ReportSchedulesAPI.list_report_schedules, must be greater than or equal to 1.'
  end
  if @api_client.config.client_side_validation && !opts[:'page_offset'].nil? && opts[:'page_offset'] < 0
    fail ArgumentError, 'invalid value for "opts[:"page_offset"]" when calling ReportSchedulesAPI.list_report_schedules, must be greater than or equal to 0.'
  end
  # resource path
  local_var_path = '/api/v2/reporting/schedule/list'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_limit'].nil?
  query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil?
  query_params[:'filter[title]'] = opts[:'filter_title'] if !opts[:'filter_title'].nil?
  query_params[:'filter[author_uuid]'] = opts[:'filter_author_uuid'] if !opts[:'filter_author_uuid'].nil?
  query_params[:'filter[recipients]'] = opts[:'filter_recipients'] if !opts[:'filter_recipients'].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] || 'ReportScheduleListResponse'

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

  new_options = opts.merge(
    :operation => :list_report_schedules,
    :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: ReportSchedulesAPI#list_report_schedules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch_report_schedule(schedule_uuid, body, opts = {}) ⇒ Object

Update a report schedule.



394
395
396
397
# File 'lib/datadog_api_client/v2/api/report_schedules_api.rb', line 394

def patch_report_schedule(schedule_uuid, body, opts = {})
  data, _status_code, _headers = patch_report_schedule_with_http_info(schedule_uuid, body, opts)
  data
end

#patch_report_schedule_with_http_info(schedule_uuid, body, opts = {}) ⇒ Array<(ReportScheduleResponse, Integer, Hash)>

Update a report schedule.

Update an existing scheduled report by its identifier. The editable attributes are replaced with the supplied values; the targeted resource (resource_id and resource_type) cannot be changed after creation. Requires the generate_dashboard_reports permission and schedule ownership.

Parameters:

  • schedule_uuid (UUID)

    The unique identifier of the report schedule to update.

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

    the optional parameters

Returns:

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

    ReportScheduleResponse data, response status code and response headers



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

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReportSchedulesAPI.patch_report_schedule ...'
  end
  # verify the required parameter 'schedule_uuid' is set
  if @api_client.config.client_side_validation && schedule_uuid.nil?
    fail ArgumentError, "Missing the required parameter 'schedule_uuid' when calling ReportSchedulesAPI.patch_report_schedule"
  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 ReportSchedulesAPI.patch_report_schedule"
  end
  # resource path
  local_var_path = '/api/v2/reporting/schedule/{schedule_uuid}'.sub('{schedule_uuid}', CGI.escape(schedule_uuid.to_s).gsub('%2F', '/'))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['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] || 'ReportScheduleResponse'

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

  new_options = opts.merge(
    :operation => :patch_report_schedule,
    :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: ReportSchedulesAPI#patch_report_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#toggle_report_schedule(schedule_uuid, body, opts = {}) ⇒ Object

Toggle a report schedule.



475
476
477
478
# File 'lib/datadog_api_client/v2/api/report_schedules_api.rb', line 475

def toggle_report_schedule(schedule_uuid, body, opts = {})
  data, _status_code, _headers = toggle_report_schedule_with_http_info(schedule_uuid, body, opts)
  data
end

#toggle_report_schedule_with_http_info(schedule_uuid, body, opts = {}) ⇒ Array<(ReportScheduleResponse, Integer, Hash)>

Toggle a report schedule.

Activate or pause a report schedule by setting its status to active or inactive. Requires a reporting write permission appropriate to the targeted resource type and schedule ownership.

Parameters:

  • schedule_uuid (UUID)

    The unique identifier of the report schedule to toggle.

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

    the optional parameters

Returns:

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

    ReportScheduleResponse data, response status code and response headers



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
542
543
# File 'lib/datadog_api_client/v2/api/report_schedules_api.rb', line 489

def toggle_report_schedule_with_http_info(schedule_uuid, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReportSchedulesAPI.toggle_report_schedule ...'
  end
  # verify the required parameter 'schedule_uuid' is set
  if @api_client.config.client_side_validation && schedule_uuid.nil?
    fail ArgumentError, "Missing the required parameter 'schedule_uuid' when calling ReportSchedulesAPI.toggle_report_schedule"
  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 ReportSchedulesAPI.toggle_report_schedule"
  end
  # resource path
  local_var_path = '/api/v2/reporting/schedule/{schedule_uuid}/toggle'.sub('{schedule_uuid}', CGI.escape(schedule_uuid.to_s).gsub('%2F', '/'))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['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] || 'ReportScheduleResponse'

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

  new_options = opts.merge(
    :operation => :toggle_report_schedule,
    :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: ReportSchedulesAPI#toggle_report_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end