From da4a507645e235479fd1e73b7d4fb83f78a99d30 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 10 Jul 2026 18:04:54 +0000 Subject: [PATCH] Regenerate client from commit a635872 of spec repo --- .generator/schemas/v2/openapi.yaml | 444 ++++++++++++++++++ .../ListDatasetReportSchedules.rb | 5 + examples/v2/report-schedules/PrintReport.rb | 27 ++ features/scenarios_model_mapping.rb | 6 + features/v2/report_schedules.feature | 49 ++ features/v2/undo.json | 12 + lib/datadog_api_client/inflector.rb | 11 + .../v2/api/report_schedules_api.rb | 136 ++++++ .../dataset_report_schedule_list_response.rb | 137 ++++++ .../dataset_report_schedule_resource_type.rb | 26 + ...set_report_schedule_response_attributes.rb | 368 +++++++++++++++ .../dataset_report_schedule_response_data.rb | 186 ++++++++ .../v2/models/print_report_request.rb | 123 +++++ .../models/print_report_request_attributes.rb | 222 +++++++++ .../v2/models/print_report_request_data.rb | 145 ++++++ .../v2/models/print_report_response.rb | 123 +++++ .../print_report_response_attributes.rb | 261 ++++++++++ .../v2/models/print_report_response_data.rb | 165 +++++++ .../v2/models/print_report_type.rb | 26 + 19 files changed, 2472 insertions(+) create mode 100644 examples/v2/report-schedules/ListDatasetReportSchedules.rb create mode 100644 examples/v2/report-schedules/PrintReport.rb create mode 100644 lib/datadog_api_client/v2/models/dataset_report_schedule_list_response.rb create mode 100644 lib/datadog_api_client/v2/models/dataset_report_schedule_resource_type.rb create mode 100644 lib/datadog_api_client/v2/models/dataset_report_schedule_response_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/dataset_report_schedule_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/print_report_request.rb create mode 100644 lib/datadog_api_client/v2/models/print_report_request_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/print_report_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/print_report_response.rb create mode 100644 lib/datadog_api_client/v2/models/print_report_response_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/print_report_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/print_report_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 188cceacbd70..0390d053d054 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -30317,6 +30317,146 @@ components: required: - data type: object + DatasetReportScheduleListResponse: + description: Response containing a list of report schedules for a published dataset. + properties: + data: + description: A list of report schedules for the dataset. + items: + $ref: "#/components/schemas/DatasetReportScheduleResponseData" + type: array + included: + description: Related resources included with the report schedules, such as authors. + items: + $ref: "#/components/schemas/ReportScheduleIncludedResource" + type: array + required: + - data + type: object + DatasetReportScheduleResourceType: + description: The type of resource targeted by a dataset report schedule. + enum: + - widget_dataset_list + example: widget_dataset_list + type: string + x-enum-varnames: + - WIDGET_DATASET_LIST + DatasetReportScheduleResponseAttributes: + description: The configuration and derived state of a report schedule for a published dataset. + properties: + cell_id: + description: The identifier of the notebook cell that published the dataset, or `null` if not set. + example: "sevhjcis" + nullable: true + type: string + dataset_id: + description: The identifier of the dataset, or `null` if not set. + example: "MW5vdGVib29rX2NlbGw6ZDI0ZTM2MWMtZDFlNC00NDYwLWIyOWUtNTg3YTczMzA3MDFm" + nullable: true + type: string + description: + description: The description of the report. + example: "This is a scheduled notebook dataset report." + type: string + file_row_limit: + description: The maximum number of rows included in the attached CSV file, or `null` if not set. + example: 5000 + format: int64 + nullable: true + type: integer + inline_row_limit: + description: The maximum number of rows included inline in the email body, or `null` if not set. + example: 10 + format: int64 + nullable: true + type: integer + next_recurrence: + description: |- + The Unix timestamp, in milliseconds, of the next scheduled delivery, or + `null` if none is scheduled. + example: 1725859200000 + format: int64 + nullable: true + type: integer + notebook_id: + description: The identifier of the notebook containing the dataset cell, or `null` if not set. + example: 1 + format: int64 + nullable: true + type: integer + recipients: + description: |- + The recipients of the report (email addresses, Slack channel references, or + Microsoft Teams channel references). + example: + - "test@datadoghq.com" + items: + description: |- + A single recipient (email address, Slack channel reference, or Microsoft + Teams channel reference). + type: string + type: array + resource_id: + description: The identifier of the widget containing the dataset. + example: "aaaabbbb-1111-2222-3333-444455556666" + type: string + resource_type: + $ref: "#/components/schemas/DatasetReportScheduleResourceType" + rrule: + description: The recurrence rule for the schedule, expressed as an iCalendar `RRULE` string. + example: "DTSTART;TZID=America/New_York:20240912T090000\nRRULE:FREQ=DAILY;BYHOUR=9;BYMINUTE=0" + type: string + status: + $ref: "#/components/schemas/ReportScheduleStatus" + timeframe: + description: The relative timeframe of data included in the report. + example: "calendar_day" + type: string + timezone: + description: The IANA time zone identifier the recurrence rule is evaluated in. + example: "America/New_York" + type: string + title: + description: The title of the report. + example: "My Cool Dataset Report" + type: string + required: + - status + - resource_id + - resource_type + - recipients + - rrule + - timezone + - title + - description + - timeframe + - file_row_limit + - inline_row_limit + - next_recurrence + - notebook_id + - cell_id + - dataset_id + type: object + DatasetReportScheduleResponseData: + description: The JSON:API data object representing a dataset report schedule. + properties: + attributes: + $ref: "#/components/schemas/DatasetReportScheduleResponseAttributes" + id: + description: The unique identifier of the dataset report schedule. + example: "e1234567-1234-1234-1234-123456789012" + format: uuid + type: string + relationships: + $ref: "#/components/schemas/ReportScheduleResponseRelationships" + type: + $ref: "#/components/schemas/ReportScheduleType" + required: + - id + - type + - attributes + - relationships + type: object DatasetRequest: description: |- **Datasets Object Constraints** @@ -75721,6 +75861,149 @@ components: required: - type type: object + PrintReportRequest: + description: Request body for initiating a print-only report. + properties: + data: + $ref: "#/components/schemas/PrintReportRequestData" + required: + - data + type: object + PrintReportRequestAttributes: + description: |- + The configuration for a print-only report. Specify exactly one of `timeframe` (for a + relative time window) or both `from_ts` and `to_ts` (for an absolute time range). + properties: + from_ts: + description: |- + The start of an absolute time range, as a Unix timestamp in milliseconds. + Required when `timeframe` is omitted. + example: 1780318800000 + format: int64 + type: integer + resource_id: + description: The identifier of the dashboard or integration dashboard to render. + example: "abc-def-ghi" + type: string + resource_type: + $ref: "#/components/schemas/ReportScheduleResourceType" + template_variables: + description: The dashboard template variables applied when rendering the report. + items: + $ref: "#/components/schemas/ReportScheduleTemplateVariable" + type: array + timeframe: + description: |- + A relative time window (for example `1w` or `calendar_month`). Mutually + exclusive with `from_ts` and `to_ts`. + example: "1w" + type: string + timezone: + description: The IANA time zone identifier used to evaluate the time window. + example: "America/New_York" + type: string + to_ts: + description: |- + The end of an absolute time range, as a Unix timestamp in milliseconds. + Required when `timeframe` is omitted. + example: 1780923600000 + format: int64 + type: integer + required: + - resource_id + - resource_type + - timezone + - template_variables + type: object + PrintReportRequestData: + description: The JSON:API data object for a print report request. + properties: + attributes: + $ref: "#/components/schemas/PrintReportRequestAttributes" + type: + $ref: "#/components/schemas/PrintReportType" + required: + - type + - attributes + type: object + PrintReportResponse: + description: Response containing the initiated print-only report. + properties: + data: + $ref: "#/components/schemas/PrintReportResponseData" + required: + - data + type: object + PrintReportResponseAttributes: + description: The configuration and download URL for the initiated print-only report. + properties: + download_url: + description: The URL from which the rendered PDF report can be downloaded. + example: "https://app.datadoghq.com/..." + type: string + from_ts: + description: The start of the rendered time range, as a Unix timestamp in milliseconds. + example: 1780318800000 + format: int64 + type: integer + resource_id: + description: The identifier of the dashboard or integration dashboard. + example: "abc-def-ghi" + type: string + resource_type: + $ref: "#/components/schemas/ReportScheduleResourceType" + template_variables: + description: The dashboard template variables applied when rendering the report. + items: + $ref: "#/components/schemas/ReportScheduleTemplateVariable" + type: array + timeframe: + description: The relative time window used, if one was specified in the request. + example: "1w" + type: string + timezone: + description: The IANA time zone identifier used when rendering the report. + example: "America/New_York" + type: string + to_ts: + description: The end of the rendered time range, as a Unix timestamp in milliseconds. + example: 1780923600000 + format: int64 + type: integer + required: + - resource_id + - resource_type + - timezone + - template_variables + - from_ts + - to_ts + - download_url + type: object + PrintReportResponseData: + description: The JSON:API data object for a print-only report. + properties: + attributes: + $ref: "#/components/schemas/PrintReportResponseAttributes" + id: + description: The unique identifier of the report. + example: "11111111-2222-3333-4444-555555555555" + format: uuid + type: string + type: + $ref: "#/components/schemas/PrintReportType" + required: + - id + - type + - attributes + type: object + PrintReportType: + description: JSON:API resource type for a print-only report. + enum: + - report + example: report + type: string + x-enum-varnames: + - REPORT ProcessDataSource: default: process description: A data source for process-level infrastructure metrics. @@ -167828,6 +168111,167 @@ paths: summary: Update replay heatmap snapshot tags: - Rum Replay Heatmaps + /api/v2/reporting/dataset/{dataset_id}/schedules: + get: + description: |- + Retrieve all report schedules for a given published dataset. + Returns report schedules belonging to the authenticated user's organization that target the specified dataset. + Requires the `generate_log_reports` or `manage_log_reports` permission. + operationId: ListDatasetReportSchedules + parameters: + - description: The identifier of the published dataset to retrieve report schedules for. + example: "MW5vdGVib29rX2NlbGw6ZDI0ZTM2MWMtZDFlNC00NDYwLWIyOWUtNTg3YTczMzA3MDFm" + in: path + name: dataset_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + cell_id: "sevhjcis" + dataset_id: "MW5vdGVib29rX2NlbGw6ZDI0ZTM2MWMtZDFlNC00NDYwLWIyOWUtNTg3YTczMzA3MDFm" + description: "This is a scheduled notebook dataset report." + file_row_limit: 5000 + inline_row_limit: 10 + next_recurrence: 1725859200000 + notebook_id: 1 + recipients: + - "test@datadoghq.com" + resource_id: "aaaabbbb-1111-2222-3333-444455556666" + resource_type: widget_dataset_list + rrule: "DTSTART;TZID=America/New_York:20240912T090000\nRRULE:FREQ=DAILY;BYHOUR=9;BYMINUTE=0" + status: active + timeframe: "calendar_day" + timezone: "America/New_York" + title: "My Cool Dataset Report" + id: "e1234567-1234-1234-1234-123456789012" + relationships: + author: + data: + id: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + type: users + type: schedule + included: + - attributes: + email: "user@example.com" + name: "Example User" + id: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + type: users + schema: + $ref: "#/components/schemas/DatasetReportScheduleListResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List dataset report schedules + tags: + - Report Schedules + /api/v2/reporting/print: + post: + description: |- + Initiate a one-off, print-only report for a dashboard or integration dashboard. + The report is rendered as a PDF and made available for download through the URL returned in the response. + Requires a reporting permission appropriate to the targeted resource type. + operationId: PrintReport + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + resource_id: "abc-def-ghi" + resource_type: dashboard + template_variables: + - name: "env" + values: + - "prod" + timeframe: "1w" + timezone: "America/New_York" + type: report + schema: + $ref: "#/components/schemas/PrintReportRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + download_url: "https://app.datadoghq.com/..." + 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 + id: "11111111-2222-3333-4444-555555555555" + type: report + schema: + $ref: "#/components/schemas/PrintReportResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Print a report + tags: + - Report Schedules + x-codegen-request-body-name: body /api/v2/reporting/schedule: post: description: |- diff --git a/examples/v2/report-schedules/ListDatasetReportSchedules.rb b/examples/v2/report-schedules/ListDatasetReportSchedules.rb new file mode 100644 index 000000000000..85583597d257 --- /dev/null +++ b/examples/v2/report-schedules/ListDatasetReportSchedules.rb @@ -0,0 +1,5 @@ +# List dataset report schedules returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ReportSchedulesAPI.new +p api_instance.list_dataset_report_schedules("dataset_id") diff --git a/examples/v2/report-schedules/PrintReport.rb b/examples/v2/report-schedules/PrintReport.rb new file mode 100644 index 000000000000..53c5badc8137 --- /dev/null +++ b/examples/v2/report-schedules/PrintReport.rb @@ -0,0 +1,27 @@ +# Print a report returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ReportSchedulesAPI.new + +body = DatadogAPIClient::V2::PrintReportRequest.new({ + data: DatadogAPIClient::V2::PrintReportRequestData.new({ + attributes: DatadogAPIClient::V2::PrintReportRequestAttributes.new({ + from_ts: 1780318800000, + resource_id: "abc-def-ghi", + resource_type: DatadogAPIClient::V2::ReportScheduleResourceType::DASHBOARD, + template_variables: [ + DatadogAPIClient::V2::ReportScheduleTemplateVariable.new({ + name: "env", + values: [ + "prod", + ], + }), + ], + timeframe: "1w", + timezone: "America/New_York", + to_ts: 1780923600000, + }), + type: DatadogAPIClient::V2::PrintReportType::REPORT, + }), +}) +p api_instance.print_report(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index f4cb633ab3a6..8d6671bc2772 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -4966,6 +4966,12 @@ "snapshot_id" => "String", "body" => "SnapshotUpdateRequest", }, + "v2.ListDatasetReportSchedules" => { + "dataset_id" => "String", + }, + "v2.PrintReport" => { + "body" => "PrintReportRequest", + }, "v2.CreateReportSchedule" => { "body" => "ReportScheduleCreateRequest", }, diff --git a/features/v2/report_schedules.feature b/features/v2/report_schedules.feature index aa62a5e35063..040454887108 100644 --- a/features/v2/report_schedules.feature +++ b/features/v2/report_schedules.feature @@ -99,6 +99,27 @@ Feature: Report Schedules When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: List dataset report schedules returns "Bad Request" response + Given new "ListDatasetReportSchedules" request + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: List dataset report schedules returns "Not Found" response + Given new "ListDatasetReportSchedules" request + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: List dataset report schedules returns "OK" response + Given new "ListDatasetReportSchedules" request + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/reporting-and-sharing Scenario: List report schedules returns "Bad Request" response Given new "ListReportSchedules" request @@ -117,6 +138,34 @@ Feature: Report Schedules When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Print a report returns "Bad Request" response + Given new "PrintReport" request + 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"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Print a report returns "Not Found" response + Given new "PrintReport" request + 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"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Print a report returns "OK" response + Given new "PrintReport" request + 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"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Print a report returns "Unprocessable Entity" response + Given new "PrintReport" request + 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"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/reporting-and-sharing Scenario: Toggle a report schedule returns "Bad Request" response Given new "ToggleReportSchedule" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 1eaba52ee9bf..7438ddae3d26 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -6458,6 +6458,18 @@ "type": "idempotent" } }, + "ListDatasetReportSchedules": { + "tag": "Report Schedules", + "undo": { + "type": "safe" + } + }, + "PrintReport": { + "tag": "Report Schedules", + "undo": { + "type": "unsafe" + } + }, "CreateReportSchedule": { "tag": "Report Schedules", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index bb489f2e6b16..2663ecae571d 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2784,6 +2784,10 @@ def overrides "v2.dataset_attributes_request" => "DatasetAttributesRequest", "v2.dataset_attributes_response" => "DatasetAttributesResponse", "v2.dataset_create_request" => "DatasetCreateRequest", + "v2.dataset_report_schedule_list_response" => "DatasetReportScheduleListResponse", + "v2.dataset_report_schedule_resource_type" => "DatasetReportScheduleResourceType", + "v2.dataset_report_schedule_response_attributes" => "DatasetReportScheduleResponseAttributes", + "v2.dataset_report_schedule_response_data" => "DatasetReportScheduleResponseData", "v2.dataset_request" => "DatasetRequest", "v2.dataset_response" => "DatasetResponse", "v2.dataset_response_multi" => "DatasetResponseMulti", @@ -5677,6 +5681,13 @@ def overrides "v2.powerpacks_response_meta_pagination" => "PowerpacksResponseMetaPagination", "v2.powerpack_template_variable" => "PowerpackTemplateVariable", "v2.preview_entity_response_data" => "PreviewEntityResponseData", + "v2.print_report_request" => "PrintReportRequest", + "v2.print_report_request_attributes" => "PrintReportRequestAttributes", + "v2.print_report_request_data" => "PrintReportRequestData", + "v2.print_report_response" => "PrintReportResponse", + "v2.print_report_response_attributes" => "PrintReportResponseAttributes", + "v2.print_report_response_data" => "PrintReportResponseData", + "v2.print_report_type" => "PrintReportType", "v2.process_data_source" => "ProcessDataSource", "v2.process_scalar_query" => "ProcessScalarQuery", "v2.process_summaries_meta" => "ProcessSummariesMeta", diff --git a/lib/datadog_api_client/v2/api/report_schedules_api.rb b/lib/datadog_api_client/v2/api/report_schedules_api.rb index 64a4e4168103..9873b952fa65 100644 --- a/lib/datadog_api_client/v2/api/report_schedules_api.rb +++ b/lib/datadog_api_client/v2/api/report_schedules_api.rb @@ -307,6 +307,73 @@ def get_report_schedules_for_resource_with_http_info(resource_type, resource_id, return data, status_code, headers end + # List dataset report schedules. + # + # @see #list_dataset_report_schedules_with_http_info + def list_dataset_report_schedules(dataset_id, opts = {}) + data, _status_code, _headers = list_dataset_report_schedules_with_http_info(dataset_id, opts) + data + end + + # List dataset report schedules. + # + # Retrieve all report schedules for a given published dataset. + # Returns report schedules belonging to the authenticated user's organization that target the specified dataset. + # Requires the `generate_log_reports` or `manage_log_reports` permission. + # + # @param dataset_id [String] The identifier of the published dataset to retrieve report schedules for. + # @param opts [Hash] the optional parameters + # @return [Array<(DatasetReportScheduleListResponse, Integer, Hash)>] DatasetReportScheduleListResponse data, response status code and response headers + def list_dataset_report_schedules_with_http_info(dataset_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReportSchedulesAPI.list_dataset_report_schedules ...' + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling ReportSchedulesAPI.list_dataset_report_schedules" + end + # resource path + local_var_path = '/api/v2/reporting/dataset/{dataset_id}/schedules'.sub('{dataset_id}', CGI.escape(dataset_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] || 'DatasetReportScheduleListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_dataset_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_dataset_report_schedules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List report schedules. # # @see #list_report_schedules_with_http_info @@ -469,6 +536,75 @@ def patch_report_schedule_with_http_info(schedule_uuid, body, opts = {}) return data, status_code, headers end + # Print a report. + # + # @see #print_report_with_http_info + def print_report(body, opts = {}) + data, _status_code, _headers = print_report_with_http_info(body, opts) + data + end + + # Print a report. + # + # Initiate a one-off, print-only report for a dashboard or integration dashboard. + # The report is rendered as a PDF and made available for download through the URL returned in the response. + # Requires a reporting permission appropriate to the targeted resource type. + # + # @param body [PrintReportRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(PrintReportResponse, Integer, Hash)>] PrintReportResponse data, response status code and response headers + def print_report_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReportSchedulesAPI.print_report ...' + 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.print_report" + end + # resource path + local_var_path = '/api/v2/reporting/print' + + # 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] || 'PrintReportResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :print_report, + :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#print_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Toggle a report schedule. # # @see #toggle_report_schedule_with_http_info diff --git a/lib/datadog_api_client/v2/models/dataset_report_schedule_list_response.rb b/lib/datadog_api_client/v2/models/dataset_report_schedule_list_response.rb new file mode 100644 index 000000000000..3db8108c8875 --- /dev/null +++ b/lib/datadog_api_client/v2/models/dataset_report_schedule_list_response.rb @@ -0,0 +1,137 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of report schedules for a published dataset. + class DatasetReportScheduleListResponse + include BaseGenericModel + + # A list of report schedules for the dataset. + attr_reader :data + + # Related resources included with the report schedules, such as authors. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DatasetReportScheduleListResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/dataset_report_schedule_resource_type.rb b/lib/datadog_api_client/v2/models/dataset_report_schedule_resource_type.rb new file mode 100644 index 000000000000..701bde69b90c --- /dev/null +++ b/lib/datadog_api_client/v2/models/dataset_report_schedule_resource_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of resource targeted by a dataset report schedule. + class DatasetReportScheduleResourceType + include BaseEnumModel + + WIDGET_DATASET_LIST = "widget_dataset_list".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/dataset_report_schedule_response_attributes.rb b/lib/datadog_api_client/v2/models/dataset_report_schedule_response_attributes.rb new file mode 100644 index 000000000000..e0fd78a28a8a --- /dev/null +++ b/lib/datadog_api_client/v2/models/dataset_report_schedule_response_attributes.rb @@ -0,0 +1,368 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The configuration and derived state of a report schedule for a published dataset. + class DatasetReportScheduleResponseAttributes + include BaseGenericModel + + # The identifier of the notebook cell that published the dataset, or `null` if not set. + attr_accessor :cell_id + + # The identifier of the dataset, or `null` if not set. + attr_accessor :dataset_id + + # The description of the report. + attr_reader :description + + # The maximum number of rows included in the attached CSV file, or `null` if not set. + attr_accessor :file_row_limit + + # The maximum number of rows included inline in the email body, or `null` if not set. + attr_accessor :inline_row_limit + + # The Unix timestamp, in milliseconds, of the next scheduled delivery, or + # `null` if none is scheduled. + attr_accessor :next_recurrence + + # The identifier of the notebook containing the dataset cell, or `null` if not set. + attr_accessor :notebook_id + + # The recipients of the report (email addresses, Slack channel references, or + # Microsoft Teams channel references). + attr_reader :recipients + + # The identifier of the widget containing the dataset. + attr_reader :resource_id + + # The type of resource targeted by a dataset report schedule. + attr_reader :resource_type + + # The recurrence rule for the schedule, expressed as an iCalendar `RRULE` string. + attr_reader :rrule + + # Whether the schedule is currently delivering reports (`active`) or paused (`inactive`). + attr_reader :status + + # The relative timeframe of data included in the report. + attr_reader :timeframe + + # The IANA time zone identifier the recurrence rule is evaluated in. + attr_reader :timezone + + # The title of the report. + attr_reader :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cell_id' => :'cell_id', + :'dataset_id' => :'dataset_id', + :'description' => :'description', + :'file_row_limit' => :'file_row_limit', + :'inline_row_limit' => :'inline_row_limit', + :'next_recurrence' => :'next_recurrence', + :'notebook_id' => :'notebook_id', + :'recipients' => :'recipients', + :'resource_id' => :'resource_id', + :'resource_type' => :'resource_type', + :'rrule' => :'rrule', + :'status' => :'status', + :'timeframe' => :'timeframe', + :'timezone' => :'timezone', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cell_id' => :'String', + :'dataset_id' => :'String', + :'description' => :'String', + :'file_row_limit' => :'Integer', + :'inline_row_limit' => :'Integer', + :'next_recurrence' => :'Integer', + :'notebook_id' => :'Integer', + :'recipients' => :'Array', + :'resource_id' => :'String', + :'resource_type' => :'DatasetReportScheduleResourceType', + :'rrule' => :'String', + :'status' => :'ReportScheduleStatus', + :'timeframe' => :'String', + :'timezone' => :'String', + :'title' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'cell_id', + :'dataset_id', + :'file_row_limit', + :'inline_row_limit', + :'next_recurrence', + :'notebook_id', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DatasetReportScheduleResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'cell_id') + self.cell_id = attributes[:'cell_id'] + end + + if attributes.key?(:'dataset_id') + self.dataset_id = attributes[:'dataset_id'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'file_row_limit') + self.file_row_limit = attributes[:'file_row_limit'] + end + + if attributes.key?(:'inline_row_limit') + self.inline_row_limit = attributes[:'inline_row_limit'] + end + + if attributes.key?(:'next_recurrence') + self.next_recurrence = attributes[:'next_recurrence'] + end + + if attributes.key?(:'notebook_id') + self.notebook_id = attributes[:'notebook_id'] + end + + if attributes.key?(:'recipients') + if (value = attributes[:'recipients']).is_a?(Array) + self.recipients = value + end + end + + if attributes.key?(:'resource_id') + self.resource_id = attributes[:'resource_id'] + end + + if attributes.key?(:'resource_type') + self.resource_type = attributes[:'resource_type'] + end + + if attributes.key?(:'rrule') + self.rrule = attributes[:'rrule'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'timeframe') + self.timeframe = attributes[:'timeframe'] + end + + if attributes.key?(:'timezone') + self.timezone = attributes[:'timezone'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @description.nil? + return false if @recipients.nil? + return false if @resource_id.nil? + return false if @resource_type.nil? + return false if @rrule.nil? + return false if @status.nil? + return false if @timeframe.nil? + return false if @timezone.nil? + return false if @title.nil? + true + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param recipients [Object] Object to be assigned + # @!visibility private + def recipients=(recipients) + if recipients.nil? + fail ArgumentError, 'invalid value for "recipients", recipients cannot be nil.' + end + @recipients = recipients + end + + # Custom attribute writer method with validation + # @param resource_id [Object] Object to be assigned + # @!visibility private + def resource_id=(resource_id) + if resource_id.nil? + fail ArgumentError, 'invalid value for "resource_id", resource_id cannot be nil.' + end + @resource_id = resource_id + end + + # Custom attribute writer method with validation + # @param resource_type [Object] Object to be assigned + # @!visibility private + def resource_type=(resource_type) + if resource_type.nil? + fail ArgumentError, 'invalid value for "resource_type", resource_type cannot be nil.' + end + @resource_type = resource_type + end + + # Custom attribute writer method with validation + # @param rrule [Object] Object to be assigned + # @!visibility private + def rrule=(rrule) + if rrule.nil? + fail ArgumentError, 'invalid value for "rrule", rrule cannot be nil.' + end + @rrule = rrule + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Custom attribute writer method with validation + # @param timeframe [Object] Object to be assigned + # @!visibility private + def timeframe=(timeframe) + if timeframe.nil? + fail ArgumentError, 'invalid value for "timeframe", timeframe cannot be nil.' + end + @timeframe = timeframe + end + + # Custom attribute writer method with validation + # @param timezone [Object] Object to be assigned + # @!visibility private + def timezone=(timezone) + if timezone.nil? + fail ArgumentError, 'invalid value for "timezone", timezone cannot be nil.' + end + @timezone = timezone + end + + # Custom attribute writer method with validation + # @param title [Object] Object to be assigned + # @!visibility private + def title=(title) + if title.nil? + fail ArgumentError, 'invalid value for "title", title cannot be nil.' + end + @title = title + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + cell_id == o.cell_id && + dataset_id == o.dataset_id && + description == o.description && + file_row_limit == o.file_row_limit && + inline_row_limit == o.inline_row_limit && + next_recurrence == o.next_recurrence && + notebook_id == o.notebook_id && + recipients == o.recipients && + resource_id == o.resource_id && + resource_type == o.resource_type && + rrule == o.rrule && + status == o.status && + timeframe == o.timeframe && + timezone == o.timezone && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cell_id, dataset_id, description, file_row_limit, inline_row_limit, next_recurrence, notebook_id, recipients, resource_id, resource_type, rrule, status, timeframe, timezone, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/dataset_report_schedule_response_data.rb b/lib/datadog_api_client/v2/models/dataset_report_schedule_response_data.rb new file mode 100644 index 000000000000..b3b9a5b32cc7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/dataset_report_schedule_response_data.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The JSON:API data object representing a dataset report schedule. + class DatasetReportScheduleResponseData + include BaseGenericModel + + # The configuration and derived state of a report schedule for a published dataset. + attr_reader :attributes + + # The unique identifier of the dataset report schedule. + attr_reader :id + + # Relationships for the report schedule. + attr_reader :relationships + + # JSON:API resource type for report schedules. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'DatasetReportScheduleResponseAttributes', + :'id' => :'UUID', + :'relationships' => :'ReportScheduleResponseRelationships', + :'type' => :'ReportScheduleType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DatasetReportScheduleResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @relationships.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param relationships [Object] Object to be assigned + # @!visibility private + def relationships=(relationships) + if relationships.nil? + fail ArgumentError, 'invalid value for "relationships", relationships cannot be nil.' + end + @relationships = relationships + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/print_report_request.rb b/lib/datadog_api_client/v2/models/print_report_request.rb new file mode 100644 index 000000000000..c90e0273aae0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/print_report_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for initiating a print-only report. + class PrintReportRequest + include BaseGenericModel + + # The JSON:API data object for a print report request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'PrintReportRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PrintReportRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/print_report_request_attributes.rb b/lib/datadog_api_client/v2/models/print_report_request_attributes.rb new file mode 100644 index 000000000000..8eaf27069426 --- /dev/null +++ b/lib/datadog_api_client/v2/models/print_report_request_attributes.rb @@ -0,0 +1,222 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The configuration for a print-only report. Specify exactly one of `timeframe` (for a + # relative time window) or both `from_ts` and `to_ts` (for an absolute time range). + class PrintReportRequestAttributes + include BaseGenericModel + + # The start of an absolute time range, as a Unix timestamp in milliseconds. + # Required when `timeframe` is omitted. + attr_accessor :from_ts + + # The identifier of the dashboard or integration dashboard to render. + attr_reader :resource_id + + # The type of dashboard resource the report schedule targets. + attr_reader :resource_type + + # The dashboard template variables applied when rendering the report. + attr_reader :template_variables + + # A relative time window (for example `1w` or `calendar_month`). Mutually + # exclusive with `from_ts` and `to_ts`. + attr_accessor :timeframe + + # The IANA time zone identifier used to evaluate the time window. + attr_reader :timezone + + # The end of an absolute time range, as a Unix timestamp in milliseconds. + # Required when `timeframe` is omitted. + attr_accessor :to_ts + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'from_ts' => :'from_ts', + :'resource_id' => :'resource_id', + :'resource_type' => :'resource_type', + :'template_variables' => :'template_variables', + :'timeframe' => :'timeframe', + :'timezone' => :'timezone', + :'to_ts' => :'to_ts' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'from_ts' => :'Integer', + :'resource_id' => :'String', + :'resource_type' => :'ReportScheduleResourceType', + :'template_variables' => :'Array', + :'timeframe' => :'String', + :'timezone' => :'String', + :'to_ts' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PrintReportRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'from_ts') + self.from_ts = attributes[:'from_ts'] + end + + if attributes.key?(:'resource_id') + self.resource_id = attributes[:'resource_id'] + end + + if attributes.key?(:'resource_type') + self.resource_type = attributes[:'resource_type'] + end + + if attributes.key?(:'template_variables') + if (value = attributes[:'template_variables']).is_a?(Array) + self.template_variables = value + end + end + + if attributes.key?(:'timeframe') + self.timeframe = attributes[:'timeframe'] + end + + if attributes.key?(:'timezone') + self.timezone = attributes[:'timezone'] + end + + if attributes.key?(:'to_ts') + self.to_ts = attributes[:'to_ts'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @resource_id.nil? + return false if @resource_type.nil? + return false if @template_variables.nil? + return false if @timezone.nil? + true + end + + # Custom attribute writer method with validation + # @param resource_id [Object] Object to be assigned + # @!visibility private + def resource_id=(resource_id) + if resource_id.nil? + fail ArgumentError, 'invalid value for "resource_id", resource_id cannot be nil.' + end + @resource_id = resource_id + end + + # Custom attribute writer method with validation + # @param resource_type [Object] Object to be assigned + # @!visibility private + def resource_type=(resource_type) + if resource_type.nil? + fail ArgumentError, 'invalid value for "resource_type", resource_type cannot be nil.' + end + @resource_type = resource_type + end + + # Custom attribute writer method with validation + # @param template_variables [Object] Object to be assigned + # @!visibility private + def template_variables=(template_variables) + if template_variables.nil? + fail ArgumentError, 'invalid value for "template_variables", template_variables cannot be nil.' + end + @template_variables = template_variables + end + + # Custom attribute writer method with validation + # @param timezone [Object] Object to be assigned + # @!visibility private + def timezone=(timezone) + if timezone.nil? + fail ArgumentError, 'invalid value for "timezone", timezone cannot be nil.' + end + @timezone = timezone + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + from_ts == o.from_ts && + resource_id == o.resource_id && + resource_type == o.resource_type && + template_variables == o.template_variables && + timeframe == o.timeframe && + timezone == o.timezone && + to_ts == o.to_ts && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [from_ts, resource_id, resource_type, template_variables, timeframe, timezone, to_ts, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/print_report_request_data.rb b/lib/datadog_api_client/v2/models/print_report_request_data.rb new file mode 100644 index 000000000000..61f317e06b31 --- /dev/null +++ b/lib/datadog_api_client/v2/models/print_report_request_data.rb @@ -0,0 +1,145 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The JSON:API data object for a print report request. + class PrintReportRequestData + include BaseGenericModel + + # The configuration for a print-only report. Specify exactly one of `timeframe` (for a + # relative time window) or both `from_ts` and `to_ts` (for an absolute time range). + attr_reader :attributes + + # JSON:API resource type for a print-only report. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'PrintReportRequestAttributes', + :'type' => :'PrintReportType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PrintReportRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/print_report_response.rb b/lib/datadog_api_client/v2/models/print_report_response.rb new file mode 100644 index 000000000000..0874d4642e1d --- /dev/null +++ b/lib/datadog_api_client/v2/models/print_report_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing the initiated print-only report. + class PrintReportResponse + include BaseGenericModel + + # The JSON:API data object for a print-only report. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'PrintReportResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PrintReportResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/print_report_response_attributes.rb b/lib/datadog_api_client/v2/models/print_report_response_attributes.rb new file mode 100644 index 000000000000..a5fc04fc8020 --- /dev/null +++ b/lib/datadog_api_client/v2/models/print_report_response_attributes.rb @@ -0,0 +1,261 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The configuration and download URL for the initiated print-only report. + class PrintReportResponseAttributes + include BaseGenericModel + + # The URL from which the rendered PDF report can be downloaded. + attr_reader :download_url + + # The start of the rendered time range, as a Unix timestamp in milliseconds. + attr_reader :from_ts + + # The identifier of the dashboard or integration dashboard. + attr_reader :resource_id + + # The type of dashboard resource the report schedule targets. + attr_reader :resource_type + + # The dashboard template variables applied when rendering the report. + attr_reader :template_variables + + # The relative time window used, if one was specified in the request. + attr_accessor :timeframe + + # The IANA time zone identifier used when rendering the report. + attr_reader :timezone + + # The end of the rendered time range, as a Unix timestamp in milliseconds. + attr_reader :to_ts + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'download_url' => :'download_url', + :'from_ts' => :'from_ts', + :'resource_id' => :'resource_id', + :'resource_type' => :'resource_type', + :'template_variables' => :'template_variables', + :'timeframe' => :'timeframe', + :'timezone' => :'timezone', + :'to_ts' => :'to_ts' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'download_url' => :'String', + :'from_ts' => :'Integer', + :'resource_id' => :'String', + :'resource_type' => :'ReportScheduleResourceType', + :'template_variables' => :'Array', + :'timeframe' => :'String', + :'timezone' => :'String', + :'to_ts' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PrintReportResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'download_url') + self.download_url = attributes[:'download_url'] + end + + if attributes.key?(:'from_ts') + self.from_ts = attributes[:'from_ts'] + end + + if attributes.key?(:'resource_id') + self.resource_id = attributes[:'resource_id'] + end + + if attributes.key?(:'resource_type') + self.resource_type = attributes[:'resource_type'] + end + + if attributes.key?(:'template_variables') + if (value = attributes[:'template_variables']).is_a?(Array) + self.template_variables = value + end + end + + if attributes.key?(:'timeframe') + self.timeframe = attributes[:'timeframe'] + end + + if attributes.key?(:'timezone') + self.timezone = attributes[:'timezone'] + end + + if attributes.key?(:'to_ts') + self.to_ts = attributes[:'to_ts'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @download_url.nil? + return false if @from_ts.nil? + return false if @resource_id.nil? + return false if @resource_type.nil? + return false if @template_variables.nil? + return false if @timezone.nil? + return false if @to_ts.nil? + true + end + + # Custom attribute writer method with validation + # @param download_url [Object] Object to be assigned + # @!visibility private + def download_url=(download_url) + if download_url.nil? + fail ArgumentError, 'invalid value for "download_url", download_url cannot be nil.' + end + @download_url = download_url + end + + # Custom attribute writer method with validation + # @param from_ts [Object] Object to be assigned + # @!visibility private + def from_ts=(from_ts) + if from_ts.nil? + fail ArgumentError, 'invalid value for "from_ts", from_ts cannot be nil.' + end + @from_ts = from_ts + end + + # Custom attribute writer method with validation + # @param resource_id [Object] Object to be assigned + # @!visibility private + def resource_id=(resource_id) + if resource_id.nil? + fail ArgumentError, 'invalid value for "resource_id", resource_id cannot be nil.' + end + @resource_id = resource_id + end + + # Custom attribute writer method with validation + # @param resource_type [Object] Object to be assigned + # @!visibility private + def resource_type=(resource_type) + if resource_type.nil? + fail ArgumentError, 'invalid value for "resource_type", resource_type cannot be nil.' + end + @resource_type = resource_type + end + + # Custom attribute writer method with validation + # @param template_variables [Object] Object to be assigned + # @!visibility private + def template_variables=(template_variables) + if template_variables.nil? + fail ArgumentError, 'invalid value for "template_variables", template_variables cannot be nil.' + end + @template_variables = template_variables + end + + # Custom attribute writer method with validation + # @param timezone [Object] Object to be assigned + # @!visibility private + def timezone=(timezone) + if timezone.nil? + fail ArgumentError, 'invalid value for "timezone", timezone cannot be nil.' + end + @timezone = timezone + end + + # Custom attribute writer method with validation + # @param to_ts [Object] Object to be assigned + # @!visibility private + def to_ts=(to_ts) + if to_ts.nil? + fail ArgumentError, 'invalid value for "to_ts", to_ts cannot be nil.' + end + @to_ts = to_ts + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + download_url == o.download_url && + from_ts == o.from_ts && + resource_id == o.resource_id && + resource_type == o.resource_type && + template_variables == o.template_variables && + timeframe == o.timeframe && + timezone == o.timezone && + to_ts == o.to_ts && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [download_url, from_ts, resource_id, resource_type, template_variables, timeframe, timezone, to_ts, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/print_report_response_data.rb b/lib/datadog_api_client/v2/models/print_report_response_data.rb new file mode 100644 index 000000000000..416876ade885 --- /dev/null +++ b/lib/datadog_api_client/v2/models/print_report_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The JSON:API data object for a print-only report. + class PrintReportResponseData + include BaseGenericModel + + # The configuration and download URL for the initiated print-only report. + attr_reader :attributes + + # The unique identifier of the report. + attr_reader :id + + # JSON:API resource type for a print-only report. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'PrintReportResponseAttributes', + :'id' => :'UUID', + :'type' => :'PrintReportType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PrintReportResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/print_report_type.rb b/lib/datadog_api_client/v2/models/print_report_type.rb new file mode 100644 index 000000000000..17203438ad70 --- /dev/null +++ b/lib/datadog_api_client/v2/models/print_report_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # JSON:API resource type for a print-only report. + class PrintReportType + include BaseEnumModel + + REPORT = "report".freeze + end +end