Skip to content

Commit 2e02a56

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 511ff5d of spec repo (#3568)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent b233cb0 commit 2e02a56

19 files changed

Lines changed: 2472 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 444 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# List dataset report schedules returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::ReportSchedulesAPI.new
5+
p api_instance.list_dataset_report_schedules("dataset_id")
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Print a report returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::ReportSchedulesAPI.new
5+
6+
body = DatadogAPIClient::V2::PrintReportRequest.new({
7+
data: DatadogAPIClient::V2::PrintReportRequestData.new({
8+
attributes: DatadogAPIClient::V2::PrintReportRequestAttributes.new({
9+
from_ts: 1780318800000,
10+
resource_id: "abc-def-ghi",
11+
resource_type: DatadogAPIClient::V2::ReportScheduleResourceType::DASHBOARD,
12+
template_variables: [
13+
DatadogAPIClient::V2::ReportScheduleTemplateVariable.new({
14+
name: "env",
15+
values: [
16+
"prod",
17+
],
18+
}),
19+
],
20+
timeframe: "1w",
21+
timezone: "America/New_York",
22+
to_ts: 1780923600000,
23+
}),
24+
type: DatadogAPIClient::V2::PrintReportType::REPORT,
25+
}),
26+
})
27+
p api_instance.print_report(body)

features/scenarios_model_mapping.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4976,6 +4976,12 @@
49764976
"snapshot_id" => "String",
49774977
"body" => "SnapshotUpdateRequest",
49784978
},
4979+
"v2.ListDatasetReportSchedules" => {
4980+
"dataset_id" => "String",
4981+
},
4982+
"v2.PrintReport" => {
4983+
"body" => "PrintReportRequest",
4984+
},
49794985
"v2.CreateReportSchedule" => {
49804986
"body" => "ReportScheduleCreateRequest",
49814987
},

features/v2/report_schedules.feature

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,27 @@ Feature: Report Schedules
9999
When the request is sent
100100
Then the response status is 200 OK
101101

102+
@generated @skip @team:DataDog/reporting-and-sharing
103+
Scenario: List dataset report schedules returns "Bad Request" response
104+
Given new "ListDatasetReportSchedules" request
105+
And request contains "dataset_id" parameter from "REPLACE.ME"
106+
When the request is sent
107+
Then the response status is 400 Bad Request
108+
109+
@generated @skip @team:DataDog/reporting-and-sharing
110+
Scenario: List dataset report schedules returns "Not Found" response
111+
Given new "ListDatasetReportSchedules" request
112+
And request contains "dataset_id" parameter from "REPLACE.ME"
113+
When the request is sent
114+
Then the response status is 404 Not Found
115+
116+
@generated @skip @team:DataDog/reporting-and-sharing
117+
Scenario: List dataset report schedules returns "OK" response
118+
Given new "ListDatasetReportSchedules" request
119+
And request contains "dataset_id" parameter from "REPLACE.ME"
120+
When the request is sent
121+
Then the response status is 200 OK
122+
102123
@generated @skip @team:DataDog/reporting-and-sharing
103124
Scenario: List report schedules returns "Bad Request" response
104125
Given new "ListReportSchedules" request
@@ -117,6 +138,34 @@ Feature: Report Schedules
117138
When the request is sent
118139
Then the response status is 200 OK
119140

141+
@generated @skip @team:DataDog/reporting-and-sharing
142+
Scenario: Print a report returns "Bad Request" response
143+
Given new "PrintReport" request
144+
And body with value {"data": {"attributes": {"from_ts": 1780318800000, "resource_id": "abc-def-ghi", "resource_type": "dashboard", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "1w", "timezone": "America/New_York", "to_ts": 1780923600000}, "type": "report"}}
145+
When the request is sent
146+
Then the response status is 400 Bad Request
147+
148+
@generated @skip @team:DataDog/reporting-and-sharing
149+
Scenario: Print a report returns "Not Found" response
150+
Given new "PrintReport" request
151+
And body with value {"data": {"attributes": {"from_ts": 1780318800000, "resource_id": "abc-def-ghi", "resource_type": "dashboard", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "1w", "timezone": "America/New_York", "to_ts": 1780923600000}, "type": "report"}}
152+
When the request is sent
153+
Then the response status is 404 Not Found
154+
155+
@generated @skip @team:DataDog/reporting-and-sharing
156+
Scenario: Print a report returns "OK" response
157+
Given new "PrintReport" request
158+
And body with value {"data": {"attributes": {"from_ts": 1780318800000, "resource_id": "abc-def-ghi", "resource_type": "dashboard", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "1w", "timezone": "America/New_York", "to_ts": 1780923600000}, "type": "report"}}
159+
When the request is sent
160+
Then the response status is 200 OK
161+
162+
@generated @skip @team:DataDog/reporting-and-sharing
163+
Scenario: Print a report returns "Unprocessable Entity" response
164+
Given new "PrintReport" request
165+
And body with value {"data": {"attributes": {"from_ts": 1780318800000, "resource_id": "abc-def-ghi", "resource_type": "dashboard", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "1w", "timezone": "America/New_York", "to_ts": 1780923600000}, "type": "report"}}
166+
When the request is sent
167+
Then the response status is 422 Unprocessable Entity
168+
120169
@generated @skip @team:DataDog/reporting-and-sharing
121170
Scenario: Toggle a report schedule returns "Bad Request" response
122171
Given new "ToggleReportSchedule" request

