From dd589b3d9ee4adaad86e499edfbb5a98c63383eb Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 13 Jul 2026 22:59:32 +0000 Subject: [PATCH] Regenerate client from commit 511ff5d of spec repo --- .generator/schemas/v2/openapi.yaml | 505 +++++++++++++++++- .../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 | 16 +- .../v2/api/report_schedules_api.rb | 136 +++++ .../dataset_report_schedule_list_response.rb | 137 +++++ ... dataset_report_schedule_resource_type.rb} | 7 +- ...set_report_schedule_response_attributes.rb | 368 +++++++++++++ .../dataset_report_schedule_response_data.rb | 186 +++++++ ...ipeline_tag_cardinality_limit_processor.rb | 23 +- ...dinality_limit_processor_override_type.rb} | 4 +- ...nality_limit_processor_per_metric_limit.rb | 32 +- ...rdinality_limit_processor_per_tag_limit.rb | 30 +- ...rdinality_limit_processor_tracking_mode.rb | 123 +++++ ...lity_limit_processor_tracking_mode_mode.rb | 27 + .../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 + 25 files changed, 2693 insertions(+), 65 deletions(-) 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 rename lib/datadog_api_client/v2/models/{observability_pipeline_tag_cardinality_limit_processor_per_metric_mode.rb => dataset_report_schedule_resource_type.rb} (69%) 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 rename lib/datadog_api_client/v2/models/{observability_pipeline_tag_cardinality_limit_processor_per_tag_mode.rb => observability_pipeline_tag_cardinality_limit_processor_override_type.rb} (75%) create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_tracking_mode.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_tracking_mode_mode.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 49e923cae4cb..a67c3bf1fdb0 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -30514,6 +30514,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** @@ -70492,6 +70632,8 @@ components: $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit" maxItems: 100 type: array + tracking_mode: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode" type: $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorType" value_limit: @@ -70506,6 +70648,7 @@ components: - type - include - limit_exceeded_action + - tracking_mode - value_limit - enabled type: object @@ -70520,6 +70663,16 @@ components: x-enum-varnames: - DROP_TAG - DROP_EVENT + ObservabilityPipelineTagCardinalityLimitProcessorOverrideType: + description: How the override is applied. `limit_override` enforces a custom limit; `excluded` omits the metric or tag from cardinality tracking. + enum: + - limit_override + - excluded + example: limit_override + type: string + x-enum-varnames: + - LIMIT_OVERRIDE + - EXCLUDED ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit: description: A cardinality override applied to a specific metric. properties: @@ -70529,16 +70682,16 @@ components: description: The name of the metric this override applies to. example: "system.cpu.user" type: string - mode: - $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode" + override_type: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorOverrideType" per_tag_limits: - description: A list of per-tag cardinality overrides that apply within this metric. Must be omitted when `mode` is `excluded`. + description: A list of per-tag cardinality overrides that apply within this metric. Must be omitted when `override_type` is `excluded`. items: $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit" maxItems: 50 type: array value_limit: - description: The maximum number of distinct tag value combinations allowed for this metric. Required when `mode` is `tracked`. Must be omitted when `mode` is `excluded`. + description: The maximum number of distinct tag value combinations allowed for this metric. Required when `override_type` is `limit_override`. Must be omitted when `override_type` is `excluded`. example: 10000 format: int64 maximum: 1000000 @@ -70546,29 +70699,19 @@ components: type: integer required: - metric_name - - mode + - override_type type: object - ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode: - description: How the per-metric override is applied. `tracked` enforces a custom limit; `excluded` skips the metric entirely. - enum: - - tracked - - excluded - example: tracked - type: string - x-enum-varnames: - - TRACKED - - EXCLUDED ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit: description: A cardinality override for a specific tag key within a per-metric limit. properties: - mode: - $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode" + override_type: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorOverrideType" tag_key: description: The tag key this override applies to. example: "host" type: string value_limit: - description: The maximum number of distinct values allowed for this tag. Required when `mode` is `limit_override`. Must be omitted when `mode` is `excluded`. + description: The maximum number of distinct values allowed for this tag. Required when `override_type` is `limit_override`. Must be omitted when `override_type` is `excluded`. example: 5000 format: int64 maximum: 1000000 @@ -70576,18 +70719,26 @@ components: type: integer required: - tag_key + - override_type + type: object + ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode: + description: Controls whether the processor uses exact or probabilistic tag tracking. + properties: + mode: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode" + required: - mode type: object - ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode: - description: How the per-tag override is applied. `limit_override` enforces a custom limit on the tag; `excluded` skips the tag from cardinality tracking. + ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode: + description: The cardinality tracking algorithm to use. enum: - - limit_override - - excluded - example: limit_override + - exact_fingerprint + - probabilistic + example: exact_fingerprint type: string x-enum-varnames: - - LIMIT_OVERRIDE - - EXCLUDED + - EXACT_FINGERPRINT + - PROBABILISTIC ObservabilityPipelineTagCardinalityLimitProcessorType: default: tag_cardinality_limit description: The processor type. The value must be `tag_cardinality_limit`. @@ -75913,6 +76064,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. @@ -168146,6 +168440,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 8726846681a9..e3d333633eb9 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -4973,6 +4973,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 22089f0ecea4..36d5bd4d9472 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -6470,6 +6470,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 26d9c514205b..ba94a9e2ceb5 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2798,6 +2798,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", @@ -5305,10 +5309,11 @@ def overrides "v2.observability_pipeline_syslog_source_mode" => "ObservabilityPipelineSyslogSourceMode", "v2.observability_pipeline_tag_cardinality_limit_processor" => "ObservabilityPipelineTagCardinalityLimitProcessor", "v2.observability_pipeline_tag_cardinality_limit_processor_action" => "ObservabilityPipelineTagCardinalityLimitProcessorAction", + "v2.observability_pipeline_tag_cardinality_limit_processor_override_type" => "ObservabilityPipelineTagCardinalityLimitProcessorOverrideType", "v2.observability_pipeline_tag_cardinality_limit_processor_per_metric_limit" => "ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit", - "v2.observability_pipeline_tag_cardinality_limit_processor_per_metric_mode" => "ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode", "v2.observability_pipeline_tag_cardinality_limit_processor_per_tag_limit" => "ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit", - "v2.observability_pipeline_tag_cardinality_limit_processor_per_tag_mode" => "ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode", + "v2.observability_pipeline_tag_cardinality_limit_processor_tracking_mode" => "ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode", + "v2.observability_pipeline_tag_cardinality_limit_processor_tracking_mode_mode" => "ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode", "v2.observability_pipeline_tag_cardinality_limit_processor_type" => "ObservabilityPipelineTagCardinalityLimitProcessorType", "v2.observability_pipeline_throttle_processor" => "ObservabilityPipelineThrottleProcessor", "v2.observability_pipeline_throttle_processor_type" => "ObservabilityPipelineThrottleProcessorType", @@ -5691,6 +5696,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/observability_pipeline_tag_cardinality_limit_processor_per_metric_mode.rb b/lib/datadog_api_client/v2/models/dataset_report_schedule_resource_type.rb similarity index 69% rename from lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_metric_mode.rb rename to lib/datadog_api_client/v2/models/dataset_report_schedule_resource_type.rb index 0a73d35dbc7e..701bde69b90c 100644 --- a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_metric_mode.rb +++ b/lib/datadog_api_client/v2/models/dataset_report_schedule_resource_type.rb @@ -17,11 +17,10 @@ require 'time' module DatadogAPIClient::V2 - # How the per-metric override is applied. `tracked` enforces a custom limit; `excluded` skips the metric entirely. - class ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode + # The type of resource targeted by a dataset report schedule. + class DatasetReportScheduleResourceType include BaseEnumModel - TRACKED = "tracked".freeze - EXCLUDED = "excluded".freeze + 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/observability_pipeline_tag_cardinality_limit_processor.rb b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor.rb index 1b38d76515bb..859f84e4b397 100644 --- a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor.rb +++ b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor.rb @@ -41,6 +41,9 @@ class ObservabilityPipelineTagCardinalityLimitProcessor # A list of per-metric cardinality overrides that take precedence over the default `value_limit`. attr_reader :per_metric_limits + # Controls whether the processor uses exact or probabilistic tag tracking. + attr_reader :tracking_mode + # The processor type. The value must be `tag_cardinality_limit`. attr_reader :type @@ -59,6 +62,7 @@ def self.attribute_map :'include' => :'include', :'limit_exceeded_action' => :'limit_exceeded_action', :'per_metric_limits' => :'per_metric_limits', + :'tracking_mode' => :'tracking_mode', :'type' => :'type', :'value_limit' => :'value_limit' } @@ -74,6 +78,7 @@ def self.openapi_types :'include' => :'String', :'limit_exceeded_action' => :'ObservabilityPipelineTagCardinalityLimitProcessorAction', :'per_metric_limits' => :'Array', + :'tracking_mode' => :'ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode', :'type' => :'ObservabilityPipelineTagCardinalityLimitProcessorType', :'value_limit' => :'Integer' } @@ -123,6 +128,10 @@ def initialize(attributes = {}) end end + if attributes.key?(:'tracking_mode') + self.tracking_mode = attributes[:'tracking_mode'] + end + if attributes.key?(:'type') self.type = attributes[:'type'] end @@ -141,6 +150,7 @@ def valid? return false if @include.nil? return false if @limit_exceeded_action.nil? return false if !@per_metric_limits.nil? && @per_metric_limits.length > 100 + return false if @tracking_mode.nil? return false if @type.nil? return false if @value_limit.nil? return false if @value_limit > 1000000 @@ -198,6 +208,16 @@ def per_metric_limits=(per_metric_limits) @per_metric_limits = per_metric_limits end + # Custom attribute writer method with validation + # @param tracking_mode [Object] Object to be assigned + # @!visibility private + def tracking_mode=(tracking_mode) + if tracking_mode.nil? + fail ArgumentError, 'invalid value for "tracking_mode", tracking_mode cannot be nil.' + end + @tracking_mode = tracking_mode + end + # Custom attribute writer method with validation # @param type [Object] Object to be assigned # @!visibility private @@ -256,6 +276,7 @@ def ==(o) include == o.include && limit_exceeded_action == o.limit_exceeded_action && per_metric_limits == o.per_metric_limits && + tracking_mode == o.tracking_mode && type == o.type && value_limit == o.value_limit && additional_properties == o.additional_properties @@ -265,7 +286,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [display_name, enabled, id, include, limit_exceeded_action, per_metric_limits, type, value_limit, additional_properties].hash + [display_name, enabled, id, include, limit_exceeded_action, per_metric_limits, tracking_mode, type, value_limit, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_mode.rb b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_override_type.rb similarity index 75% rename from lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_mode.rb rename to lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_override_type.rb index 4e2dd13f7af9..55367089f583 100644 --- a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_mode.rb +++ b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_override_type.rb @@ -17,8 +17,8 @@ require 'time' module DatadogAPIClient::V2 - # How the per-tag override is applied. `limit_override` enforces a custom limit on the tag; `excluded` skips the tag from cardinality tracking. - class ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode + # How the override is applied. `limit_override` enforces a custom limit; `excluded` omits the metric or tag from cardinality tracking. + class ObservabilityPipelineTagCardinalityLimitProcessorOverrideType include BaseEnumModel LIMIT_OVERRIDE = "limit_override".freeze diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_metric_limit.rb b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_metric_limit.rb index d6147df8b675..dafd776060ca 100644 --- a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_metric_limit.rb +++ b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_metric_limit.rb @@ -27,13 +27,13 @@ class ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit # The name of the metric this override applies to. attr_reader :metric_name - # How the per-metric override is applied. `tracked` enforces a custom limit; `excluded` skips the metric entirely. - attr_reader :mode + # How the override is applied. `limit_override` enforces a custom limit; `excluded` omits the metric or tag from cardinality tracking. + attr_reader :override_type - # A list of per-tag cardinality overrides that apply within this metric. Must be omitted when `mode` is `excluded`. + # A list of per-tag cardinality overrides that apply within this metric. Must be omitted when `override_type` is `excluded`. attr_reader :per_tag_limits - # The maximum number of distinct tag value combinations allowed for this metric. Required when `mode` is `tracked`. Must be omitted when `mode` is `excluded`. + # The maximum number of distinct tag value combinations allowed for this metric. Required when `override_type` is `limit_override`. Must be omitted when `override_type` is `excluded`. attr_reader :value_limit attr_accessor :additional_properties @@ -44,7 +44,7 @@ def self.attribute_map { :'limit_exceeded_action' => :'limit_exceeded_action', :'metric_name' => :'metric_name', - :'mode' => :'mode', + :'override_type' => :'override_type', :'per_tag_limits' => :'per_tag_limits', :'value_limit' => :'value_limit' } @@ -56,7 +56,7 @@ def self.openapi_types { :'limit_exceeded_action' => :'ObservabilityPipelineTagCardinalityLimitProcessorAction', :'metric_name' => :'String', - :'mode' => :'ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode', + :'override_type' => :'ObservabilityPipelineTagCardinalityLimitProcessorOverrideType', :'per_tag_limits' => :'Array', :'value_limit' => :'Integer' } @@ -88,8 +88,8 @@ def initialize(attributes = {}) self.metric_name = attributes[:'metric_name'] end - if attributes.key?(:'mode') - self.mode = attributes[:'mode'] + if attributes.key?(:'override_type') + self.override_type = attributes[:'override_type'] end if attributes.key?(:'per_tag_limits') @@ -108,7 +108,7 @@ def initialize(attributes = {}) # @!visibility private def valid? return false if @metric_name.nil? - return false if @mode.nil? + return false if @override_type.nil? return false if !@per_tag_limits.nil? && @per_tag_limits.length > 50 return false if !@value_limit.nil? && @value_limit > 1000000 return false if !@value_limit.nil? && @value_limit < 0 @@ -126,13 +126,13 @@ def metric_name=(metric_name) end # Custom attribute writer method with validation - # @param mode [Object] Object to be assigned + # @param override_type [Object] Object to be assigned # @!visibility private - def mode=(mode) - if mode.nil? - fail ArgumentError, 'invalid value for "mode", mode cannot be nil.' + def override_type=(override_type) + if override_type.nil? + fail ArgumentError, 'invalid value for "override_type", override_type cannot be nil.' end - @mode = mode + @override_type = override_type end # Custom attribute writer method with validation @@ -186,7 +186,7 @@ def ==(o) self.class == o.class && limit_exceeded_action == o.limit_exceeded_action && metric_name == o.metric_name && - mode == o.mode && + override_type == o.override_type && per_tag_limits == o.per_tag_limits && value_limit == o.value_limit && additional_properties == o.additional_properties @@ -196,7 +196,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [limit_exceeded_action, metric_name, mode, per_tag_limits, value_limit, additional_properties].hash + [limit_exceeded_action, metric_name, override_type, per_tag_limits, value_limit, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_limit.rb b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_limit.rb index 32ac13afa297..1ebcd5a8355d 100644 --- a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_limit.rb +++ b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_limit.rb @@ -21,13 +21,13 @@ module DatadogAPIClient::V2 class ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit include BaseGenericModel - # How the per-tag override is applied. `limit_override` enforces a custom limit on the tag; `excluded` skips the tag from cardinality tracking. - attr_reader :mode + # How the override is applied. `limit_override` enforces a custom limit; `excluded` omits the metric or tag from cardinality tracking. + attr_reader :override_type # The tag key this override applies to. attr_reader :tag_key - # The maximum number of distinct values allowed for this tag. Required when `mode` is `limit_override`. Must be omitted when `mode` is `excluded`. + # The maximum number of distinct values allowed for this tag. Required when `override_type` is `limit_override`. Must be omitted when `override_type` is `excluded`. attr_reader :value_limit attr_accessor :additional_properties @@ -36,7 +36,7 @@ class ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit # @!visibility private def self.attribute_map { - :'mode' => :'mode', + :'override_type' => :'override_type', :'tag_key' => :'tag_key', :'value_limit' => :'value_limit' } @@ -46,7 +46,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'mode' => :'ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode', + :'override_type' => :'ObservabilityPipelineTagCardinalityLimitProcessorOverrideType', :'tag_key' => :'String', :'value_limit' => :'Integer' } @@ -70,8 +70,8 @@ def initialize(attributes = {}) end } - if attributes.key?(:'mode') - self.mode = attributes[:'mode'] + if attributes.key?(:'override_type') + self.override_type = attributes[:'override_type'] end if attributes.key?(:'tag_key') @@ -87,7 +87,7 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? - return false if @mode.nil? + return false if @override_type.nil? return false if @tag_key.nil? return false if !@value_limit.nil? && @value_limit > 1000000 return false if !@value_limit.nil? && @value_limit < 0 @@ -95,13 +95,13 @@ def valid? end # Custom attribute writer method with validation - # @param mode [Object] Object to be assigned + # @param override_type [Object] Object to be assigned # @!visibility private - def mode=(mode) - if mode.nil? - fail ArgumentError, 'invalid value for "mode", mode cannot be nil.' + def override_type=(override_type) + if override_type.nil? + fail ArgumentError, 'invalid value for "override_type", override_type cannot be nil.' end - @mode = mode + @override_type = override_type end # Custom attribute writer method with validation @@ -153,7 +153,7 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - mode == o.mode && + override_type == o.override_type && tag_key == o.tag_key && value_limit == o.value_limit && additional_properties == o.additional_properties @@ -163,7 +163,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [mode, tag_key, value_limit, additional_properties].hash + [override_type, tag_key, value_limit, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_tracking_mode.rb b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_tracking_mode.rb new file mode 100644 index 000000000000..581c57222e44 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_tracking_mode.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 + # Controls whether the processor uses exact or probabilistic tag tracking. + class ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode + include BaseGenericModel + + # The cardinality tracking algorithm to use. + attr_reader :mode + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'mode' => :'mode' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'mode' => :'ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode' + } + 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::ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode` 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?(:'mode') + self.mode = attributes[:'mode'] + 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 @mode.nil? + true + end + + # Custom attribute writer method with validation + # @param mode [Object] Object to be assigned + # @!visibility private + def mode=(mode) + if mode.nil? + fail ArgumentError, 'invalid value for "mode", mode cannot be nil.' + end + @mode = mode + 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 && + mode == o.mode && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [mode, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_tracking_mode_mode.rb b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_tracking_mode_mode.rb new file mode 100644 index 000000000000..2fb713adf9e6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_tracking_mode_mode.rb @@ -0,0 +1,27 @@ +=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 cardinality tracking algorithm to use. + class ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode + include BaseEnumModel + + EXACT_FINGERPRINT = "exact_fingerprint".freeze + PROBABILISTIC = "probabilistic".freeze + 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