features/v2/undo.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6476,6 +6476,18 @@
64766476
"type": "idempotent"
64776477
}
64786478
},
6479+
"ListDatasetReportSchedules": {
6480+
"tag": "Report Schedules",
6481+
"undo": {
6482+
"type": "safe"
6483+
}
6484+
},
6485+
"PrintReport": {
6486+
"tag": "Report Schedules",
6487+
"undo": {
6488+
"type": "unsafe"
6489+
}
6490+
},
64796491
"CreateReportSchedule": {
64806492
"tag": "Report Schedules",
64816493
"undo": {

lib/datadog_api_client/inflector.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2798,6 +2798,10 @@ def overrides
27982798
"v2.dataset_attributes_request" => "DatasetAttributesRequest",
27992799
"v2.dataset_attributes_response" => "DatasetAttributesResponse",
28002800
"v2.dataset_create_request" => "DatasetCreateRequest",
2801+
"v2.dataset_report_schedule_list_response" => "DatasetReportScheduleListResponse",
2802+
"v2.dataset_report_schedule_resource_type" => "DatasetReportScheduleResourceType",
2803+
"v2.dataset_report_schedule_response_attributes" => "DatasetReportScheduleResponseAttributes",
2804+
"v2.dataset_report_schedule_response_data" => "DatasetReportScheduleResponseData",
28012805
"v2.dataset_request" => "DatasetRequest",
28022806
"v2.dataset_response" => "DatasetResponse",
28032807
"v2.dataset_response_multi" => "DatasetResponseMulti",
@@ -5692,6 +5696,13 @@ def overrides
56925696
"v2.powerpacks_response_meta_pagination" => "PowerpacksResponseMetaPagination",
56935697
"v2.powerpack_template_variable" => "PowerpackTemplateVariable",
56945698
"v2.preview_entity_response_data" => "PreviewEntityResponseData",
5699+
"v2.print_report_request" => "PrintReportRequest",
5700+
"v2.print_report_request_attributes" => "PrintReportRequestAttributes",
5701+
"v2.print_report_request_data" => "PrintReportRequestData",
5702+
"v2.print_report_response" => "PrintReportResponse",
5703+
"v2.print_report_response_attributes" => "PrintReportResponseAttributes",
5704+
"v2.print_report_response_data" => "PrintReportResponseData",
5705+
"v2.print_report_type" => "PrintReportType",
56955706
"v2.process_data_source" => "ProcessDataSource",
56965707
"v2.process_scalar_query" => "ProcessScalarQuery",
56975708
"v2.process_summaries_meta" => "ProcessSummariesMeta",

lib/datadog_api_client/v2/api/report_schedules_api.rb

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,73 @@ def get_report_schedules_for_resource_with_http_info(resource_type, resource_id,
307307
return data, status_code, headers
308308
end
309309

310+
# List dataset report schedules.
311+
#
312+
# @see #list_dataset_report_schedules_with_http_info
313+
def list_dataset_report_schedules(dataset_id, opts = {})
314+
data, _status_code, _headers = list_dataset_report_schedules_with_http_info(dataset_id, opts)
315+
data
316+
end
317+
318+
# List dataset report schedules.
319+
#
320+
# Retrieve all report schedules for a given published dataset.
321+
# Returns report schedules belonging to the authenticated user's organization that target the specified dataset.
322+
# Requires the `generate_log_reports` or `manage_log_reports` permission.
323+
#
324+
# @param dataset_id [String] The identifier of the published dataset to retrieve report schedules for.
325+
# @param opts [Hash] the optional parameters
326+
# @return [Array<(DatasetReportScheduleListResponse, Integer, Hash)>] DatasetReportScheduleListResponse data, response status code and response headers
327+
def list_dataset_report_schedules_with_http_info(dataset_id, opts = {})
328+
329+
if @api_client.config.debugging
330+
@api_client.config.logger.debug 'Calling API: ReportSchedulesAPI.list_dataset_report_schedules ...'
331+
end
332+
# verify the required parameter 'dataset_id' is set
333+
if @api_client.config.client_side_validation && dataset_id.nil?
334+
fail ArgumentError, "Missing the required parameter 'dataset_id' when calling ReportSchedulesAPI.list_dataset_report_schedules"
335+
end
336+
# resource path
337+
local_var_path = '/api/v2/reporting/dataset/{dataset_id}/schedules'.sub('{dataset_id}', CGI.escape(dataset_id.to_s).gsub('%2F', '/'))
338+
339+
# query parameters
340+
query_params = opts[:query_params] || {}
341+
342+
# header parameters
343+
header_params = opts[:header_params] || {}
344+
# HTTP header 'Accept' (if needed)
345+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
346+
347+
# form parameters
348+
form_params = opts[:form_params] || {}
349+
350+
# http body (model)
351+
post_body = opts[:debug_body]
352+
353+
# return_type
354+
return_type = opts[:debug_return_type] || 'DatasetReportScheduleListResponse'
355+
356+
# auth_names
357+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
358+
359+
new_options = opts.merge(
360+
:operation => :list_dataset_report_schedules,
361+
:header_params => header_params,
362+
:query_params => query_params,
363+
:form_params => form_params,
364+
:body => post_body,
365+
:auth_names => auth_names,
366+
:return_type => return_type,
367+
:api_version => "V2"
368+
)
369+
370+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
371+
if @api_client.config.debugging
372+
@api_client.config.logger.debug "API called: ReportSchedulesAPI#list_dataset_report_schedules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
373+
end
374+
return data, status_code, headers
375+
end
376+
310377
# List report schedules.
311378
#
312379
# @see #list_report_schedules_with_http_info
@@ -469,6 +536,75 @@ def patch_report_schedule_with_http_info(schedule_uuid, body, opts = {})
469536
return data, status_code, headers
470537
end
471538

539+
# Print a report.
540+
#
541+
# @see #print_report_with_http_info
542+
def print_report(body, opts = {})
543+
data, _status_code, _headers = print_report_with_http_info(body, opts)
544+
data
545+
end
546+
547+
# Print a report.
548+
#
549+
# Initiate a one-off, print-only report for a dashboard or integration dashboard.
550+
# The report is rendered as a PDF and made available for download through the URL returned in the response.
551+
# Requires a reporting permission appropriate to the targeted resource type.
552+
#
553+
# @param body [PrintReportRequest]
554+
# @param opts [Hash] the optional parameters
555+
# @return [Array<(PrintReportResponse, Integer, Hash)>] PrintReportResponse data, response status code and response headers
556+
def print_report_with_http_info(body, opts = {})
557+
558+
if @api_client.config.debugging
559+
@api_client.config.logger.debug 'Calling API: ReportSchedulesAPI.print_report ...'
560+
end
561+
# verify the required parameter 'body' is set
562+
if @api_client.config.client_side_validation && body.nil?
563+
fail ArgumentError, "Missing the required parameter 'body' when calling ReportSchedulesAPI.print_report"
564+
end
565+
# resource path
566+
local_var_path = '/api/v2/reporting/print'
567+
568+
# query parameters
569+
query_params = opts[:query_params] || {}
570+
571+
# header parameters
572+
header_params = opts[:header_params] || {}
573+
# HTTP header 'Accept' (if needed)
574+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
575+
# HTTP header 'Content-Type'
576+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
577+
578+
# form parameters
579+
form_params = opts[:form_params] || {}
580+
581+
# http body (model)
582+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
583+
584+
# return_type
585+
return_type = opts[:debug_return_type] || 'PrintReportResponse'
586+
587+
# auth_names
588+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
589+
590+
new_options = opts.merge(
591+
:operation => :print_report,
592+
:header_params => header_params,
593+
:query_params => query_params,
594+
:form_params => form_params,
595+
:body => post_body,
596+
:auth_names => auth_names,
597+
:return_type => return_type,
598+
:api_version => "V2"
599+
)
600+
601+
data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
602+
if @api_client.config.debugging
603+
@api_client.config.logger.debug "API called: ReportSchedulesAPI#print_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
604+
end
605+
return data, status_code, headers
606+
end
607+
472608
# Toggle a report schedule.
473609
#
474610
# @see #toggle_report_schedule_with_http_info

0 commit comments

Comments
 (0)