From 33c96115009bdb8ee426341170c9ca15e104002c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Sun, 14 Jun 2026 00:00:38 +0000 Subject: [PATCH] Regenerate client from commit 634892d of spec repo --- .generator/schemas/v2/openapi.yaml | 1005 ++++++++++++++++- .../CreateReportSchedule.java | 2 +- .../DeleteReportSchedule.java | 26 + .../report-schedules/GetReportSchedule.java | 26 + .../GetReportSchedulesForResource.java | 27 + .../report-schedules/ListReportSchedules.java | 24 + .../report-schedules/PatchReportSchedule.java | 2 +- .../ToggleReportSchedule.java | 41 + .../com/datadog/api/client/ApiClient.java | 2 + .../client/v2/api/DataObservabilityApi.java | 369 ++++++ .../api/client/v2/api/ReportSchedulesApi.java | 860 ++++++++++++++ .../DataObservabilityMonitorRunStatus.java | 66 ++ .../DataObservabilityMonitorRunType.java | 58 + ...ObservabilityMonitorRunStatusResponse.java | 151 +++ ...ityMonitorRunStatusResponseAttributes.java | 189 ++++ ...rvabilityMonitorRunStatusResponseData.java | 218 ++++ .../model/ReportScheduleIncludedResource.java | 76 +- .../ReportScheduleIncludedResourceType.java | 58 + .../ReportScheduleIndexTemplateVariable.java | 287 +++++ ...eportScheduleListResourceRelationship.java | 149 +++ ...tScheduleListResourceRelationshipData.java | 183 +++ .../v2/model/ReportScheduleListResponse.java | 253 +++++ .../ReportScheduleListResponseAttributes.java | 566 ++++++++++ .../model/ReportScheduleListResponseData.java | 244 ++++ .../ReportScheduleListResponseLinks.java | 298 +++++ .../model/ReportScheduleListResponseMeta.java | 139 +++ .../ReportScheduleListResponsePagination.java | 352 ++++++ ...ortScheduleListResponsePaginationType.java | 63 ++ ...portScheduleListResponseRelationships.java | 180 +++ .../ReportScheduleQueryParameterValue.java | 276 +++++ .../v2/model/ReportScheduleResource.java | 210 ++++ .../ReportScheduleResourceAttributes.java | 251 ++++ .../v2/model/ReportScheduleToggleRequest.java | 147 +++ ...ReportScheduleToggleRequestAttributes.java | 151 +++ .../ReportScheduleToggleRequestData.java | 184 +++ .../RunDataObservabilityMonitorResponse.java | 148 +++ ...nDataObservabilityMonitorResponseData.java | 182 +++ .../client/v2/api/report_schedules.feature | 120 +- .../com/datadog/api/client/v2/api/undo.json | 38 + 39 files changed, 7606 insertions(+), 15 deletions(-) create mode 100644 examples/v2/report-schedules/DeleteReportSchedule.java create mode 100644 examples/v2/report-schedules/GetReportSchedule.java create mode 100644 examples/v2/report-schedules/GetReportSchedulesForResource.java create mode 100644 examples/v2/report-schedules/ListReportSchedules.java create mode 100644 examples/v2/report-schedules/ToggleReportSchedule.java create mode 100644 src/main/java/com/datadog/api/client/v2/api/DataObservabilityApi.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DataObservabilityMonitorRunStatus.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DataObservabilityMonitorRunType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GetDataObservabilityMonitorRunStatusResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GetDataObservabilityMonitorRunStatusResponseAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GetDataObservabilityMonitorRunStatusResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReportScheduleIncludedResourceType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReportScheduleIndexTemplateVariable.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResourceRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResourceRelationshipData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponseAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponseLinks.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponseMeta.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponsePagination.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponsePaginationType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponseRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReportScheduleQueryParameterValue.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReportScheduleResource.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReportScheduleResourceAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReportScheduleToggleRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReportScheduleToggleRequestAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ReportScheduleToggleRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RunDataObservabilityMonitorResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RunDataObservabilityMonitorResponseData.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f5b3f392980..e1bad24af7e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -28735,6 +28735,31 @@ components: - bucket_name - bucket_region type: object + DataObservabilityMonitorRunStatus: + description: The status of a data observability monitor run. + enum: + - pending + - ok + - warn + - alert + - error + example: pending + type: string + x-enum-varnames: + - PENDING + - OK + - WARN + - ALERT + - ERROR + DataObservabilityMonitorRunType: + default: monitor_run + description: The JSON:API resource type for a data observability monitor run. + enum: + - monitor_run + example: monitor_run + type: string + x-enum-varnames: + - MONITOR_RUN DataRelationshipsTeams: description: Associates teams with this schedule in a data structure. properties: @@ -39045,6 +39070,42 @@ components: meta: $ref: "#/components/schemas/DataDeletionResponseMeta" type: object + GetDataObservabilityMonitorRunStatusResponse: + description: The response for getting the status of a data observability monitor run. + properties: + data: + $ref: "#/components/schemas/GetDataObservabilityMonitorRunStatusResponseData" + required: + - data + type: object + GetDataObservabilityMonitorRunStatusResponseAttributes: + description: The attributes of a data observability monitor run status response. + properties: + error_message: + description: Error message describing why the monitor run failed. Only present when status is error. + example: "run completed but produced no metric data" + type: string + status: + $ref: "#/components/schemas/DataObservabilityMonitorRunStatus" + required: + - status + type: object + GetDataObservabilityMonitorRunStatusResponseData: + description: The data object for a data observability monitor run status response. + properties: + attributes: + $ref: "#/components/schemas/GetDataObservabilityMonitorRunStatusResponseAttributes" + id: + description: The unique identifier of the monitor run. + example: "abc123def456" + type: string + type: + $ref: "#/components/schemas/DataObservabilityMonitorRunType" + required: + - id + - type + - attributes + type: object GetDeviceAttributes: description: The device attributes properties: @@ -74426,7 +74487,7 @@ components: type: array timeframe: description: The relative timeframe of data to include in the report. - example: "calendar_month" + example: "1w" type: string timezone: description: The IANA time zone identifier the recurrence rule is evaluated in. @@ -74478,6 +74539,276 @@ components: description: A related resource included with a report schedule. oneOf: - $ref: "#/components/schemas/ReportScheduleAuthor" + - $ref: "#/components/schemas/ReportScheduleResource" + ReportScheduleIncludedResourceType: + description: JSON:API resource type for an included report resource. + enum: + - resource + example: resource + type: string + x-enum-varnames: + - RESOURCE + ReportScheduleIndexTemplateVariable: + description: Template variable metadata from a dashboard index. + properties: + available_values: + description: Available values for the template variable. + example: + - prod + - staging + items: + type: string + nullable: true + type: array + defaults: + description: Default values for the template variable. + example: + - prod + items: + type: string + nullable: true + type: array + name: + description: The template variable name. + example: env + nullable: true + type: string + prefix: + description: The tag prefix for the template variable, when available. + example: env + nullable: true + type: string + type: object + ReportScheduleListResourceRelationship: + description: Relationship to the report target resource. + properties: + data: + $ref: "#/components/schemas/ReportScheduleListResourceRelationshipData" + required: + - data + type: object + ReportScheduleListResourceRelationshipData: + description: Relationship data for the report target resource. + properties: + id: + description: The resource identifier. + example: "abc-def-ghi" + type: string + type: + $ref: "#/components/schemas/ReportScheduleIncludedResourceType" + required: + - id + - type + type: object + ReportScheduleListResponse: + description: Response containing a list of report schedules. + properties: + data: + description: The list of report schedules. + items: + $ref: "#/components/schemas/ReportScheduleListResponseData" + type: array + included: + description: Related resources included with the report schedules, such as authors and rendered resources. + items: + $ref: "#/components/schemas/ReportScheduleIncludedResource" + type: array + links: + $ref: "#/components/schemas/ReportScheduleListResponseLinks" + meta: + $ref: "#/components/schemas/ReportScheduleListResponseMeta" + required: + - data + type: object + ReportScheduleListResponseAttributes: + description: The configuration and derived state of a report schedule in a list response. + properties: + delivery_format: + $ref: "#/components/schemas/ReportScheduleResponseAttributesDeliveryFormat" + description: + description: The description of the report. + example: "Weekly summary of infrastructure health." + type: string + next_recurrence: + description: The Unix timestamp, in milliseconds, of the next scheduled delivery, or `null` if none is scheduled. + example: 1780923600000 + format: int64 + nullable: true + type: integer + query_params: + additionalProperties: + $ref: "#/components/schemas/ReportScheduleQueryParameterValue" + description: Query parameters applied when rendering the report. + example: {} + type: object + recipients: + description: The recipients of the report (email addresses, Slack channel references, or Microsoft Teams channel references). + example: + - "user@example.com" + - "slack:T01234567.C01234567.alerts" + - "teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2" + 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 resource rendered in the report. + example: "abc-def-ghi" + type: string + resource_type: + $ref: "#/components/schemas/ReportScheduleResourceType" + rrule: + description: The recurrence rule for the schedule, expressed as an iCalendar `RRULE` string. + example: "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0" + type: string + status: + $ref: "#/components/schemas/ReportScheduleStatus" + template_variables: + description: The dashboard template variables applied when rendering the report. + items: + $ref: "#/components/schemas/ReportScheduleTemplateVariable" + type: array + timeframe: + description: The relative timeframe of data included in the report, or `null` if not set. + example: "1w" + nullable: true + 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: "Weekly Infrastructure Report" + type: string + required: + - status + - resource_id + - resource_type + - recipients + - rrule + - timezone + - template_variables + - title + - description + - timeframe + - query_params + - next_recurrence + type: object + ReportScheduleListResponseData: + description: The JSON:API data object representing a report schedule in a list response. + properties: + attributes: + $ref: "#/components/schemas/ReportScheduleListResponseAttributes" + id: + description: The unique identifier of the report schedule. + example: "11111111-2222-3333-4444-555555555555" + type: string + relationships: + $ref: "#/components/schemas/ReportScheduleListResponseRelationships" + type: + $ref: "#/components/schemas/ReportScheduleType" + required: + - id + - type + - attributes + - relationships + type: object + ReportScheduleListResponseLinks: + description: Pagination links for navigating a report schedule list response. + properties: + first: + description: Link to the first page. + example: "https://api.datadoghq.com/api/v2/reporting/schedule/list?page[offset]=0&page[limit]=25" + nullable: true + type: string + last: + description: Link to the last page, or `null` if it is unavailable. + example: "https://api.datadoghq.com/api/v2/reporting/schedule/list?page[offset]=0&page[limit]=25" + nullable: true + type: string + next: + description: Link to the next page, or `null` if it is unavailable. + example: "https://api.datadoghq.com/api/v2/reporting/schedule/list?page[offset]=25&page[limit]=25" + nullable: true + type: string + prev: + description: Link to the previous page, or `null` if it is unavailable. + example: "https://api.datadoghq.com/api/v2/reporting/schedule/list?page[offset]=0&page[limit]=25" + nullable: true + type: string + self: + description: Link to the current page. + example: "https://api.datadoghq.com/api/v2/reporting/schedule/list?page[limit]=25" + nullable: true + type: string + type: object + ReportScheduleListResponseMeta: + description: Metadata for a paginated report schedule list response. + properties: + pagination: + $ref: "#/components/schemas/ReportScheduleListResponsePagination" + type: object + ReportScheduleListResponsePagination: + description: Offset and limit pagination metadata for a report schedule list response. + properties: + first_offset: + description: The first offset. + example: 0 + format: int64 + type: integer + last_offset: + description: The last offset when the total count is known, or `null` if it is unavailable. + example: 0 + format: int64 + nullable: true + type: integer + limit: + description: The maximum number of schedules returned. + example: 25 + format: int64 + type: integer + next_offset: + description: The next offset. + example: 25 + format: int64 + type: integer + offset: + description: The current offset. + example: 0 + format: int64 + type: integer + prev_offset: + description: The previous offset. + example: 0 + format: int64 + type: integer + total: + description: The total number of matching schedules. + example: 1 + format: int64 + type: integer + type: + $ref: "#/components/schemas/ReportScheduleListResponsePaginationType" + type: object + ReportScheduleListResponsePaginationType: + description: The pagination type. + enum: + - offset_limit + example: offset_limit + type: string + x-enum-varnames: + - OFFSET_LIMIT + ReportScheduleListResponseRelationships: + description: Relationships for a report schedule in a list response. + properties: + author: + $ref: "#/components/schemas/ReportScheduleAuthorRelationship" + resource: + $ref: "#/components/schemas/ReportScheduleListResourceRelationship" + required: + - author + type: object ReportSchedulePatchRequest: description: Request body for updating a report schedule. properties: @@ -74527,7 +74858,7 @@ components: type: array timeframe: description: The relative timeframe of data to include in the report. - example: "calendar_month" + example: "1w" type: string timezone: description: The IANA time zone identifier the recurrence rule is evaluated in. @@ -74559,6 +74890,58 @@ components: - type - attributes type: object + ReportScheduleQueryParameterValue: + description: A query parameter value applied when rendering the report, either a single string or a list of strings. + oneOf: + - $ref: "#/components/schemas/ReportScheduleQueryParameterValueString" + - $ref: "#/components/schemas/ReportScheduleQueryParameterValueStringArray" + ReportScheduleQueryParameterValueString: + description: A single query parameter value. + example: "prod" + type: string + ReportScheduleQueryParameterValueStringArray: + description: A list of query parameter values. + example: + - "prod" + items: + description: A single query parameter value. + type: string + type: array + ReportScheduleResource: + description: A report target resource included as a related JSON:API resource. + properties: + attributes: + $ref: "#/components/schemas/ReportScheduleResourceAttributes" + id: + description: The resource identifier. + example: "abc-def-ghi" + type: string + type: + $ref: "#/components/schemas/ReportScheduleIncludedResourceType" + required: + - type + - id + - attributes + type: object + ReportScheduleResourceAttributes: + description: Attributes of an included report target resource. + properties: + resource_type: + $ref: "#/components/schemas/ReportScheduleResourceType" + template_variables: + description: Template variable metadata from the dashboard resource, when available. + items: + $ref: "#/components/schemas/ReportScheduleIndexTemplateVariable" + nullable: true + type: array + title: + description: The title of the dashboard or integration dashboard resource, when available. + example: "Infrastructure Overview" + nullable: true + type: string + required: + - resource_type + type: object ReportScheduleResourceType: description: The type of dashboard resource the report schedule targets. enum: @@ -74615,7 +74998,7 @@ components: $ref: "#/components/schemas/ReportScheduleResourceType" rrule: description: The recurrence rule for the schedule, expressed as an iCalendar `RRULE` string. - example: "FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0" + example: "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0" type: string status: $ref: "#/components/schemas/ReportScheduleStatus" @@ -74725,6 +75108,33 @@ components: - name - values type: object + ReportScheduleToggleRequest: + description: Request body for toggling a report schedule. + properties: + data: + $ref: "#/components/schemas/ReportScheduleToggleRequestData" + required: + - data + type: object + ReportScheduleToggleRequestAttributes: + description: The status to set on the report schedule. + properties: + status: + $ref: "#/components/schemas/ReportScheduleStatus" + required: + - status + type: object + ReportScheduleToggleRequestData: + description: The JSON:API data object for a report schedule toggle request. + properties: + attributes: + $ref: "#/components/schemas/ReportScheduleToggleRequestAttributes" + type: + $ref: "#/components/schemas/ReportScheduleType" + required: + - type + - attributes + type: object ReportScheduleType: description: JSON:API resource type for report schedules. enum: @@ -77898,6 +78308,27 @@ components: $ref: "#/components/schemas/RumRetentionFilterData" type: array type: object + RunDataObservabilityMonitorResponse: + description: The response returned when a data observability monitor run is triggered. + properties: + data: + $ref: "#/components/schemas/RunDataObservabilityMonitorResponseData" + required: + - data + type: object + RunDataObservabilityMonitorResponseData: + description: The data object returned when a data observability monitor run is triggered. + properties: + id: + description: The unique identifier of the monitor run. + example: "abc123def456" + type: string + type: + $ref: "#/components/schemas/DataObservabilityMonitorRunType" + required: + - id + - type + type: object RunHistoricalJobRequest: description: Run a historical job request. properties: @@ -124777,6 +125208,105 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/data-observability/monitors/runs/{run_id}/status: + get: + description: Retrieves the current status of a data observability monitor run. Poll this endpoint after triggering a run to determine when evaluation is complete. + operationId: GetDataObservabilityMonitorRunStatus + parameters: + - description: The ID of the monitor run to retrieve status for. + example: "abc123def456" + in: path + name: run_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + status: ok + id: "abc123def456" + type: monitor_run + schema: + $ref: "#/components/schemas/GetDataObservabilityMonitorRunStatusResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - data_observability_monitors_write + - monitors_write + summary: Get data observability monitor run status + tags: + - Data Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/data-observability/monitors/{monitor_id}/run: + post: + description: Manually triggers a run for a data observability monitor. Only monitors that are not scheduled (manually-runnable) can be triggered this way. + operationId: RunDataObservabilityMonitor + parameters: + - description: The ID of the data observability monitor to run. + example: 12345 + in: path + name: monitor_id + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + id: "abc123def456" + type: monitor_run + schema: + $ref: "#/components/schemas/RunDataObservabilityMonitorResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - data_observability_monitors_write + - monitors_write + summary: Run a data observability monitor + tags: + - Data Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/datasets: get: description: Get all datasets that have been configured for an organization. @@ -158644,7 +159174,385 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/reporting/schedule/list: + get: + description: |- + List dashboard and integration dashboard report schedules for the organization. + The response is paginated and can be filtered by title, author UUID, or recipients. + Requires the `generate_dashboard_reports` permission. + operationId: ListReportSchedules + parameters: + - description: The maximum number of schedules to return. The maximum value is 50. + example: 25 + in: query + name: page[limit] + required: false + schema: + default: 25 + format: int64 + maximum: 50 + minimum: 1 + type: integer + - description: The offset from which to start returning schedules. + example: 0 + in: query + name: page[offset] + required: false + schema: + default: 0 + format: int64 + minimum: 0 + type: integer + - description: Filter schedules by report title. + example: "Weekly" + in: query + name: filter[title] + required: false + schema: + type: string + - description: Filter schedules by author UUID. + example: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + in: query + name: filter[author_uuid] + required: false + schema: + format: uuid + type: string + - description: Filter schedules by a comma-separated list of recipients. + example: "user@example.com,team@example.com" + in: query + name: filter[recipients] + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + delivery_format: pdf + description: "Weekly summary of infrastructure health." + next_recurrence: 1780923600000 + query_params: {} + recipients: + - "user@example.com" + resource_id: "abc-def-ghi" + resource_type: dashboard + rrule: "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0" + status: active + template_variables: + - name: "env" + values: + - "prod" + timeframe: "1w" + timezone: "America/New_York" + title: "Weekly Infrastructure Report" + id: "11111111-2222-3333-4444-555555555555" + relationships: + author: + data: + id: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + type: users + resource: + data: + id: "abc-def-ghi" + type: resource + type: schedule + included: + - attributes: + email: "user@example.com" + name: "Example User" + id: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + type: users + - attributes: + resource_type: dashboard + template_variables: + - available_values: + - "prod" + - "staging" + defaults: + - "prod" + name: "env" + prefix: "env" + title: "Infrastructure Overview" + id: "abc-def-ghi" + type: resource + links: + first: "https://api.datadoghq.com/api/v2/reporting/schedule/list?page[offset]=0&page[limit]=25" + last: + next: "https://api.datadoghq.com/api/v2/reporting/schedule/list?page[offset]=25&page[limit]=25" + prev: + self: "https://api.datadoghq.com/api/v2/reporting/schedule/list?page[limit]=25" + meta: + pagination: + first_offset: 0 + last_offset: 0 + limit: 25 + next_offset: 25 + offset: 0 + prev_offset: 0 + total: 1 + type: offset_limit + schema: + $ref: "#/components/schemas/ReportScheduleListResponse" + 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 report schedules + tags: + - Report Schedules + /api/v2/reporting/schedule/{resource_type}/{resource_id}: + get: + description: |- + Get all report schedules that target a dashboard or integration dashboard resource. + Requires a reporting read permission appropriate to the targeted resource type. + operationId: GetReportSchedulesForResource + parameters: + - description: The type of resource to fetch report schedules for. + example: dashboard + in: path + name: resource_type + required: true + schema: + $ref: "#/components/schemas/ReportScheduleResourceType" + - description: The identifier of the resource to fetch report schedules for. + example: "abc-def-ghi" + in: path + name: resource_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + delivery_format: pdf + description: "Weekly summary of infrastructure health." + next_recurrence: 1780923600000 + recipients: + - "user@example.com" + resource_id: "abc-def-ghi" + resource_type: dashboard + rrule: "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0" + status: active + tab_id: + template_variables: + - name: "env" + values: + - "prod" + timeframe: "1w" + timezone: "America/New_York" + title: "Weekly Infrastructure Report" + id: "11111111-2222-3333-4444-555555555555" + type: schedule + included: + - attributes: + email: "user@example.com" + name: "Example User" + id: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + type: users + schema: + $ref: "#/components/schemas/ReportScheduleListResponse" + 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: Get report schedules for a resource + tags: + - Report Schedules /api/v2/reporting/schedule/{schedule_uuid}: + delete: + description: |- + Delete a report schedule by its unique identifier. The response returns the deleted schedule. + Requires a reporting write permission appropriate to the targeted resource type and schedule ownership. + operationId: DeleteReportSchedule + parameters: + - description: The unique identifier of the report schedule to delete. + example: "11111111-2222-3333-4444-555555555555" + in: path + name: schedule_uuid + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + delivery_format: pdf + description: "Weekly summary of infrastructure health." + next_recurrence: + recipients: + - "user@example.com" + resource_id: "abc-def-ghi" + resource_type: dashboard + rrule: "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0" + status: inactive + tab_id: + template_variables: + - name: "env" + values: + - "prod" + timeframe: "1w" + timezone: "America/New_York" + title: "Weekly Infrastructure Report" + id: "11111111-2222-3333-4444-555555555555" + type: schedule + included: + - attributes: + email: "user@example.com" + name: "Example User" + id: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + type: users + schema: + $ref: "#/components/schemas/ReportScheduleResponse" + 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: Delete a report schedule + tags: + - Report Schedules + get: + description: |- + Get a report schedule by its unique identifier. + Requires a reporting read permission appropriate to the targeted resource type. + operationId: GetReportSchedule + parameters: + - description: The unique identifier of the report schedule to fetch. + example: "11111111-2222-3333-4444-555555555555" + in: path + name: schedule_uuid + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + delivery_format: pdf + description: "Weekly summary of infrastructure health." + next_recurrence: 1780923600000 + recipients: + - "user@example.com" + resource_id: "abc-def-ghi" + resource_type: dashboard + rrule: "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0" + status: active + tab_id: + template_variables: + - name: "env" + values: + - "prod" + timeframe: "1w" + timezone: "America/New_York" + title: "Weekly Infrastructure Report" + id: "11111111-2222-3333-4444-555555555555" + type: schedule + included: + - attributes: + email: "user@example.com" + name: "Example User" + id: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + type: users + schema: + $ref: "#/components/schemas/ReportScheduleResponse" + 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: Get a report schedule + tags: + - Report Schedules patch: description: |- Update an existing scheduled report by its identifier. The editable attributes @@ -158758,6 +159666,95 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/reporting/schedule/{schedule_uuid}/toggle: + patch: + description: |- + Activate or pause a report schedule by setting its status to `active` or `inactive`. + Requires a reporting write permission appropriate to the targeted resource type and schedule ownership. + operationId: ToggleReportSchedule + parameters: + - description: The unique identifier of the report schedule to toggle. + example: "11111111-2222-3333-4444-555555555555" + in: path + name: schedule_uuid + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + status: inactive + type: schedule + schema: + $ref: "#/components/schemas/ReportScheduleToggleRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + delivery_format: pdf + description: "Weekly summary of infrastructure health." + next_recurrence: + recipients: + - "user@example.com" + resource_id: "abc-def-ghi" + resource_type: dashboard + rrule: "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0" + status: inactive + tab_id: + template_variables: + - name: "env" + values: + - "prod" + timeframe: "1w" + timezone: "America/New_York" + title: "Weekly Infrastructure Report" + id: "11111111-2222-3333-4444-555555555555" + type: schedule + included: + - attributes: + email: "user@example.com" + name: "Example User" + id: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + type: users + schema: + $ref: "#/components/schemas/ReportScheduleResponse" + 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: Toggle a report schedule + tags: + - Report Schedules + x-codegen-request-body-name: body /api/v2/restriction_policy/{resource_id}: delete: description: Deletes the restriction policy associated with a specified resource. @@ -186518,6 +187515,8 @@ tags: - description: |- The Data Deletion API allows the user to target and delete data from the allowed products. It's currently enabled for Logs and RUM and depends on `logs_delete_data` and `rum_delete_data` permissions respectively. name: Data Deletion + - description: Manage and run data observability monitors. + name: Data Observability - description: |- Data Access Controls in Datadog is a feature that allows administrators and access managers to regulate access to sensitive data. By defining Restricted Datasets, you can ensure that only specific teams or roles can diff --git a/examples/v2/report-schedules/CreateReportSchedule.java b/examples/v2/report-schedules/CreateReportSchedule.java index ae1765e6dcc..041efbcb175 100644 --- a/examples/v2/report-schedules/CreateReportSchedule.java +++ b/examples/v2/report-schedules/CreateReportSchedule.java @@ -47,7 +47,7 @@ public static void main(String[] args) { new ReportScheduleTemplateVariable() .name("env") .values(Collections.singletonList("prod")))) - .timeframe("calendar_month") + .timeframe("1w") .timezone("America/New_York") .title("Weekly Infrastructure Report")) .type(ReportScheduleType.SCHEDULE)); diff --git a/examples/v2/report-schedules/DeleteReportSchedule.java b/examples/v2/report-schedules/DeleteReportSchedule.java new file mode 100644 index 00000000000..d822b801801 --- /dev/null +++ b/examples/v2/report-schedules/DeleteReportSchedule.java @@ -0,0 +1,26 @@ +// Delete a report schedule returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ReportSchedulesApi; +import com.datadog.api.client.v2.model.ReportScheduleResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ReportSchedulesApi apiInstance = new ReportSchedulesApi(defaultClient); + + try { + ReportScheduleResponse result = + apiInstance.deleteReportSchedule(UUID.fromString("11111111-2222-3333-4444-555555555555")); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ReportSchedulesApi#deleteReportSchedule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/report-schedules/GetReportSchedule.java b/examples/v2/report-schedules/GetReportSchedule.java new file mode 100644 index 00000000000..a854c7cba92 --- /dev/null +++ b/examples/v2/report-schedules/GetReportSchedule.java @@ -0,0 +1,26 @@ +// Get a report schedule returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ReportSchedulesApi; +import com.datadog.api.client.v2.model.ReportScheduleResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ReportSchedulesApi apiInstance = new ReportSchedulesApi(defaultClient); + + try { + ReportScheduleResponse result = + apiInstance.getReportSchedule(UUID.fromString("11111111-2222-3333-4444-555555555555")); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ReportSchedulesApi#getReportSchedule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/report-schedules/GetReportSchedulesForResource.java b/examples/v2/report-schedules/GetReportSchedulesForResource.java new file mode 100644 index 00000000000..bff28644094 --- /dev/null +++ b/examples/v2/report-schedules/GetReportSchedulesForResource.java @@ -0,0 +1,27 @@ +// Get report schedules for a resource returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ReportSchedulesApi; +import com.datadog.api.client.v2.model.ReportScheduleListResponse; +import com.datadog.api.client.v2.model.ReportScheduleResourceType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ReportSchedulesApi apiInstance = new ReportSchedulesApi(defaultClient); + + try { + ReportScheduleListResponse result = + apiInstance.getReportSchedulesForResource( + ReportScheduleResourceType.DASHBOARD, "abc-def-ghi"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ReportSchedulesApi#getReportSchedulesForResource"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/report-schedules/ListReportSchedules.java b/examples/v2/report-schedules/ListReportSchedules.java new file mode 100644 index 00000000000..26d70343ad9 --- /dev/null +++ b/examples/v2/report-schedules/ListReportSchedules.java @@ -0,0 +1,24 @@ +// List report schedules returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ReportSchedulesApi; +import com.datadog.api.client.v2.model.ReportScheduleListResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ReportSchedulesApi apiInstance = new ReportSchedulesApi(defaultClient); + + try { + ReportScheduleListResponse result = apiInstance.listReportSchedules(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ReportSchedulesApi#listReportSchedules"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/report-schedules/PatchReportSchedule.java b/examples/v2/report-schedules/PatchReportSchedule.java index 3188235269c..f4b1d35c002 100644 --- a/examples/v2/report-schedules/PatchReportSchedule.java +++ b/examples/v2/report-schedules/PatchReportSchedule.java @@ -44,7 +44,7 @@ public static void main(String[] args) { new ReportScheduleTemplateVariable() .name("env") .values(Collections.singletonList("prod")))) - .timeframe("calendar_month") + .timeframe("1w") .timezone("America/New_York") .title("Weekly Infrastructure Report")) .type(ReportScheduleType.SCHEDULE)); diff --git a/examples/v2/report-schedules/ToggleReportSchedule.java b/examples/v2/report-schedules/ToggleReportSchedule.java new file mode 100644 index 00000000000..3ac4f2d2088 --- /dev/null +++ b/examples/v2/report-schedules/ToggleReportSchedule.java @@ -0,0 +1,41 @@ +// Toggle a report schedule returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ReportSchedulesApi; +import com.datadog.api.client.v2.model.ReportScheduleResponse; +import com.datadog.api.client.v2.model.ReportScheduleStatus; +import com.datadog.api.client.v2.model.ReportScheduleToggleRequest; +import com.datadog.api.client.v2.model.ReportScheduleToggleRequestAttributes; +import com.datadog.api.client.v2.model.ReportScheduleToggleRequestData; +import com.datadog.api.client.v2.model.ReportScheduleType; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ReportSchedulesApi apiInstance = new ReportSchedulesApi(defaultClient); + + ReportScheduleToggleRequest body = + new ReportScheduleToggleRequest() + .data( + new ReportScheduleToggleRequestData() + .attributes( + new ReportScheduleToggleRequestAttributes() + .status(ReportScheduleStatus.ACTIVE)) + .type(ReportScheduleType.SCHEDULE)); + + try { + ReportScheduleResponse result = + apiInstance.toggleReportSchedule( + UUID.fromString("11111111-2222-3333-4444-555555555555"), body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ReportSchedulesApi#toggleReportSchedule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 437100ea749..a526b68cf0c 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -990,6 +990,8 @@ public class ApiClient { put("v2.updateDashboardSecureEmbed", false); put("v2.getDashboardUsage", false); put("v2.listDashboardsUsage", false); + put("v2.getDataObservabilityMonitorRunStatus", false); + put("v2.runDataObservabilityMonitor", false); put("v2.createDataset", false); put("v2.deleteDataset", false); put("v2.getAllDatasets", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/DataObservabilityApi.java b/src/main/java/com/datadog/api/client/v2/api/DataObservabilityApi.java new file mode 100644 index 00000000000..642aaf71917 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/DataObservabilityApi.java @@ -0,0 +1,369 @@ +package com.datadog.api.client.v2.api; + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.GetDataObservabilityMonitorRunStatusResponse; +import com.datadog.api.client.v2.model.RunDataObservabilityMonitorResponse; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DataObservabilityApi { + private ApiClient apiClient; + + public DataObservabilityApi() { + this(ApiClient.getDefaultApiClient()); + } + + public DataObservabilityApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client. + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client. + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get data observability monitor run status. + * + *

See {@link #getDataObservabilityMonitorRunStatusWithHttpInfo}. + * + * @param runId The ID of the monitor run to retrieve status for. (required) + * @return GetDataObservabilityMonitorRunStatusResponse + * @throws ApiException if fails to make API call + */ + public GetDataObservabilityMonitorRunStatusResponse getDataObservabilityMonitorRunStatus( + String runId) throws ApiException { + return getDataObservabilityMonitorRunStatusWithHttpInfo(runId).getData(); + } + + /** + * Get data observability monitor run status. + * + *

See {@link #getDataObservabilityMonitorRunStatusWithHttpInfoAsync}. + * + * @param runId The ID of the monitor run to retrieve status for. (required) + * @return CompletableFuture<GetDataObservabilityMonitorRunStatusResponse> + */ + public CompletableFuture + getDataObservabilityMonitorRunStatusAsync(String runId) { + return getDataObservabilityMonitorRunStatusWithHttpInfoAsync(runId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieves the current status of a data observability monitor run. Poll this endpoint after + * triggering a run to determine when evaluation is complete. + * + * @param runId The ID of the monitor run to retrieve status for. (required) + * @return ApiResponse<GetDataObservabilityMonitorRunStatusResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse + getDataObservabilityMonitorRunStatusWithHttpInfo(String runId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getDataObservabilityMonitorRunStatus"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'runId' is set + if (runId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'runId' when calling" + + " getDataObservabilityMonitorRunStatus"); + } + // create path and map variables + String localVarPath = + "/api/v2/data-observability/monitors/runs/{run_id}/status" + .replaceAll("\\{" + "run_id" + "\\}", apiClient.escapeString(runId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DataObservabilityApi.getDataObservabilityMonitorRunStatus", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get data observability monitor run status. + * + *

See {@link #getDataObservabilityMonitorRunStatusWithHttpInfo}. + * + * @param runId The ID of the monitor run to retrieve status for. (required) + * @return + * CompletableFuture<ApiResponse<GetDataObservabilityMonitorRunStatusResponse>> + */ + public CompletableFuture> + getDataObservabilityMonitorRunStatusWithHttpInfoAsync(String runId) { + // Check if unstable operation is enabled + String operationId = "getDataObservabilityMonitorRunStatus"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'runId' is set + if (runId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'runId' when calling" + + " getDataObservabilityMonitorRunStatus")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/data-observability/monitors/runs/{run_id}/status" + .replaceAll("\\{" + "run_id" + "\\}", apiClient.escapeString(runId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DataObservabilityApi.getDataObservabilityMonitorRunStatus", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Run a data observability monitor. + * + *

See {@link #runDataObservabilityMonitorWithHttpInfo}. + * + * @param monitorId The ID of the data observability monitor to run. (required) + * @return RunDataObservabilityMonitorResponse + * @throws ApiException if fails to make API call + */ + public RunDataObservabilityMonitorResponse runDataObservabilityMonitor(Long monitorId) + throws ApiException { + return runDataObservabilityMonitorWithHttpInfo(monitorId).getData(); + } + + /** + * Run a data observability monitor. + * + *

See {@link #runDataObservabilityMonitorWithHttpInfoAsync}. + * + * @param monitorId The ID of the data observability monitor to run. (required) + * @return CompletableFuture<RunDataObservabilityMonitorResponse> + */ + public CompletableFuture runDataObservabilityMonitorAsync( + Long monitorId) { + return runDataObservabilityMonitorWithHttpInfoAsync(monitorId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Manually triggers a run for a data observability monitor. Only monitors that are not scheduled + * (manually-runnable) can be triggered this way. + * + * @param monitorId The ID of the data observability monitor to run. (required) + * @return ApiResponse<RunDataObservabilityMonitorResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse runDataObservabilityMonitorWithHttpInfo( + Long monitorId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "runDataObservabilityMonitor"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'monitorId' is set + if (monitorId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'monitorId' when calling runDataObservabilityMonitor"); + } + // create path and map variables + String localVarPath = + "/api/v2/data-observability/monitors/{monitor_id}/run" + .replaceAll("\\{" + "monitor_id" + "\\}", apiClient.escapeString(monitorId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DataObservabilityApi.runDataObservabilityMonitor", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Run a data observability monitor. + * + *

See {@link #runDataObservabilityMonitorWithHttpInfo}. + * + * @param monitorId The ID of the data observability monitor to run. (required) + * @return CompletableFuture<ApiResponse<RunDataObservabilityMonitorResponse>> + */ + public CompletableFuture> + runDataObservabilityMonitorWithHttpInfoAsync(Long monitorId) { + // Check if unstable operation is enabled + String operationId = "runDataObservabilityMonitor"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'monitorId' is set + if (monitorId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'monitorId' when calling" + + " runDataObservabilityMonitor")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/data-observability/monitors/{monitor_id}/run" + .replaceAll("\\{" + "monitor_id" + "\\}", apiClient.escapeString(monitorId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DataObservabilityApi.runDataObservabilityMonitor", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/ReportSchedulesApi.java b/src/main/java/com/datadog/api/client/v2/api/ReportSchedulesApi.java index eead84622d6..16ff30af5a4 100644 --- a/src/main/java/com/datadog/api/client/v2/api/ReportSchedulesApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/ReportSchedulesApi.java @@ -5,12 +5,16 @@ import com.datadog.api.client.ApiResponse; import com.datadog.api.client.Pair; import com.datadog.api.client.v2.model.ReportScheduleCreateRequest; +import com.datadog.api.client.v2.model.ReportScheduleListResponse; import com.datadog.api.client.v2.model.ReportSchedulePatchRequest; +import com.datadog.api.client.v2.model.ReportScheduleResourceType; import com.datadog.api.client.v2.model.ReportScheduleResponse; +import com.datadog.api.client.v2.model.ReportScheduleToggleRequest; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.UUID; import java.util.concurrent.CompletableFuture; @@ -199,6 +203,700 @@ public ApiResponse createReportScheduleWithHttpInfo( new GenericType() {}); } + /** + * Delete a report schedule. + * + *

See {@link #deleteReportScheduleWithHttpInfo}. + * + * @param scheduleUuid The unique identifier of the report schedule to delete. (required) + * @return ReportScheduleResponse + * @throws ApiException if fails to make API call + */ + public ReportScheduleResponse deleteReportSchedule(UUID scheduleUuid) throws ApiException { + return deleteReportScheduleWithHttpInfo(scheduleUuid).getData(); + } + + /** + * Delete a report schedule. + * + *

See {@link #deleteReportScheduleWithHttpInfoAsync}. + * + * @param scheduleUuid The unique identifier of the report schedule to delete. (required) + * @return CompletableFuture<ReportScheduleResponse> + */ + public CompletableFuture deleteReportScheduleAsync(UUID scheduleUuid) { + return deleteReportScheduleWithHttpInfoAsync(scheduleUuid) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a report schedule by its unique identifier. The response returns the deleted schedule. + * Requires a reporting write permission appropriate to the targeted resource type and schedule + * ownership. + * + * @param scheduleUuid The unique identifier of the report schedule to delete. (required) + * @return ApiResponse<ReportScheduleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteReportScheduleWithHttpInfo(UUID scheduleUuid) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'scheduleUuid' is set + if (scheduleUuid == null) { + throw new ApiException( + 400, "Missing the required parameter 'scheduleUuid' when calling deleteReportSchedule"); + } + // create path and map variables + String localVarPath = + "/api/v2/reporting/schedule/{schedule_uuid}" + .replaceAll( + "\\{" + "schedule_uuid" + "\\}", apiClient.escapeString(scheduleUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ReportSchedulesApi.deleteReportSchedule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Delete a report schedule. + * + *

See {@link #deleteReportScheduleWithHttpInfo}. + * + * @param scheduleUuid The unique identifier of the report schedule to delete. (required) + * @return CompletableFuture<ApiResponse<ReportScheduleResponse>> + */ + public CompletableFuture> + deleteReportScheduleWithHttpInfoAsync(UUID scheduleUuid) { + Object localVarPostBody = null; + + // verify the required parameter 'scheduleUuid' is set + if (scheduleUuid == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'scheduleUuid' when calling deleteReportSchedule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/reporting/schedule/{schedule_uuid}" + .replaceAll( + "\\{" + "schedule_uuid" + "\\}", apiClient.escapeString(scheduleUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ReportSchedulesApi.deleteReportSchedule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a report schedule. + * + *

See {@link #getReportScheduleWithHttpInfo}. + * + * @param scheduleUuid The unique identifier of the report schedule to fetch. (required) + * @return ReportScheduleResponse + * @throws ApiException if fails to make API call + */ + public ReportScheduleResponse getReportSchedule(UUID scheduleUuid) throws ApiException { + return getReportScheduleWithHttpInfo(scheduleUuid).getData(); + } + + /** + * Get a report schedule. + * + *

See {@link #getReportScheduleWithHttpInfoAsync}. + * + * @param scheduleUuid The unique identifier of the report schedule to fetch. (required) + * @return CompletableFuture<ReportScheduleResponse> + */ + public CompletableFuture getReportScheduleAsync(UUID scheduleUuid) { + return getReportScheduleWithHttpInfoAsync(scheduleUuid) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a report schedule by its unique identifier. Requires a reporting read permission + * appropriate to the targeted resource type. + * + * @param scheduleUuid The unique identifier of the report schedule to fetch. (required) + * @return ApiResponse<ReportScheduleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getReportScheduleWithHttpInfo(UUID scheduleUuid) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'scheduleUuid' is set + if (scheduleUuid == null) { + throw new ApiException( + 400, "Missing the required parameter 'scheduleUuid' when calling getReportSchedule"); + } + // create path and map variables + String localVarPath = + "/api/v2/reporting/schedule/{schedule_uuid}" + .replaceAll( + "\\{" + "schedule_uuid" + "\\}", apiClient.escapeString(scheduleUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ReportSchedulesApi.getReportSchedule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a report schedule. + * + *

See {@link #getReportScheduleWithHttpInfo}. + * + * @param scheduleUuid The unique identifier of the report schedule to fetch. (required) + * @return CompletableFuture<ApiResponse<ReportScheduleResponse>> + */ + public CompletableFuture> getReportScheduleWithHttpInfoAsync( + UUID scheduleUuid) { + Object localVarPostBody = null; + + // verify the required parameter 'scheduleUuid' is set + if (scheduleUuid == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'scheduleUuid' when calling getReportSchedule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/reporting/schedule/{schedule_uuid}" + .replaceAll( + "\\{" + "schedule_uuid" + "\\}", apiClient.escapeString(scheduleUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ReportSchedulesApi.getReportSchedule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get report schedules for a resource. + * + *

See {@link #getReportSchedulesForResourceWithHttpInfo}. + * + * @param resourceType The type of resource to fetch report schedules for. (required) + * @param resourceId The identifier of the resource to fetch report schedules for. (required) + * @return ReportScheduleListResponse + * @throws ApiException if fails to make API call + */ + public ReportScheduleListResponse getReportSchedulesForResource( + ReportScheduleResourceType resourceType, String resourceId) throws ApiException { + return getReportSchedulesForResourceWithHttpInfo(resourceType, resourceId).getData(); + } + + /** + * Get report schedules for a resource. + * + *

See {@link #getReportSchedulesForResourceWithHttpInfoAsync}. + * + * @param resourceType The type of resource to fetch report schedules for. (required) + * @param resourceId The identifier of the resource to fetch report schedules for. (required) + * @return CompletableFuture<ReportScheduleListResponse> + */ + public CompletableFuture getReportSchedulesForResourceAsync( + ReportScheduleResourceType resourceType, String resourceId) { + return getReportSchedulesForResourceWithHttpInfoAsync(resourceType, resourceId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all report schedules that target a dashboard or integration dashboard resource. Requires a + * reporting read permission appropriate to the targeted resource type. + * + * @param resourceType The type of resource to fetch report schedules for. (required) + * @param resourceId The identifier of the resource to fetch report schedules for. (required) + * @return ApiResponse<ReportScheduleListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getReportSchedulesForResourceWithHttpInfo( + ReportScheduleResourceType resourceType, String resourceId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'resourceType' is set + if (resourceType == null) { + throw new ApiException( + 400, + "Missing the required parameter 'resourceType' when calling" + + " getReportSchedulesForResource"); + } + + // verify the required parameter 'resourceId' is set + if (resourceId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'resourceId' when calling getReportSchedulesForResource"); + } + // create path and map variables + String localVarPath = + "/api/v2/reporting/schedule/{resource_type}/{resource_id}" + .replaceAll( + "\\{" + "resource_type" + "\\}", apiClient.escapeString(resourceType.toString())) + .replaceAll( + "\\{" + "resource_id" + "\\}", apiClient.escapeString(resourceId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ReportSchedulesApi.getReportSchedulesForResource", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get report schedules for a resource. + * + *

See {@link #getReportSchedulesForResourceWithHttpInfo}. + * + * @param resourceType The type of resource to fetch report schedules for. (required) + * @param resourceId The identifier of the resource to fetch report schedules for. (required) + * @return CompletableFuture<ApiResponse<ReportScheduleListResponse>> + */ + public CompletableFuture> + getReportSchedulesForResourceWithHttpInfoAsync( + ReportScheduleResourceType resourceType, String resourceId) { + Object localVarPostBody = null; + + // verify the required parameter 'resourceType' is set + if (resourceType == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'resourceType' when calling" + + " getReportSchedulesForResource")); + return result; + } + + // verify the required parameter 'resourceId' is set + if (resourceId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'resourceId' when calling" + + " getReportSchedulesForResource")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/reporting/schedule/{resource_type}/{resource_id}" + .replaceAll( + "\\{" + "resource_type" + "\\}", apiClient.escapeString(resourceType.toString())) + .replaceAll( + "\\{" + "resource_id" + "\\}", apiClient.escapeString(resourceId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ReportSchedulesApi.getReportSchedulesForResource", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listReportSchedules. */ + public static class ListReportSchedulesOptionalParameters { + private Long pageLimit; + private Long pageOffset; + private String filterTitle; + private UUID filterAuthorUuid; + private String filterRecipients; + + /** + * Set pageLimit. + * + * @param pageLimit The maximum number of schedules to return. The maximum value is 50. + * (optional, default to 25) + * @return ListReportSchedulesOptionalParameters + */ + public ListReportSchedulesOptionalParameters pageLimit(Long pageLimit) { + this.pageLimit = pageLimit; + return this; + } + + /** + * Set pageOffset. + * + * @param pageOffset The offset from which to start returning schedules. (optional, default to + * 0) + * @return ListReportSchedulesOptionalParameters + */ + public ListReportSchedulesOptionalParameters pageOffset(Long pageOffset) { + this.pageOffset = pageOffset; + return this; + } + + /** + * Set filterTitle. + * + * @param filterTitle Filter schedules by report title. (optional) + * @return ListReportSchedulesOptionalParameters + */ + public ListReportSchedulesOptionalParameters filterTitle(String filterTitle) { + this.filterTitle = filterTitle; + return this; + } + + /** + * Set filterAuthorUuid. + * + * @param filterAuthorUuid Filter schedules by author UUID. (optional) + * @return ListReportSchedulesOptionalParameters + */ + public ListReportSchedulesOptionalParameters filterAuthorUuid(UUID filterAuthorUuid) { + this.filterAuthorUuid = filterAuthorUuid; + return this; + } + + /** + * Set filterRecipients. + * + * @param filterRecipients Filter schedules by a comma-separated list of recipients. (optional) + * @return ListReportSchedulesOptionalParameters + */ + public ListReportSchedulesOptionalParameters filterRecipients(String filterRecipients) { + this.filterRecipients = filterRecipients; + return this; + } + } + + /** + * List report schedules. + * + *

See {@link #listReportSchedulesWithHttpInfo}. + * + * @return ReportScheduleListResponse + * @throws ApiException if fails to make API call + */ + public ReportScheduleListResponse listReportSchedules() throws ApiException { + return listReportSchedulesWithHttpInfo(new ListReportSchedulesOptionalParameters()).getData(); + } + + /** + * List report schedules. + * + *

See {@link #listReportSchedulesWithHttpInfoAsync}. + * + * @return CompletableFuture<ReportScheduleListResponse> + */ + public CompletableFuture listReportSchedulesAsync() { + return listReportSchedulesWithHttpInfoAsync(new ListReportSchedulesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List report schedules. + * + *

See {@link #listReportSchedulesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return ReportScheduleListResponse + * @throws ApiException if fails to make API call + */ + public ReportScheduleListResponse listReportSchedules( + ListReportSchedulesOptionalParameters parameters) throws ApiException { + return listReportSchedulesWithHttpInfo(parameters).getData(); + } + + /** + * List report schedules. + * + *

See {@link #listReportSchedulesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ReportScheduleListResponse> + */ + public CompletableFuture listReportSchedulesAsync( + ListReportSchedulesOptionalParameters parameters) { + return listReportSchedulesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List dashboard and integration dashboard report schedules for the organization. The response is + * paginated and can be filtered by title, author UUID, or recipients. Requires the + * generate_dashboard_reports permission. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<ReportScheduleListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse listReportSchedulesWithHttpInfo( + ListReportSchedulesOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + Long pageLimit = parameters.pageLimit; + Long pageOffset = parameters.pageOffset; + String filterTitle = parameters.filterTitle; + UUID filterAuthorUuid = parameters.filterAuthorUuid; + String filterRecipients = parameters.filterRecipients; + // create path and map variables + String localVarPath = "/api/v2/reporting/schedule/list"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[title]", filterTitle)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[author_uuid]", filterAuthorUuid)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[recipients]", filterRecipients)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ReportSchedulesApi.listReportSchedules", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List report schedules. + * + *

See {@link #listReportSchedulesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<ReportScheduleListResponse>> + */ + public CompletableFuture> + listReportSchedulesWithHttpInfoAsync(ListReportSchedulesOptionalParameters parameters) { + Object localVarPostBody = null; + Long pageLimit = parameters.pageLimit; + Long pageOffset = parameters.pageOffset; + String filterTitle = parameters.filterTitle; + UUID filterAuthorUuid = parameters.filterAuthorUuid; + String filterRecipients = parameters.filterRecipients; + // create path and map variables + String localVarPath = "/api/v2/reporting/schedule/list"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[title]", filterTitle)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[author_uuid]", filterAuthorUuid)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[recipients]", filterRecipients)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ReportSchedulesApi.listReportSchedules", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Update a report schedule. * @@ -378,4 +1076,166 @@ public ApiResponse patchReportScheduleWithHttpInfo( false, new GenericType() {}); } + + /** + * Toggle a report schedule. + * + *

See {@link #toggleReportScheduleWithHttpInfo}. + * + * @param scheduleUuid The unique identifier of the report schedule to toggle. (required) + * @param body (required) + * @return ReportScheduleResponse + * @throws ApiException if fails to make API call + */ + public ReportScheduleResponse toggleReportSchedule( + UUID scheduleUuid, ReportScheduleToggleRequest body) throws ApiException { + return toggleReportScheduleWithHttpInfo(scheduleUuid, body).getData(); + } + + /** + * Toggle a report schedule. + * + *

See {@link #toggleReportScheduleWithHttpInfoAsync}. + * + * @param scheduleUuid The unique identifier of the report schedule to toggle. (required) + * @param body (required) + * @return CompletableFuture<ReportScheduleResponse> + */ + public CompletableFuture toggleReportScheduleAsync( + UUID scheduleUuid, ReportScheduleToggleRequest body) { + return toggleReportScheduleWithHttpInfoAsync(scheduleUuid, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Activate or pause a report schedule by setting its status to active or + * inactive. Requires a reporting write permission appropriate to the targeted resource + * type and schedule ownership. + * + * @param scheduleUuid The unique identifier of the report schedule to toggle. (required) + * @param body (required) + * @return ApiResponse<ReportScheduleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse toggleReportScheduleWithHttpInfo( + UUID scheduleUuid, ReportScheduleToggleRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'scheduleUuid' is set + if (scheduleUuid == null) { + throw new ApiException( + 400, "Missing the required parameter 'scheduleUuid' when calling toggleReportSchedule"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling toggleReportSchedule"); + } + // create path and map variables + String localVarPath = + "/api/v2/reporting/schedule/{schedule_uuid}/toggle" + .replaceAll( + "\\{" + "schedule_uuid" + "\\}", apiClient.escapeString(scheduleUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ReportSchedulesApi.toggleReportSchedule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Toggle a report schedule. + * + *

See {@link #toggleReportScheduleWithHttpInfo}. + * + * @param scheduleUuid The unique identifier of the report schedule to toggle. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<ReportScheduleResponse>> + */ + public CompletableFuture> + toggleReportScheduleWithHttpInfoAsync(UUID scheduleUuid, ReportScheduleToggleRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'scheduleUuid' is set + if (scheduleUuid == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'scheduleUuid' when calling toggleReportSchedule")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling toggleReportSchedule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/reporting/schedule/{schedule_uuid}/toggle" + .replaceAll( + "\\{" + "schedule_uuid" + "\\}", apiClient.escapeString(scheduleUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ReportSchedulesApi.toggleReportSchedule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/DataObservabilityMonitorRunStatus.java b/src/main/java/com/datadog/api/client/v2/model/DataObservabilityMonitorRunStatus.java new file mode 100644 index 00000000000..f4a33fd40db --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DataObservabilityMonitorRunStatus.java @@ -0,0 +1,66 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The status of a data observability monitor run. */ +@JsonSerialize( + using = DataObservabilityMonitorRunStatus.DataObservabilityMonitorRunStatusSerializer.class) +public class DataObservabilityMonitorRunStatus extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("pending", "ok", "warn", "alert", "error")); + + public static final DataObservabilityMonitorRunStatus PENDING = + new DataObservabilityMonitorRunStatus("pending"); + public static final DataObservabilityMonitorRunStatus OK = + new DataObservabilityMonitorRunStatus("ok"); + public static final DataObservabilityMonitorRunStatus WARN = + new DataObservabilityMonitorRunStatus("warn"); + public static final DataObservabilityMonitorRunStatus ALERT = + new DataObservabilityMonitorRunStatus("alert"); + public static final DataObservabilityMonitorRunStatus ERROR = + new DataObservabilityMonitorRunStatus("error"); + + DataObservabilityMonitorRunStatus(String value) { + super(value, allowedValues); + } + + public static class DataObservabilityMonitorRunStatusSerializer + extends StdSerializer { + public DataObservabilityMonitorRunStatusSerializer(Class t) { + super(t); + } + + public DataObservabilityMonitorRunStatusSerializer() { + this(null); + } + + @Override + public void serialize( + DataObservabilityMonitorRunStatus value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DataObservabilityMonitorRunStatus fromValue(String value) { + return new DataObservabilityMonitorRunStatus(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DataObservabilityMonitorRunType.java b/src/main/java/com/datadog/api/client/v2/model/DataObservabilityMonitorRunType.java new file mode 100644 index 00000000000..a7680ec1e4d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DataObservabilityMonitorRunType.java @@ -0,0 +1,58 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The JSON:API resource type for a data observability monitor run. */ +@JsonSerialize( + using = DataObservabilityMonitorRunType.DataObservabilityMonitorRunTypeSerializer.class) +public class DataObservabilityMonitorRunType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("monitor_run")); + + public static final DataObservabilityMonitorRunType MONITOR_RUN = + new DataObservabilityMonitorRunType("monitor_run"); + + DataObservabilityMonitorRunType(String value) { + super(value, allowedValues); + } + + public static class DataObservabilityMonitorRunTypeSerializer + extends StdSerializer { + public DataObservabilityMonitorRunTypeSerializer(Class t) { + super(t); + } + + public DataObservabilityMonitorRunTypeSerializer() { + this(null); + } + + @Override + public void serialize( + DataObservabilityMonitorRunType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DataObservabilityMonitorRunType fromValue(String value) { + return new DataObservabilityMonitorRunType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GetDataObservabilityMonitorRunStatusResponse.java b/src/main/java/com/datadog/api/client/v2/model/GetDataObservabilityMonitorRunStatusResponse.java new file mode 100644 index 00000000000..9b0d2d48730 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetDataObservabilityMonitorRunStatusResponse.java @@ -0,0 +1,151 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The response for getting the status of a data observability monitor run. */ +@JsonPropertyOrder({GetDataObservabilityMonitorRunStatusResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetDataObservabilityMonitorRunStatusResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GetDataObservabilityMonitorRunStatusResponseData data; + + public GetDataObservabilityMonitorRunStatusResponse() {} + + @JsonCreator + public GetDataObservabilityMonitorRunStatusResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + GetDataObservabilityMonitorRunStatusResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GetDataObservabilityMonitorRunStatusResponse data( + GetDataObservabilityMonitorRunStatusResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The data object for a data observability monitor run status response. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GetDataObservabilityMonitorRunStatusResponseData getData() { + return data; + } + + public void setData(GetDataObservabilityMonitorRunStatusResponseData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GetDataObservabilityMonitorRunStatusResponse + */ + @JsonAnySetter + public GetDataObservabilityMonitorRunStatusResponse putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GetDataObservabilityMonitorRunStatusResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDataObservabilityMonitorRunStatusResponse getDataObservabilityMonitorRunStatusResponse = + (GetDataObservabilityMonitorRunStatusResponse) o; + return Objects.equals(this.data, getDataObservabilityMonitorRunStatusResponse.data) + && Objects.equals( + this.additionalProperties, + getDataObservabilityMonitorRunStatusResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDataObservabilityMonitorRunStatusResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GetDataObservabilityMonitorRunStatusResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GetDataObservabilityMonitorRunStatusResponseAttributes.java new file mode 100644 index 00000000000..5a60335f36f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetDataObservabilityMonitorRunStatusResponseAttributes.java @@ -0,0 +1,189 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The attributes of a data observability monitor run status response. */ +@JsonPropertyOrder({ + GetDataObservabilityMonitorRunStatusResponseAttributes.JSON_PROPERTY_ERROR_MESSAGE, + GetDataObservabilityMonitorRunStatusResponseAttributes.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetDataObservabilityMonitorRunStatusResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ERROR_MESSAGE = "error_message"; + private String errorMessage; + + public static final String JSON_PROPERTY_STATUS = "status"; + private DataObservabilityMonitorRunStatus status; + + public GetDataObservabilityMonitorRunStatusResponseAttributes() {} + + @JsonCreator + public GetDataObservabilityMonitorRunStatusResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) + DataObservabilityMonitorRunStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + } + + public GetDataObservabilityMonitorRunStatusResponseAttributes errorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Error message describing why the monitor run failed. Only present when status is error. + * + * @return errorMessage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + public GetDataObservabilityMonitorRunStatusResponseAttributes status( + DataObservabilityMonitorRunStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * The status of a data observability monitor run. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DataObservabilityMonitorRunStatus getStatus() { + return status; + } + + public void setStatus(DataObservabilityMonitorRunStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GetDataObservabilityMonitorRunStatusResponseAttributes + */ + @JsonAnySetter + public GetDataObservabilityMonitorRunStatusResponseAttributes putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this GetDataObservabilityMonitorRunStatusResponseAttributes object is equal to + * o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDataObservabilityMonitorRunStatusResponseAttributes + getDataObservabilityMonitorRunStatusResponseAttributes = + (GetDataObservabilityMonitorRunStatusResponseAttributes) o; + return Objects.equals( + this.errorMessage, getDataObservabilityMonitorRunStatusResponseAttributes.errorMessage) + && Objects.equals( + this.status, getDataObservabilityMonitorRunStatusResponseAttributes.status) + && Objects.equals( + this.additionalProperties, + getDataObservabilityMonitorRunStatusResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(errorMessage, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDataObservabilityMonitorRunStatusResponseAttributes {\n"); + sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GetDataObservabilityMonitorRunStatusResponseData.java b/src/main/java/com/datadog/api/client/v2/model/GetDataObservabilityMonitorRunStatusResponseData.java new file mode 100644 index 00000000000..8f46e558f8d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetDataObservabilityMonitorRunStatusResponseData.java @@ -0,0 +1,218 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The data object for a data observability monitor run status response. */ +@JsonPropertyOrder({ + GetDataObservabilityMonitorRunStatusResponseData.JSON_PROPERTY_ATTRIBUTES, + GetDataObservabilityMonitorRunStatusResponseData.JSON_PROPERTY_ID, + GetDataObservabilityMonitorRunStatusResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetDataObservabilityMonitorRunStatusResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GetDataObservabilityMonitorRunStatusResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DataObservabilityMonitorRunType type = DataObservabilityMonitorRunType.MONITOR_RUN; + + public GetDataObservabilityMonitorRunStatusResponseData() {} + + @JsonCreator + public GetDataObservabilityMonitorRunStatusResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + GetDataObservabilityMonitorRunStatusResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + DataObservabilityMonitorRunType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GetDataObservabilityMonitorRunStatusResponseData attributes( + GetDataObservabilityMonitorRunStatusResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes of a data observability monitor run status response. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GetDataObservabilityMonitorRunStatusResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GetDataObservabilityMonitorRunStatusResponseAttributes attributes) { + this.attributes = attributes; + } + + public GetDataObservabilityMonitorRunStatusResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the monitor run. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public GetDataObservabilityMonitorRunStatusResponseData type( + DataObservabilityMonitorRunType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API resource type for a data observability monitor run. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DataObservabilityMonitorRunType getType() { + return type; + } + + public void setType(DataObservabilityMonitorRunType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GetDataObservabilityMonitorRunStatusResponseData + */ + @JsonAnySetter + public GetDataObservabilityMonitorRunStatusResponseData putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GetDataObservabilityMonitorRunStatusResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDataObservabilityMonitorRunStatusResponseData + getDataObservabilityMonitorRunStatusResponseData = + (GetDataObservabilityMonitorRunStatusResponseData) o; + return Objects.equals( + this.attributes, getDataObservabilityMonitorRunStatusResponseData.attributes) + && Objects.equals(this.id, getDataObservabilityMonitorRunStatusResponseData.id) + && Objects.equals(this.type, getDataObservabilityMonitorRunStatusResponseData.type) + && Objects.equals( + this.additionalProperties, + getDataObservabilityMonitorRunStatusResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDataObservabilityMonitorRunStatusResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReportScheduleIncludedResource.java b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleIncludedResource.java index aa0de0fcb67..6915111c099 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ReportScheduleIncludedResource.java +++ b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleIncludedResource.java @@ -128,6 +128,51 @@ public ReportScheduleIncludedResource deserialize(JsonParser jp, Deserialization log.log(Level.FINER, "Input data does not match schema 'ReportScheduleAuthor'", e); } + // deserialize ReportScheduleResource + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ReportScheduleResource.class.equals(Integer.class) + || ReportScheduleResource.class.equals(Long.class) + || ReportScheduleResource.class.equals(Float.class) + || ReportScheduleResource.class.equals(Double.class) + || ReportScheduleResource.class.equals(Boolean.class) + || ReportScheduleResource.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ReportScheduleResource.class.equals(Integer.class) + || ReportScheduleResource.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ReportScheduleResource.class.equals(Float.class) + || ReportScheduleResource.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ReportScheduleResource.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ReportScheduleResource.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(ReportScheduleResource.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((ReportScheduleResource) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'ReportScheduleResource'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ReportScheduleResource'", e); + } + ReportScheduleIncludedResource ret = new ReportScheduleIncludedResource(); if (match == 1) { ret.setActualInstance(deserialized); @@ -163,8 +208,14 @@ public ReportScheduleIncludedResource(ReportScheduleAuthor o) { setActualInstance(o); } + public ReportScheduleIncludedResource(ReportScheduleResource o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + static { schemas.put("ReportScheduleAuthor", new GenericType() {}); + schemas.put("ReportScheduleResource", new GenericType() {}); JSON.registerDescendants( ReportScheduleIncludedResource.class, Collections.unmodifiableMap(schemas)); } @@ -176,7 +227,7 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: ReportScheduleAuthor + * against the oneOf child schemas: ReportScheduleAuthor, ReportScheduleResource * *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a * composed schema (allOf, anyOf, oneOf). @@ -187,18 +238,24 @@ public void setActualInstance(Object instance) { super.setActualInstance(instance); return; } + if (JSON.isInstanceOf(ReportScheduleResource.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } - throw new RuntimeException("Invalid instance type. Must be ReportScheduleAuthor"); + throw new RuntimeException( + "Invalid instance type. Must be ReportScheduleAuthor, ReportScheduleResource"); } /** - * Get the actual instance, which can be the following: ReportScheduleAuthor + * Get the actual instance, which can be the following: ReportScheduleAuthor, + * ReportScheduleResource * - * @return The actual instance (ReportScheduleAuthor) + * @return The actual instance (ReportScheduleAuthor, ReportScheduleResource) */ @Override public Object getActualInstance() { @@ -215,4 +272,15 @@ public Object getActualInstance() { public ReportScheduleAuthor getReportScheduleAuthor() throws ClassCastException { return (ReportScheduleAuthor) super.getActualInstance(); } + + /** + * Get the actual instance of `ReportScheduleResource`. If the actual instance is not + * `ReportScheduleResource`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReportScheduleResource` + * @throws ClassCastException if the instance is not `ReportScheduleResource` + */ + public ReportScheduleResource getReportScheduleResource() throws ClassCastException { + return (ReportScheduleResource) super.getActualInstance(); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/ReportScheduleIncludedResourceType.java b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleIncludedResourceType.java new file mode 100644 index 00000000000..5f43101a2c1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleIncludedResourceType.java @@ -0,0 +1,58 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** JSON:API resource type for an included report resource. */ +@JsonSerialize( + using = ReportScheduleIncludedResourceType.ReportScheduleIncludedResourceTypeSerializer.class) +public class ReportScheduleIncludedResourceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("resource")); + + public static final ReportScheduleIncludedResourceType RESOURCE = + new ReportScheduleIncludedResourceType("resource"); + + ReportScheduleIncludedResourceType(String value) { + super(value, allowedValues); + } + + public static class ReportScheduleIncludedResourceTypeSerializer + extends StdSerializer { + public ReportScheduleIncludedResourceTypeSerializer( + Class t) { + super(t); + } + + public ReportScheduleIncludedResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ReportScheduleIncludedResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ReportScheduleIncludedResourceType fromValue(String value) { + return new ReportScheduleIncludedResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReportScheduleIndexTemplateVariable.java b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleIndexTemplateVariable.java new file mode 100644 index 00000000000..f5c37d98314 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleIndexTemplateVariable.java @@ -0,0 +1,287 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Template variable metadata from a dashboard index. */ +@JsonPropertyOrder({ + ReportScheduleIndexTemplateVariable.JSON_PROPERTY_AVAILABLE_VALUES, + ReportScheduleIndexTemplateVariable.JSON_PROPERTY_DEFAULTS, + ReportScheduleIndexTemplateVariable.JSON_PROPERTY_NAME, + ReportScheduleIndexTemplateVariable.JSON_PROPERTY_PREFIX +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReportScheduleIndexTemplateVariable { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AVAILABLE_VALUES = "available_values"; + private JsonNullable> availableValues = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_DEFAULTS = "defaults"; + private JsonNullable> defaults = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_NAME = "name"; + private JsonNullable name = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_PREFIX = "prefix"; + private JsonNullable prefix = JsonNullable.undefined(); + + public ReportScheduleIndexTemplateVariable availableValues(List availableValues) { + this.availableValues = JsonNullable.>of(availableValues); + return this; + } + + public ReportScheduleIndexTemplateVariable addAvailableValuesItem(String availableValuesItem) { + if (this.availableValues == null || !this.availableValues.isPresent()) { + this.availableValues = JsonNullable.>of(new ArrayList<>()); + } + try { + this.availableValues.get().add(availableValuesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Available values for the template variable. + * + * @return availableValues + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getAvailableValues() { + return availableValues.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_AVAILABLE_VALUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getAvailableValues_JsonNullable() { + return availableValues; + } + + @JsonProperty(JSON_PROPERTY_AVAILABLE_VALUES) + public void setAvailableValues_JsonNullable(JsonNullable> availableValues) { + this.availableValues = availableValues; + } + + public void setAvailableValues(List availableValues) { + this.availableValues = JsonNullable.>of(availableValues); + } + + public ReportScheduleIndexTemplateVariable defaults(List defaults) { + this.defaults = JsonNullable.>of(defaults); + return this; + } + + public ReportScheduleIndexTemplateVariable addDefaultsItem(String defaultsItem) { + if (this.defaults == null || !this.defaults.isPresent()) { + this.defaults = JsonNullable.>of(new ArrayList<>()); + } + try { + this.defaults.get().add(defaultsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Default values for the template variable. + * + * @return defaults + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getDefaults() { + return defaults.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getDefaults_JsonNullable() { + return defaults; + } + + @JsonProperty(JSON_PROPERTY_DEFAULTS) + public void setDefaults_JsonNullable(JsonNullable> defaults) { + this.defaults = defaults; + } + + public void setDefaults(List defaults) { + this.defaults = JsonNullable.>of(defaults); + } + + public ReportScheduleIndexTemplateVariable name(String name) { + this.name = JsonNullable.of(name); + return this; + } + + /** + * The template variable name. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getName() { + return name.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getName_JsonNullable() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + public void setName_JsonNullable(JsonNullable name) { + this.name = name; + } + + public void setName(String name) { + this.name = JsonNullable.of(name); + } + + public ReportScheduleIndexTemplateVariable prefix(String prefix) { + this.prefix = JsonNullable.of(prefix); + return this; + } + + /** + * The tag prefix for the template variable, when available. + * + * @return prefix + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getPrefix() { + return prefix.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getPrefix_JsonNullable() { + return prefix; + } + + @JsonProperty(JSON_PROPERTY_PREFIX) + public void setPrefix_JsonNullable(JsonNullable prefix) { + this.prefix = prefix; + } + + public void setPrefix(String prefix) { + this.prefix = JsonNullable.of(prefix); + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ReportScheduleIndexTemplateVariable + */ + @JsonAnySetter + public ReportScheduleIndexTemplateVariable putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ReportScheduleIndexTemplateVariable object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportScheduleIndexTemplateVariable reportScheduleIndexTemplateVariable = + (ReportScheduleIndexTemplateVariable) o; + return Objects.equals(this.availableValues, reportScheduleIndexTemplateVariable.availableValues) + && Objects.equals(this.defaults, reportScheduleIndexTemplateVariable.defaults) + && Objects.equals(this.name, reportScheduleIndexTemplateVariable.name) + && Objects.equals(this.prefix, reportScheduleIndexTemplateVariable.prefix) + && Objects.equals( + this.additionalProperties, reportScheduleIndexTemplateVariable.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(availableValues, defaults, name, prefix, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportScheduleIndexTemplateVariable {\n"); + sb.append(" availableValues: ").append(toIndentedString(availableValues)).append("\n"); + sb.append(" defaults: ").append(toIndentedString(defaults)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResourceRelationship.java b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResourceRelationship.java new file mode 100644 index 00000000000..2f0ad376203 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResourceRelationship.java @@ -0,0 +1,149 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationship to the report target resource. */ +@JsonPropertyOrder({ReportScheduleListResourceRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReportScheduleListResourceRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ReportScheduleListResourceRelationshipData data; + + public ReportScheduleListResourceRelationship() {} + + @JsonCreator + public ReportScheduleListResourceRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ReportScheduleListResourceRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ReportScheduleListResourceRelationship data( + ReportScheduleListResourceRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Relationship data for the report target resource. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReportScheduleListResourceRelationshipData getData() { + return data; + } + + public void setData(ReportScheduleListResourceRelationshipData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ReportScheduleListResourceRelationship + */ + @JsonAnySetter + public ReportScheduleListResourceRelationship putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ReportScheduleListResourceRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportScheduleListResourceRelationship reportScheduleListResourceRelationship = + (ReportScheduleListResourceRelationship) o; + return Objects.equals(this.data, reportScheduleListResourceRelationship.data) + && Objects.equals( + this.additionalProperties, reportScheduleListResourceRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportScheduleListResourceRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResourceRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResourceRelationshipData.java new file mode 100644 index 00000000000..4be45ee1e40 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResourceRelationshipData.java @@ -0,0 +1,183 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationship data for the report target resource. */ +@JsonPropertyOrder({ + ReportScheduleListResourceRelationshipData.JSON_PROPERTY_ID, + ReportScheduleListResourceRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReportScheduleListResourceRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ReportScheduleIncludedResourceType type; + + public ReportScheduleListResourceRelationshipData() {} + + @JsonCreator + public ReportScheduleListResourceRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ReportScheduleIncludedResourceType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ReportScheduleListResourceRelationshipData id(String id) { + this.id = id; + return this; + } + + /** + * The resource identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ReportScheduleListResourceRelationshipData type(ReportScheduleIncludedResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for an included report resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReportScheduleIncludedResourceType getType() { + return type; + } + + public void setType(ReportScheduleIncludedResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ReportScheduleListResourceRelationshipData + */ + @JsonAnySetter + public ReportScheduleListResourceRelationshipData putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ReportScheduleListResourceRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportScheduleListResourceRelationshipData reportScheduleListResourceRelationshipData = + (ReportScheduleListResourceRelationshipData) o; + return Objects.equals(this.id, reportScheduleListResourceRelationshipData.id) + && Objects.equals(this.type, reportScheduleListResourceRelationshipData.type) + && Objects.equals( + this.additionalProperties, + reportScheduleListResourceRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportScheduleListResourceRelationshipData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponse.java b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponse.java new file mode 100644 index 00000000000..1a04f3f7c40 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponse.java @@ -0,0 +1,253 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing a list of report schedules. */ +@JsonPropertyOrder({ + ReportScheduleListResponse.JSON_PROPERTY_DATA, + ReportScheduleListResponse.JSON_PROPERTY_INCLUDED, + ReportScheduleListResponse.JSON_PROPERTY_LINKS, + ReportScheduleListResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReportScheduleListResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public static final String JSON_PROPERTY_LINKS = "links"; + private ReportScheduleListResponseLinks links; + + public static final String JSON_PROPERTY_META = "meta"; + private ReportScheduleListResponseMeta meta; + + public ReportScheduleListResponse() {} + + @JsonCreator + public ReportScheduleListResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public ReportScheduleListResponse data(List data) { + this.data = data; + for (ReportScheduleListResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ReportScheduleListResponse addDataItem(ReportScheduleListResponseData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The list of report schedules. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public ReportScheduleListResponse included(List included) { + this.included = included; + for (ReportScheduleIncludedResource item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ReportScheduleListResponse addIncludedItem(ReportScheduleIncludedResource includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Related resources included with the report schedules, such as authors and rendered resources. + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + public ReportScheduleListResponse links(ReportScheduleListResponseLinks links) { + this.links = links; + this.unparsed |= links.unparsed; + return this; + } + + /** + * Pagination links for navigating a report schedule list response. + * + * @return links + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ReportScheduleListResponseLinks getLinks() { + return links; + } + + public void setLinks(ReportScheduleListResponseLinks links) { + this.links = links; + } + + public ReportScheduleListResponse meta(ReportScheduleListResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata for a paginated report schedule list response. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ReportScheduleListResponseMeta getMeta() { + return meta; + } + + public void setMeta(ReportScheduleListResponseMeta meta) { + this.meta = meta; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ReportScheduleListResponse + */ + @JsonAnySetter + public ReportScheduleListResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ReportScheduleListResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportScheduleListResponse reportScheduleListResponse = (ReportScheduleListResponse) o; + return Objects.equals(this.data, reportScheduleListResponse.data) + && Objects.equals(this.included, reportScheduleListResponse.included) + && Objects.equals(this.links, reportScheduleListResponse.links) + && Objects.equals(this.meta, reportScheduleListResponse.meta) + && Objects.equals( + this.additionalProperties, reportScheduleListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, links, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportScheduleListResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponseAttributes.java new file mode 100644 index 00000000000..57334c2709d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponseAttributes.java @@ -0,0 +1,566 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** The configuration and derived state of a report schedule in a list response. */ +@JsonPropertyOrder({ + ReportScheduleListResponseAttributes.JSON_PROPERTY_DELIVERY_FORMAT, + ReportScheduleListResponseAttributes.JSON_PROPERTY_DESCRIPTION, + ReportScheduleListResponseAttributes.JSON_PROPERTY_NEXT_RECURRENCE, + ReportScheduleListResponseAttributes.JSON_PROPERTY_QUERY_PARAMS, + ReportScheduleListResponseAttributes.JSON_PROPERTY_RECIPIENTS, + ReportScheduleListResponseAttributes.JSON_PROPERTY_RESOURCE_ID, + ReportScheduleListResponseAttributes.JSON_PROPERTY_RESOURCE_TYPE, + ReportScheduleListResponseAttributes.JSON_PROPERTY_RRULE, + ReportScheduleListResponseAttributes.JSON_PROPERTY_STATUS, + ReportScheduleListResponseAttributes.JSON_PROPERTY_TEMPLATE_VARIABLES, + ReportScheduleListResponseAttributes.JSON_PROPERTY_TIMEFRAME, + ReportScheduleListResponseAttributes.JSON_PROPERTY_TIMEZONE, + ReportScheduleListResponseAttributes.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReportScheduleListResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DELIVERY_FORMAT = "delivery_format"; + private JsonNullable deliveryFormat = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_NEXT_RECURRENCE = "next_recurrence"; + private Long nextRecurrence; + + public static final String JSON_PROPERTY_QUERY_PARAMS = "query_params"; + private Map queryParams = + new HashMap(); + + public static final String JSON_PROPERTY_RECIPIENTS = "recipients"; + private List recipients = new ArrayList<>(); + + public static final String JSON_PROPERTY_RESOURCE_ID = "resource_id"; + private String resourceId; + + public static final String JSON_PROPERTY_RESOURCE_TYPE = "resource_type"; + private ReportScheduleResourceType resourceType; + + public static final String JSON_PROPERTY_RRULE = "rrule"; + private String rrule; + + public static final String JSON_PROPERTY_STATUS = "status"; + private ReportScheduleStatus status; + + public static final String JSON_PROPERTY_TEMPLATE_VARIABLES = "template_variables"; + private List templateVariables = new ArrayList<>(); + + public static final String JSON_PROPERTY_TIMEFRAME = "timeframe"; + private String timeframe; + + public static final String JSON_PROPERTY_TIMEZONE = "timezone"; + private String timezone; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public ReportScheduleListResponseAttributes() {} + + @JsonCreator + public ReportScheduleListResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_NEXT_RECURRENCE) Long nextRecurrence, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY_PARAMS) + Map queryParams, + @JsonProperty(required = true, value = JSON_PROPERTY_RECIPIENTS) List recipients, + @JsonProperty(required = true, value = JSON_PROPERTY_RESOURCE_ID) String resourceId, + @JsonProperty(required = true, value = JSON_PROPERTY_RESOURCE_TYPE) + ReportScheduleResourceType resourceType, + @JsonProperty(required = true, value = JSON_PROPERTY_RRULE) String rrule, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) ReportScheduleStatus status, + @JsonProperty(required = true, value = JSON_PROPERTY_TEMPLATE_VARIABLES) + List templateVariables, + @JsonProperty(required = true, value = JSON_PROPERTY_TIMEFRAME) String timeframe, + @JsonProperty(required = true, value = JSON_PROPERTY_TIMEZONE) String timezone, + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title) { + this.description = description; + this.nextRecurrence = nextRecurrence; + if (nextRecurrence != null) {} + this.queryParams = queryParams; + this.recipients = recipients; + this.resourceId = resourceId; + this.resourceType = resourceType; + this.unparsed |= !resourceType.isValid(); + this.rrule = rrule; + this.status = status; + this.unparsed |= !status.isValid(); + this.templateVariables = templateVariables; + this.timeframe = timeframe; + if (timeframe != null) {} + this.timezone = timezone; + this.title = title; + } + + public ReportScheduleListResponseAttributes deliveryFormat( + ReportScheduleResponseAttributesDeliveryFormat deliveryFormat) { + this.deliveryFormat = + JsonNullable.of(deliveryFormat); + return this; + } + + /** + * The delivery format for dashboard report schedules, or null if not set. + * + * @return deliveryFormat + */ + @jakarta.annotation.Nullable + @JsonIgnore + public ReportScheduleResponseAttributesDeliveryFormat getDeliveryFormat() { + return deliveryFormat.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DELIVERY_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable + getDeliveryFormat_JsonNullable() { + return deliveryFormat; + } + + @JsonProperty(JSON_PROPERTY_DELIVERY_FORMAT) + public void setDeliveryFormat_JsonNullable( + JsonNullable deliveryFormat) { + this.deliveryFormat = deliveryFormat; + } + + public void setDeliveryFormat(ReportScheduleResponseAttributesDeliveryFormat deliveryFormat) { + if (!deliveryFormat.isValid()) { + this.unparsed = true; + } + this.deliveryFormat = + JsonNullable.of(deliveryFormat); + } + + public ReportScheduleListResponseAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The description of the report. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ReportScheduleListResponseAttributes nextRecurrence(Long nextRecurrence) { + this.nextRecurrence = nextRecurrence; + if (nextRecurrence != null) {} + return this; + } + + /** + * The Unix timestamp, in milliseconds, of the next scheduled delivery, or null if + * none is scheduled. + * + * @return nextRecurrence + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NEXT_RECURRENCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getNextRecurrence() { + return nextRecurrence; + } + + public void setNextRecurrence(Long nextRecurrence) { + this.nextRecurrence = nextRecurrence; + } + + public ReportScheduleListResponseAttributes queryParams( + Map queryParams) { + this.queryParams = queryParams; + return this; + } + + public ReportScheduleListResponseAttributes putQueryParamsItem( + String key, ReportScheduleQueryParameterValue queryParamsItem) { + this.queryParams.put(key, queryParamsItem); + return this; + } + + /** + * Query parameters applied when rendering the report. + * + * @return queryParams + */ + @JsonProperty(JSON_PROPERTY_QUERY_PARAMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Map getQueryParams() { + return queryParams; + } + + public void setQueryParams(Map queryParams) { + this.queryParams = queryParams; + } + + public ReportScheduleListResponseAttributes recipients(List recipients) { + this.recipients = recipients; + return this; + } + + public ReportScheduleListResponseAttributes addRecipientsItem(String recipientsItem) { + this.recipients.add(recipientsItem); + return this; + } + + /** + * The recipients of the report (email addresses, Slack channel references, or Microsoft Teams + * channel references). + * + * @return recipients + */ + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRecipients() { + return recipients; + } + + public void setRecipients(List recipients) { + this.recipients = recipients; + } + + public ReportScheduleListResponseAttributes resourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * The identifier of the resource rendered in the report. + * + * @return resourceId + */ + @JsonProperty(JSON_PROPERTY_RESOURCE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public ReportScheduleListResponseAttributes resourceType( + ReportScheduleResourceType resourceType) { + this.resourceType = resourceType; + this.unparsed |= !resourceType.isValid(); + return this; + } + + /** + * The type of dashboard resource the report schedule targets. + * + * @return resourceType + */ + @JsonProperty(JSON_PROPERTY_RESOURCE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReportScheduleResourceType getResourceType() { + return resourceType; + } + + public void setResourceType(ReportScheduleResourceType resourceType) { + if (!resourceType.isValid()) { + this.unparsed = true; + } + this.resourceType = resourceType; + } + + public ReportScheduleListResponseAttributes rrule(String rrule) { + this.rrule = rrule; + return this; + } + + /** + * The recurrence rule for the schedule, expressed as an iCalendar RRULE string. + * + * @return rrule + */ + @JsonProperty(JSON_PROPERTY_RRULE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRrule() { + return rrule; + } + + public void setRrule(String rrule) { + this.rrule = rrule; + } + + public ReportScheduleListResponseAttributes status(ReportScheduleStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * Whether the schedule is currently delivering reports (active) or paused ( + * inactive). + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReportScheduleStatus getStatus() { + return status; + } + + public void setStatus(ReportScheduleStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + public ReportScheduleListResponseAttributes templateVariables( + List templateVariables) { + this.templateVariables = templateVariables; + for (ReportScheduleTemplateVariable item : templateVariables) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ReportScheduleListResponseAttributes addTemplateVariablesItem( + ReportScheduleTemplateVariable templateVariablesItem) { + this.templateVariables.add(templateVariablesItem); + this.unparsed |= templateVariablesItem.unparsed; + return this; + } + + /** + * The dashboard template variables applied when rendering the report. + * + * @return templateVariables + */ + @JsonProperty(JSON_PROPERTY_TEMPLATE_VARIABLES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTemplateVariables() { + return templateVariables; + } + + public void setTemplateVariables(List templateVariables) { + this.templateVariables = templateVariables; + } + + public ReportScheduleListResponseAttributes timeframe(String timeframe) { + this.timeframe = timeframe; + if (timeframe != null) {} + return this; + } + + /** + * The relative timeframe of data included in the report, or null if not set. + * + * @return timeframe + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIMEFRAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTimeframe() { + return timeframe; + } + + public void setTimeframe(String timeframe) { + this.timeframe = timeframe; + } + + public ReportScheduleListResponseAttributes timezone(String timezone) { + this.timezone = timezone; + return this; + } + + /** + * The IANA time zone identifier the recurrence rule is evaluated in. + * + * @return timezone + */ + @JsonProperty(JSON_PROPERTY_TIMEZONE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTimezone() { + return timezone; + } + + public void setTimezone(String timezone) { + this.timezone = timezone; + } + + public ReportScheduleListResponseAttributes title(String title) { + this.title = title; + return this; + } + + /** + * The title of the report. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ReportScheduleListResponseAttributes + */ + @JsonAnySetter + public ReportScheduleListResponseAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ReportScheduleListResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportScheduleListResponseAttributes reportScheduleListResponseAttributes = + (ReportScheduleListResponseAttributes) o; + return Objects.equals(this.deliveryFormat, reportScheduleListResponseAttributes.deliveryFormat) + && Objects.equals(this.description, reportScheduleListResponseAttributes.description) + && Objects.equals(this.nextRecurrence, reportScheduleListResponseAttributes.nextRecurrence) + && Objects.equals(this.queryParams, reportScheduleListResponseAttributes.queryParams) + && Objects.equals(this.recipients, reportScheduleListResponseAttributes.recipients) + && Objects.equals(this.resourceId, reportScheduleListResponseAttributes.resourceId) + && Objects.equals(this.resourceType, reportScheduleListResponseAttributes.resourceType) + && Objects.equals(this.rrule, reportScheduleListResponseAttributes.rrule) + && Objects.equals(this.status, reportScheduleListResponseAttributes.status) + && Objects.equals( + this.templateVariables, reportScheduleListResponseAttributes.templateVariables) + && Objects.equals(this.timeframe, reportScheduleListResponseAttributes.timeframe) + && Objects.equals(this.timezone, reportScheduleListResponseAttributes.timezone) + && Objects.equals(this.title, reportScheduleListResponseAttributes.title) + && Objects.equals( + this.additionalProperties, reportScheduleListResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + deliveryFormat, + description, + nextRecurrence, + queryParams, + recipients, + resourceId, + resourceType, + rrule, + status, + templateVariables, + timeframe, + timezone, + title, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportScheduleListResponseAttributes {\n"); + sb.append(" deliveryFormat: ").append(toIndentedString(deliveryFormat)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" nextRecurrence: ").append(toIndentedString(nextRecurrence)).append("\n"); + sb.append(" queryParams: ").append(toIndentedString(queryParams)).append("\n"); + sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n"); + sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n"); + sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); + sb.append(" rrule: ").append(toIndentedString(rrule)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" templateVariables: ").append(toIndentedString(templateVariables)).append("\n"); + sb.append(" timeframe: ").append(toIndentedString(timeframe)).append("\n"); + sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponseData.java b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponseData.java new file mode 100644 index 00000000000..a9ec29a9348 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponseData.java @@ -0,0 +1,244 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The JSON:API data object representing a report schedule in a list response. */ +@JsonPropertyOrder({ + ReportScheduleListResponseData.JSON_PROPERTY_ATTRIBUTES, + ReportScheduleListResponseData.JSON_PROPERTY_ID, + ReportScheduleListResponseData.JSON_PROPERTY_RELATIONSHIPS, + ReportScheduleListResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReportScheduleListResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ReportScheduleListResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private ReportScheduleListResponseRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ReportScheduleType type; + + public ReportScheduleListResponseData() {} + + @JsonCreator + public ReportScheduleListResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ReportScheduleListResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_RELATIONSHIPS) + ReportScheduleListResponseRelationships relationships, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ReportScheduleType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ReportScheduleListResponseData attributes( + ReportScheduleListResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The configuration and derived state of a report schedule in a list response. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReportScheduleListResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ReportScheduleListResponseAttributes attributes) { + this.attributes = attributes; + } + + public ReportScheduleListResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the report schedule. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ReportScheduleListResponseData relationships( + ReportScheduleListResponseRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships for a report schedule in a list response. + * + * @return relationships + */ + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReportScheduleListResponseRelationships getRelationships() { + return relationships; + } + + public void setRelationships(ReportScheduleListResponseRelationships relationships) { + this.relationships = relationships; + } + + public ReportScheduleListResponseData type(ReportScheduleType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for report schedules. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReportScheduleType getType() { + return type; + } + + public void setType(ReportScheduleType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ReportScheduleListResponseData + */ + @JsonAnySetter + public ReportScheduleListResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ReportScheduleListResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportScheduleListResponseData reportScheduleListResponseData = + (ReportScheduleListResponseData) o; + return Objects.equals(this.attributes, reportScheduleListResponseData.attributes) + && Objects.equals(this.id, reportScheduleListResponseData.id) + && Objects.equals(this.relationships, reportScheduleListResponseData.relationships) + && Objects.equals(this.type, reportScheduleListResponseData.type) + && Objects.equals( + this.additionalProperties, reportScheduleListResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportScheduleListResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponseLinks.java b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponseLinks.java new file mode 100644 index 00000000000..65bcfc18c75 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponseLinks.java @@ -0,0 +1,298 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Pagination links for navigating a report schedule list response. */ +@JsonPropertyOrder({ + ReportScheduleListResponseLinks.JSON_PROPERTY_FIRST, + ReportScheduleListResponseLinks.JSON_PROPERTY_LAST, + ReportScheduleListResponseLinks.JSON_PROPERTY_NEXT, + ReportScheduleListResponseLinks.JSON_PROPERTY_PREV, + ReportScheduleListResponseLinks.JSON_PROPERTY_SELF +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReportScheduleListResponseLinks { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIRST = "first"; + private JsonNullable first = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_LAST = "last"; + private JsonNullable last = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_NEXT = "next"; + private JsonNullable next = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_PREV = "prev"; + private JsonNullable prev = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SELF = "self"; + private JsonNullable self = JsonNullable.undefined(); + + public ReportScheduleListResponseLinks first(String first) { + this.first = JsonNullable.of(first); + return this; + } + + /** + * Link to the first page. + * + * @return first + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getFirst() { + return first.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_FIRST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getFirst_JsonNullable() { + return first; + } + + @JsonProperty(JSON_PROPERTY_FIRST) + public void setFirst_JsonNullable(JsonNullable first) { + this.first = first; + } + + public void setFirst(String first) { + this.first = JsonNullable.of(first); + } + + public ReportScheduleListResponseLinks last(String last) { + this.last = JsonNullable.of(last); + return this; + } + + /** + * Link to the last page, or null if it is unavailable. + * + * @return last + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getLast() { + return last.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_LAST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getLast_JsonNullable() { + return last; + } + + @JsonProperty(JSON_PROPERTY_LAST) + public void setLast_JsonNullable(JsonNullable last) { + this.last = last; + } + + public void setLast(String last) { + this.last = JsonNullable.of(last); + } + + public ReportScheduleListResponseLinks next(String next) { + this.next = JsonNullable.of(next); + return this; + } + + /** + * Link to the next page, or null if it is unavailable. + * + * @return next + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getNext() { + return next.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getNext_JsonNullable() { + return next; + } + + @JsonProperty(JSON_PROPERTY_NEXT) + public void setNext_JsonNullable(JsonNullable next) { + this.next = next; + } + + public void setNext(String next) { + this.next = JsonNullable.of(next); + } + + public ReportScheduleListResponseLinks prev(String prev) { + this.prev = JsonNullable.of(prev); + return this; + } + + /** + * Link to the previous page, or null if it is unavailable. + * + * @return prev + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getPrev() { + return prev.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PREV) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getPrev_JsonNullable() { + return prev; + } + + @JsonProperty(JSON_PROPERTY_PREV) + public void setPrev_JsonNullable(JsonNullable prev) { + this.prev = prev; + } + + public void setPrev(String prev) { + this.prev = JsonNullable.of(prev); + } + + public ReportScheduleListResponseLinks self(String self) { + this.self = JsonNullable.of(self); + return this; + } + + /** + * Link to the current page. + * + * @return self + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getSelf() { + return self.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_SELF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getSelf_JsonNullable() { + return self; + } + + @JsonProperty(JSON_PROPERTY_SELF) + public void setSelf_JsonNullable(JsonNullable self) { + this.self = self; + } + + public void setSelf(String self) { + this.self = JsonNullable.of(self); + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ReportScheduleListResponseLinks + */ + @JsonAnySetter + public ReportScheduleListResponseLinks putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ReportScheduleListResponseLinks object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportScheduleListResponseLinks reportScheduleListResponseLinks = + (ReportScheduleListResponseLinks) o; + return Objects.equals(this.first, reportScheduleListResponseLinks.first) + && Objects.equals(this.last, reportScheduleListResponseLinks.last) + && Objects.equals(this.next, reportScheduleListResponseLinks.next) + && Objects.equals(this.prev, reportScheduleListResponseLinks.prev) + && Objects.equals(this.self, reportScheduleListResponseLinks.self) + && Objects.equals( + this.additionalProperties, reportScheduleListResponseLinks.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(first, last, next, prev, self, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportScheduleListResponseLinks {\n"); + sb.append(" first: ").append(toIndentedString(first)).append("\n"); + sb.append(" last: ").append(toIndentedString(last)).append("\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append(" prev: ").append(toIndentedString(prev)).append("\n"); + sb.append(" self: ").append(toIndentedString(self)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponseMeta.java new file mode 100644 index 00000000000..9016bdcafa6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponseMeta.java @@ -0,0 +1,139 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Metadata for a paginated report schedule list response. */ +@JsonPropertyOrder({ReportScheduleListResponseMeta.JSON_PROPERTY_PAGINATION}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReportScheduleListResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PAGINATION = "pagination"; + private ReportScheduleListResponsePagination pagination; + + public ReportScheduleListResponseMeta pagination( + ReportScheduleListResponsePagination pagination) { + this.pagination = pagination; + this.unparsed |= pagination.unparsed; + return this; + } + + /** + * Offset and limit pagination metadata for a report schedule list response. + * + * @return pagination + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGINATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ReportScheduleListResponsePagination getPagination() { + return pagination; + } + + public void setPagination(ReportScheduleListResponsePagination pagination) { + this.pagination = pagination; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ReportScheduleListResponseMeta + */ + @JsonAnySetter + public ReportScheduleListResponseMeta putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ReportScheduleListResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportScheduleListResponseMeta reportScheduleListResponseMeta = + (ReportScheduleListResponseMeta) o; + return Objects.equals(this.pagination, reportScheduleListResponseMeta.pagination) + && Objects.equals( + this.additionalProperties, reportScheduleListResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pagination, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportScheduleListResponseMeta {\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponsePagination.java b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponsePagination.java new file mode 100644 index 00000000000..a375a350158 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponsePagination.java @@ -0,0 +1,352 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Offset and limit pagination metadata for a report schedule list response. */ +@JsonPropertyOrder({ + ReportScheduleListResponsePagination.JSON_PROPERTY_FIRST_OFFSET, + ReportScheduleListResponsePagination.JSON_PROPERTY_LAST_OFFSET, + ReportScheduleListResponsePagination.JSON_PROPERTY_LIMIT, + ReportScheduleListResponsePagination.JSON_PROPERTY_NEXT_OFFSET, + ReportScheduleListResponsePagination.JSON_PROPERTY_OFFSET, + ReportScheduleListResponsePagination.JSON_PROPERTY_PREV_OFFSET, + ReportScheduleListResponsePagination.JSON_PROPERTY_TOTAL, + ReportScheduleListResponsePagination.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReportScheduleListResponsePagination { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIRST_OFFSET = "first_offset"; + private Long firstOffset; + + public static final String JSON_PROPERTY_LAST_OFFSET = "last_offset"; + private JsonNullable lastOffset = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_LIMIT = "limit"; + private Long limit; + + public static final String JSON_PROPERTY_NEXT_OFFSET = "next_offset"; + private Long nextOffset; + + public static final String JSON_PROPERTY_OFFSET = "offset"; + private Long offset; + + public static final String JSON_PROPERTY_PREV_OFFSET = "prev_offset"; + private Long prevOffset; + + public static final String JSON_PROPERTY_TOTAL = "total"; + private Long total; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ReportScheduleListResponsePaginationType type; + + public ReportScheduleListResponsePagination firstOffset(Long firstOffset) { + this.firstOffset = firstOffset; + return this; + } + + /** + * The first offset. + * + * @return firstOffset + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIRST_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getFirstOffset() { + return firstOffset; + } + + public void setFirstOffset(Long firstOffset) { + this.firstOffset = firstOffset; + } + + public ReportScheduleListResponsePagination lastOffset(Long lastOffset) { + this.lastOffset = JsonNullable.of(lastOffset); + return this; + } + + /** + * The last offset when the total count is known, or null if it is unavailable. + * + * @return lastOffset + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getLastOffset() { + return lastOffset.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_LAST_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getLastOffset_JsonNullable() { + return lastOffset; + } + + @JsonProperty(JSON_PROPERTY_LAST_OFFSET) + public void setLastOffset_JsonNullable(JsonNullable lastOffset) { + this.lastOffset = lastOffset; + } + + public void setLastOffset(Long lastOffset) { + this.lastOffset = JsonNullable.of(lastOffset); + } + + public ReportScheduleListResponsePagination limit(Long limit) { + this.limit = limit; + return this; + } + + /** + * The maximum number of schedules returned. + * + * @return limit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getLimit() { + return limit; + } + + public void setLimit(Long limit) { + this.limit = limit; + } + + public ReportScheduleListResponsePagination nextOffset(Long nextOffset) { + this.nextOffset = nextOffset; + return this; + } + + /** + * The next offset. + * + * @return nextOffset + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NEXT_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getNextOffset() { + return nextOffset; + } + + public void setNextOffset(Long nextOffset) { + this.nextOffset = nextOffset; + } + + public ReportScheduleListResponsePagination offset(Long offset) { + this.offset = offset; + return this; + } + + /** + * The current offset. + * + * @return offset + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getOffset() { + return offset; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public ReportScheduleListResponsePagination prevOffset(Long prevOffset) { + this.prevOffset = prevOffset; + return this; + } + + /** + * The previous offset. + * + * @return prevOffset + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREV_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPrevOffset() { + return prevOffset; + } + + public void setPrevOffset(Long prevOffset) { + this.prevOffset = prevOffset; + } + + public ReportScheduleListResponsePagination total(Long total) { + this.total = total; + return this; + } + + /** + * The total number of matching schedules. + * + * @return total + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotal() { + return total; + } + + public void setTotal(Long total) { + this.total = total; + } + + public ReportScheduleListResponsePagination type(ReportScheduleListResponsePaginationType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The pagination type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ReportScheduleListResponsePaginationType getType() { + return type; + } + + public void setType(ReportScheduleListResponsePaginationType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ReportScheduleListResponsePagination + */ + @JsonAnySetter + public ReportScheduleListResponsePagination putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ReportScheduleListResponsePagination object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportScheduleListResponsePagination reportScheduleListResponsePagination = + (ReportScheduleListResponsePagination) o; + return Objects.equals(this.firstOffset, reportScheduleListResponsePagination.firstOffset) + && Objects.equals(this.lastOffset, reportScheduleListResponsePagination.lastOffset) + && Objects.equals(this.limit, reportScheduleListResponsePagination.limit) + && Objects.equals(this.nextOffset, reportScheduleListResponsePagination.nextOffset) + && Objects.equals(this.offset, reportScheduleListResponsePagination.offset) + && Objects.equals(this.prevOffset, reportScheduleListResponsePagination.prevOffset) + && Objects.equals(this.total, reportScheduleListResponsePagination.total) + && Objects.equals(this.type, reportScheduleListResponsePagination.type) + && Objects.equals( + this.additionalProperties, reportScheduleListResponsePagination.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + firstOffset, + lastOffset, + limit, + nextOffset, + offset, + prevOffset, + total, + type, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportScheduleListResponsePagination {\n"); + sb.append(" firstOffset: ").append(toIndentedString(firstOffset)).append("\n"); + sb.append(" lastOffset: ").append(toIndentedString(lastOffset)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" nextOffset: ").append(toIndentedString(nextOffset)).append("\n"); + sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); + sb.append(" prevOffset: ").append(toIndentedString(prevOffset)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponsePaginationType.java b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponsePaginationType.java new file mode 100644 index 00000000000..023ce83ab2f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponsePaginationType.java @@ -0,0 +1,63 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The pagination type. */ +@JsonSerialize( + using = + ReportScheduleListResponsePaginationType.ReportScheduleListResponsePaginationTypeSerializer + .class) +public class ReportScheduleListResponsePaginationType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("offset_limit")); + + public static final ReportScheduleListResponsePaginationType OFFSET_LIMIT = + new ReportScheduleListResponsePaginationType("offset_limit"); + + ReportScheduleListResponsePaginationType(String value) { + super(value, allowedValues); + } + + public static class ReportScheduleListResponsePaginationTypeSerializer + extends StdSerializer { + public ReportScheduleListResponsePaginationTypeSerializer( + Class t) { + super(t); + } + + public ReportScheduleListResponsePaginationTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ReportScheduleListResponsePaginationType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ReportScheduleListResponsePaginationType fromValue(String value) { + return new ReportScheduleListResponsePaginationType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponseRelationships.java b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponseRelationships.java new file mode 100644 index 00000000000..75e314d7fbf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleListResponseRelationships.java @@ -0,0 +1,180 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationships for a report schedule in a list response. */ +@JsonPropertyOrder({ + ReportScheduleListResponseRelationships.JSON_PROPERTY_AUTHOR, + ReportScheduleListResponseRelationships.JSON_PROPERTY_RESOURCE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReportScheduleListResponseRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTHOR = "author"; + private ReportScheduleAuthorRelationship author; + + public static final String JSON_PROPERTY_RESOURCE = "resource"; + private ReportScheduleListResourceRelationship resource; + + public ReportScheduleListResponseRelationships() {} + + @JsonCreator + public ReportScheduleListResponseRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_AUTHOR) + ReportScheduleAuthorRelationship author) { + this.author = author; + this.unparsed |= author.unparsed; + } + + public ReportScheduleListResponseRelationships author(ReportScheduleAuthorRelationship author) { + this.author = author; + this.unparsed |= author.unparsed; + return this; + } + + /** + * Relationship to the author of the report schedule. + * + * @return author + */ + @JsonProperty(JSON_PROPERTY_AUTHOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReportScheduleAuthorRelationship getAuthor() { + return author; + } + + public void setAuthor(ReportScheduleAuthorRelationship author) { + this.author = author; + } + + public ReportScheduleListResponseRelationships resource( + ReportScheduleListResourceRelationship resource) { + this.resource = resource; + this.unparsed |= resource.unparsed; + return this; + } + + /** + * Relationship to the report target resource. + * + * @return resource + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ReportScheduleListResourceRelationship getResource() { + return resource; + } + + public void setResource(ReportScheduleListResourceRelationship resource) { + this.resource = resource; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ReportScheduleListResponseRelationships + */ + @JsonAnySetter + public ReportScheduleListResponseRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ReportScheduleListResponseRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportScheduleListResponseRelationships reportScheduleListResponseRelationships = + (ReportScheduleListResponseRelationships) o; + return Objects.equals(this.author, reportScheduleListResponseRelationships.author) + && Objects.equals(this.resource, reportScheduleListResponseRelationships.resource) + && Objects.equals( + this.additionalProperties, + reportScheduleListResponseRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(author, resource, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportScheduleListResponseRelationships {\n"); + sb.append(" author: ").append(toIndentedString(author)).append("\n"); + sb.append(" resource: ").append(toIndentedString(resource)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReportScheduleQueryParameterValue.java b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleQueryParameterValue.java new file mode 100644 index 00000000000..d378293adb4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleQueryParameterValue.java @@ -0,0 +1,276 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize( + using = ReportScheduleQueryParameterValue.ReportScheduleQueryParameterValueDeserializer.class) +@JsonSerialize( + using = ReportScheduleQueryParameterValue.ReportScheduleQueryParameterValueSerializer.class) +public class ReportScheduleQueryParameterValue extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(ReportScheduleQueryParameterValue.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class ReportScheduleQueryParameterValueSerializer + extends StdSerializer { + public ReportScheduleQueryParameterValueSerializer(Class t) { + super(t); + } + + public ReportScheduleQueryParameterValueSerializer() { + this(null); + } + + @Override + public void serialize( + ReportScheduleQueryParameterValue value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class ReportScheduleQueryParameterValueDeserializer + extends StdDeserializer { + public ReportScheduleQueryParameterValueDeserializer() { + this(ReportScheduleQueryParameterValue.class); + } + + public ReportScheduleQueryParameterValueDeserializer(Class vc) { + super(vc); + } + + @Override + public ReportScheduleQueryParameterValue deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize String + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (String.class.equals(Integer.class) + || String.class.equals(Long.class) + || String.class.equals(Float.class) + || String.class.equals(Double.class) + || String.class.equals(Boolean.class) + || String.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((String.class.equals(Integer.class) || String.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((String.class.equals(Float.class) || String.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (String.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (String.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(String.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + deserialized = tmp; + match++; + + log.log(Level.FINER, "Input data matches schema 'String'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + // deserialize List + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (List.class.equals(Integer.class) + || List.class.equals(Long.class) + || List.class.equals(Float.class) + || List.class.equals(Double.class) + || List.class.equals(Boolean.class) + || List.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((List.class.equals(Integer.class) || List.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((List.class.equals(Float.class) || List.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (List.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (List.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + deserialized = tmp; + match++; + + log.log(Level.FINER, "Input data matches schema 'List'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'List'", e); + } + + ReportScheduleQueryParameterValue ret = new ReportScheduleQueryParameterValue(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public ReportScheduleQueryParameterValue getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "ReportScheduleQueryParameterValue cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public ReportScheduleQueryParameterValue() { + super("oneOf", Boolean.FALSE); + } + + public ReportScheduleQueryParameterValue(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public ReportScheduleQueryParameterValue(List o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", new GenericType() {}); + schemas.put("List", new GenericType>() {}); + JSON.registerDescendants( + ReportScheduleQueryParameterValue.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return ReportScheduleQueryParameterValue.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: String, List<String> + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(String.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(List.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException("Invalid instance type. Must be String, List"); + } + + /** + * Get the actual instance, which can be the following: String, List<String> + * + * @return The actual instance (String, List<String>) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String) super.getActualInstance(); + } + + /** + * Get the actual instance of `List<String>`. If the actual instance is not + * `List<String>`, the ClassCastException will be thrown. + * + * @return The actual instance of `List<String>` + * @throws ClassCastException if the instance is not `List<String>` + */ + public List getList() throws ClassCastException { + return (List) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReportScheduleResource.java b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleResource.java new file mode 100644 index 00000000000..c3e4731b07c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleResource.java @@ -0,0 +1,210 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A report target resource included as a related JSON:API resource. */ +@JsonPropertyOrder({ + ReportScheduleResource.JSON_PROPERTY_ATTRIBUTES, + ReportScheduleResource.JSON_PROPERTY_ID, + ReportScheduleResource.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReportScheduleResource { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ReportScheduleResourceAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ReportScheduleIncludedResourceType type; + + public ReportScheduleResource() {} + + @JsonCreator + public ReportScheduleResource( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ReportScheduleResourceAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ReportScheduleIncludedResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ReportScheduleResource attributes(ReportScheduleResourceAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an included report target resource. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReportScheduleResourceAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ReportScheduleResourceAttributes attributes) { + this.attributes = attributes; + } + + public ReportScheduleResource id(String id) { + this.id = id; + return this; + } + + /** + * The resource identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ReportScheduleResource type(ReportScheduleIncludedResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for an included report resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReportScheduleIncludedResourceType getType() { + return type; + } + + public void setType(ReportScheduleIncludedResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ReportScheduleResource + */ + @JsonAnySetter + public ReportScheduleResource putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ReportScheduleResource object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportScheduleResource reportScheduleResource = (ReportScheduleResource) o; + return Objects.equals(this.attributes, reportScheduleResource.attributes) + && Objects.equals(this.id, reportScheduleResource.id) + && Objects.equals(this.type, reportScheduleResource.type) + && Objects.equals(this.additionalProperties, reportScheduleResource.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportScheduleResource {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReportScheduleResourceAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleResourceAttributes.java new file mode 100644 index 00000000000..7a08565a1ac --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleResourceAttributes.java @@ -0,0 +1,251 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Attributes of an included report target resource. */ +@JsonPropertyOrder({ + ReportScheduleResourceAttributes.JSON_PROPERTY_RESOURCE_TYPE, + ReportScheduleResourceAttributes.JSON_PROPERTY_TEMPLATE_VARIABLES, + ReportScheduleResourceAttributes.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReportScheduleResourceAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RESOURCE_TYPE = "resource_type"; + private ReportScheduleResourceType resourceType; + + public static final String JSON_PROPERTY_TEMPLATE_VARIABLES = "template_variables"; + private JsonNullable> templateVariables = + JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_TITLE = "title"; + private JsonNullable title = JsonNullable.undefined(); + + public ReportScheduleResourceAttributes() {} + + @JsonCreator + public ReportScheduleResourceAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_RESOURCE_TYPE) + ReportScheduleResourceType resourceType) { + this.resourceType = resourceType; + this.unparsed |= !resourceType.isValid(); + } + + public ReportScheduleResourceAttributes resourceType(ReportScheduleResourceType resourceType) { + this.resourceType = resourceType; + this.unparsed |= !resourceType.isValid(); + return this; + } + + /** + * The type of dashboard resource the report schedule targets. + * + * @return resourceType + */ + @JsonProperty(JSON_PROPERTY_RESOURCE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReportScheduleResourceType getResourceType() { + return resourceType; + } + + public void setResourceType(ReportScheduleResourceType resourceType) { + if (!resourceType.isValid()) { + this.unparsed = true; + } + this.resourceType = resourceType; + } + + public ReportScheduleResourceAttributes templateVariables( + List templateVariables) { + this.templateVariables = + JsonNullable.>of(templateVariables); + return this; + } + + public ReportScheduleResourceAttributes addTemplateVariablesItem( + ReportScheduleIndexTemplateVariable templateVariablesItem) { + if (this.templateVariables == null || !this.templateVariables.isPresent()) { + this.templateVariables = + JsonNullable.>of(new ArrayList<>()); + } + try { + this.templateVariables.get().add(templateVariablesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Template variable metadata from the dashboard resource, when available. + * + * @return templateVariables + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getTemplateVariables() { + return templateVariables.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE_VARIABLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> + getTemplateVariables_JsonNullable() { + return templateVariables; + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE_VARIABLES) + public void setTemplateVariables_JsonNullable( + JsonNullable> templateVariables) { + this.templateVariables = templateVariables; + } + + public void setTemplateVariables(List templateVariables) { + this.templateVariables = + JsonNullable.>of(templateVariables); + } + + public ReportScheduleResourceAttributes title(String title) { + this.title = JsonNullable.of(title); + return this; + } + + /** + * The title of the dashboard or integration dashboard resource, when available. + * + * @return title + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getTitle() { + return title.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getTitle_JsonNullable() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + public void setTitle_JsonNullable(JsonNullable title) { + this.title = title; + } + + public void setTitle(String title) { + this.title = JsonNullable.of(title); + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ReportScheduleResourceAttributes + */ + @JsonAnySetter + public ReportScheduleResourceAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ReportScheduleResourceAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportScheduleResourceAttributes reportScheduleResourceAttributes = + (ReportScheduleResourceAttributes) o; + return Objects.equals(this.resourceType, reportScheduleResourceAttributes.resourceType) + && Objects.equals( + this.templateVariables, reportScheduleResourceAttributes.templateVariables) + && Objects.equals(this.title, reportScheduleResourceAttributes.title) + && Objects.equals( + this.additionalProperties, reportScheduleResourceAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(resourceType, templateVariables, title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportScheduleResourceAttributes {\n"); + sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); + sb.append(" templateVariables: ").append(toIndentedString(templateVariables)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReportScheduleToggleRequest.java b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleToggleRequest.java new file mode 100644 index 00000000000..4a2de15953f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleToggleRequest.java @@ -0,0 +1,147 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request body for toggling a report schedule. */ +@JsonPropertyOrder({ReportScheduleToggleRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReportScheduleToggleRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ReportScheduleToggleRequestData data; + + public ReportScheduleToggleRequest() {} + + @JsonCreator + public ReportScheduleToggleRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ReportScheduleToggleRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ReportScheduleToggleRequest data(ReportScheduleToggleRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The JSON:API data object for a report schedule toggle request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReportScheduleToggleRequestData getData() { + return data; + } + + public void setData(ReportScheduleToggleRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ReportScheduleToggleRequest + */ + @JsonAnySetter + public ReportScheduleToggleRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ReportScheduleToggleRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportScheduleToggleRequest reportScheduleToggleRequest = (ReportScheduleToggleRequest) o; + return Objects.equals(this.data, reportScheduleToggleRequest.data) + && Objects.equals( + this.additionalProperties, reportScheduleToggleRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportScheduleToggleRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReportScheduleToggleRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleToggleRequestAttributes.java new file mode 100644 index 00000000000..69193d37fe3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleToggleRequestAttributes.java @@ -0,0 +1,151 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The status to set on the report schedule. */ +@JsonPropertyOrder({ReportScheduleToggleRequestAttributes.JSON_PROPERTY_STATUS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReportScheduleToggleRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_STATUS = "status"; + private ReportScheduleStatus status; + + public ReportScheduleToggleRequestAttributes() {} + + @JsonCreator + public ReportScheduleToggleRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) ReportScheduleStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + } + + public ReportScheduleToggleRequestAttributes status(ReportScheduleStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * Whether the schedule is currently delivering reports (active) or paused ( + * inactive). + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReportScheduleStatus getStatus() { + return status; + } + + public void setStatus(ReportScheduleStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ReportScheduleToggleRequestAttributes + */ + @JsonAnySetter + public ReportScheduleToggleRequestAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ReportScheduleToggleRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportScheduleToggleRequestAttributes reportScheduleToggleRequestAttributes = + (ReportScheduleToggleRequestAttributes) o; + return Objects.equals(this.status, reportScheduleToggleRequestAttributes.status) + && Objects.equals( + this.additionalProperties, reportScheduleToggleRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportScheduleToggleRequestAttributes {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReportScheduleToggleRequestData.java b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleToggleRequestData.java new file mode 100644 index 00000000000..d7270924131 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReportScheduleToggleRequestData.java @@ -0,0 +1,184 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The JSON:API data object for a report schedule toggle request. */ +@JsonPropertyOrder({ + ReportScheduleToggleRequestData.JSON_PROPERTY_ATTRIBUTES, + ReportScheduleToggleRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReportScheduleToggleRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ReportScheduleToggleRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ReportScheduleType type; + + public ReportScheduleToggleRequestData() {} + + @JsonCreator + public ReportScheduleToggleRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ReportScheduleToggleRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ReportScheduleType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ReportScheduleToggleRequestData attributes( + ReportScheduleToggleRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The status to set on the report schedule. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReportScheduleToggleRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ReportScheduleToggleRequestAttributes attributes) { + this.attributes = attributes; + } + + public ReportScheduleToggleRequestData type(ReportScheduleType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for report schedules. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReportScheduleType getType() { + return type; + } + + public void setType(ReportScheduleType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ReportScheduleToggleRequestData + */ + @JsonAnySetter + public ReportScheduleToggleRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ReportScheduleToggleRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportScheduleToggleRequestData reportScheduleToggleRequestData = + (ReportScheduleToggleRequestData) o; + return Objects.equals(this.attributes, reportScheduleToggleRequestData.attributes) + && Objects.equals(this.type, reportScheduleToggleRequestData.type) + && Objects.equals( + this.additionalProperties, reportScheduleToggleRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportScheduleToggleRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RunDataObservabilityMonitorResponse.java b/src/main/java/com/datadog/api/client/v2/model/RunDataObservabilityMonitorResponse.java new file mode 100644 index 00000000000..9b67c53f70e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RunDataObservabilityMonitorResponse.java @@ -0,0 +1,148 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The response returned when a data observability monitor run is triggered. */ +@JsonPropertyOrder({RunDataObservabilityMonitorResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RunDataObservabilityMonitorResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RunDataObservabilityMonitorResponseData data; + + public RunDataObservabilityMonitorResponse() {} + + @JsonCreator + public RunDataObservabilityMonitorResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + RunDataObservabilityMonitorResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public RunDataObservabilityMonitorResponse data(RunDataObservabilityMonitorResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The data object returned when a data observability monitor run is triggered. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RunDataObservabilityMonitorResponseData getData() { + return data; + } + + public void setData(RunDataObservabilityMonitorResponseData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RunDataObservabilityMonitorResponse + */ + @JsonAnySetter + public RunDataObservabilityMonitorResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RunDataObservabilityMonitorResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunDataObservabilityMonitorResponse runDataObservabilityMonitorResponse = + (RunDataObservabilityMonitorResponse) o; + return Objects.equals(this.data, runDataObservabilityMonitorResponse.data) + && Objects.equals( + this.additionalProperties, runDataObservabilityMonitorResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunDataObservabilityMonitorResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RunDataObservabilityMonitorResponseData.java b/src/main/java/com/datadog/api/client/v2/model/RunDataObservabilityMonitorResponseData.java new file mode 100644 index 00000000000..afcb4dc3ca7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RunDataObservabilityMonitorResponseData.java @@ -0,0 +1,182 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The data object returned when a data observability monitor run is triggered. */ +@JsonPropertyOrder({ + RunDataObservabilityMonitorResponseData.JSON_PROPERTY_ID, + RunDataObservabilityMonitorResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RunDataObservabilityMonitorResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DataObservabilityMonitorRunType type = DataObservabilityMonitorRunType.MONITOR_RUN; + + public RunDataObservabilityMonitorResponseData() {} + + @JsonCreator + public RunDataObservabilityMonitorResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + DataObservabilityMonitorRunType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public RunDataObservabilityMonitorResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the monitor run. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public RunDataObservabilityMonitorResponseData type(DataObservabilityMonitorRunType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API resource type for a data observability monitor run. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DataObservabilityMonitorRunType getType() { + return type; + } + + public void setType(DataObservabilityMonitorRunType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RunDataObservabilityMonitorResponseData + */ + @JsonAnySetter + public RunDataObservabilityMonitorResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RunDataObservabilityMonitorResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunDataObservabilityMonitorResponseData runDataObservabilityMonitorResponseData = + (RunDataObservabilityMonitorResponseData) o; + return Objects.equals(this.id, runDataObservabilityMonitorResponseData.id) + && Objects.equals(this.type, runDataObservabilityMonitorResponseData.type) + && Objects.equals( + this.additionalProperties, + runDataObservabilityMonitorResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunDataObservabilityMonitorResponseData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/report_schedules.feature b/src/test/resources/com/datadog/api/client/v2/api/report_schedules.feature index 7d2ffafbc65..aa62a5e3506 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/report_schedules.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/report_schedules.feature @@ -13,7 +13,7 @@ Feature: Report Schedules Scenario: Create a report schedule returns "Bad Request" response Given operation "CreateReportSchedule" enabled And new "CreateReportSchedule" request - And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Weekly summary of infrastructure health.", "recipients": ["user@example.com", "slack:T01234567.C01234567.alerts", "teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2"], "resource_id": "abc-def-ghi", "resource_type": "dashboard", "rrule": "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0", "tab_id": "66666666-7777-8888-9999-000000000000", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "calendar_month", "timezone": "America/New_York", "title": "Weekly Infrastructure Report"}, "type": "schedule"}} + And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Weekly summary of infrastructure health.", "recipients": ["user@example.com", "slack:T01234567.C01234567.alerts", "teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2"], "resource_id": "abc-def-ghi", "resource_type": "dashboard", "rrule": "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0", "tab_id": "66666666-7777-8888-9999-000000000000", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "1w", "timezone": "America/New_York", "title": "Weekly Infrastructure Report"}, "type": "schedule"}} When the request is sent Then the response status is 400 Bad Request @@ -21,7 +21,7 @@ Feature: Report Schedules Scenario: Create a report schedule returns "CREATED" response Given operation "CreateReportSchedule" enabled And new "CreateReportSchedule" request - And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Weekly summary of infrastructure health.", "recipients": ["user@example.com", "slack:T01234567.C01234567.alerts", "teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2"], "resource_id": "abc-def-ghi", "resource_type": "dashboard", "rrule": "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0", "tab_id": "66666666-7777-8888-9999-000000000000", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "calendar_month", "timezone": "America/New_York", "title": "Weekly Infrastructure Report"}, "type": "schedule"}} + And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Weekly summary of infrastructure health.", "recipients": ["user@example.com", "slack:T01234567.C01234567.alerts", "teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2"], "resource_id": "abc-def-ghi", "resource_type": "dashboard", "rrule": "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0", "tab_id": "66666666-7777-8888-9999-000000000000", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "1w", "timezone": "America/New_York", "title": "Weekly Infrastructure Report"}, "type": "schedule"}} When the request is sent Then the response status is 201 CREATED @@ -29,16 +29,124 @@ Feature: Report Schedules Scenario: Create a report schedule returns "Not Found" response Given operation "CreateReportSchedule" enabled And new "CreateReportSchedule" request - And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Weekly summary of infrastructure health.", "recipients": ["user@example.com", "slack:T01234567.C01234567.alerts", "teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2"], "resource_id": "abc-def-ghi", "resource_type": "dashboard", "rrule": "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0", "tab_id": "66666666-7777-8888-9999-000000000000", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "calendar_month", "timezone": "America/New_York", "title": "Weekly Infrastructure Report"}, "type": "schedule"}} + And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Weekly summary of infrastructure health.", "recipients": ["user@example.com", "slack:T01234567.C01234567.alerts", "teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2"], "resource_id": "abc-def-ghi", "resource_type": "dashboard", "rrule": "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0", "tab_id": "66666666-7777-8888-9999-000000000000", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "1w", "timezone": "America/New_York", "title": "Weekly Infrastructure Report"}, "type": "schedule"}} When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Delete a report schedule returns "Bad Request" response + Given new "DeleteReportSchedule" request + And request contains "schedule_uuid" 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: Delete a report schedule returns "Not Found" response + Given new "DeleteReportSchedule" request + And request contains "schedule_uuid" 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: Delete a report schedule returns "OK" response + Given new "DeleteReportSchedule" request + And request contains "schedule_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Get a report schedule returns "Bad Request" response + Given new "GetReportSchedule" request + And request contains "schedule_uuid" 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: Get a report schedule returns "Not Found" response + Given new "GetReportSchedule" request + And request contains "schedule_uuid" 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: Get a report schedule returns "OK" response + Given new "GetReportSchedule" request + And request contains "schedule_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Get report schedules for a resource returns "Bad Request" response + Given new "GetReportSchedulesForResource" request + And request contains "resource_type" parameter from "REPLACE.ME" + And request contains "resource_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: Get report schedules for a resource returns "Not Found" response + Given new "GetReportSchedulesForResource" request + And request contains "resource_type" parameter from "REPLACE.ME" + And request contains "resource_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: Get report schedules for a resource returns "OK" response + Given new "GetReportSchedulesForResource" request + And request contains "resource_type" parameter from "REPLACE.ME" + And request contains "resource_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 + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: List report schedules returns "Not Found" response + Given new "ListReportSchedules" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: List report schedules returns "OK" response + Given new "ListReportSchedules" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Toggle a report schedule returns "Bad Request" response + Given new "ToggleReportSchedule" request + And request contains "schedule_uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"status": "active"}, "type": "schedule"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Toggle a report schedule returns "Not Found" response + Given new "ToggleReportSchedule" request + And request contains "schedule_uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"status": "active"}, "type": "schedule"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Toggle a report schedule returns "OK" response + Given new "ToggleReportSchedule" request + And request contains "schedule_uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"status": "active"}, "type": "schedule"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/reporting-and-sharing Scenario: Update a report schedule returns "Bad Request" response Given operation "PatchReportSchedule" enabled And new "PatchReportSchedule" request And request contains "schedule_uuid" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Updated weekly summary of infrastructure health.", "recipients": ["user@example.com", "slack:T01234567.C01234567.alerts", "teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2"], "rrule": "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0", "tab_id": "66666666-7777-8888-9999-000000000000", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "calendar_month", "timezone": "America/New_York", "title": "Weekly Infrastructure Report"}, "type": "schedule"}} + And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Updated weekly summary of infrastructure health.", "recipients": ["user@example.com", "slack:T01234567.C01234567.alerts", "teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2"], "rrule": "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0", "tab_id": "66666666-7777-8888-9999-000000000000", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "1w", "timezone": "America/New_York", "title": "Weekly Infrastructure Report"}, "type": "schedule"}} When the request is sent Then the response status is 400 Bad Request @@ -47,7 +155,7 @@ Feature: Report Schedules Given operation "PatchReportSchedule" enabled And new "PatchReportSchedule" request And request contains "schedule_uuid" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Updated weekly summary of infrastructure health.", "recipients": ["user@example.com", "slack:T01234567.C01234567.alerts", "teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2"], "rrule": "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0", "tab_id": "66666666-7777-8888-9999-000000000000", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "calendar_month", "timezone": "America/New_York", "title": "Weekly Infrastructure Report"}, "type": "schedule"}} + And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Updated weekly summary of infrastructure health.", "recipients": ["user@example.com", "slack:T01234567.C01234567.alerts", "teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2"], "rrule": "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0", "tab_id": "66666666-7777-8888-9999-000000000000", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "1w", "timezone": "America/New_York", "title": "Weekly Infrastructure Report"}, "type": "schedule"}} When the request is sent Then the response status is 404 Not Found @@ -56,6 +164,6 @@ Feature: Report Schedules Given operation "PatchReportSchedule" enabled And new "PatchReportSchedule" request And request contains "schedule_uuid" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Updated weekly summary of infrastructure health.", "recipients": ["user@example.com", "slack:T01234567.C01234567.alerts", "teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2"], "rrule": "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0", "tab_id": "66666666-7777-8888-9999-000000000000", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "calendar_month", "timezone": "America/New_York", "title": "Weekly Infrastructure Report"}, "type": "schedule"}} + And body with value {"data": {"attributes": {"delivery_format": "pdf", "description": "Updated weekly summary of infrastructure health.", "recipients": ["user@example.com", "slack:T01234567.C01234567.alerts", "teams:11111111-1111-1111-1111-111111111111|22222222-2222-2222-2222-222222222222|19:exampleChannelId@thread.tacv2"], "rrule": "DTSTART;TZID=America/New_York:20260601T090000\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0", "tab_id": "66666666-7777-8888-9999-000000000000", "template_variables": [{"name": "env", "values": ["prod"]}], "timeframe": "1w", "timezone": "America/New_York", "title": "Weekly Infrastructure Report"}, "type": "schedule"}} When the request is sent Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 54f20db6460..290854cf08d 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -6274,9 +6274,40 @@ "CreateReportSchedule": { "tag": "Report Schedules", "undo": { + "operationId": "DeleteReportSchedule", + "parameters": [ + { + "name": "schedule_uuid", + "source": "data.id" + } + ], "type": "unsafe" } }, + "ListReportSchedules": { + "tag": "Report Schedules", + "undo": { + "type": "safe" + } + }, + "GetReportSchedulesForResource": { + "tag": "Report Schedules", + "undo": { + "type": "safe" + } + }, + "DeleteReportSchedule": { + "tag": "Report Schedules", + "undo": { + "type": "idempotent" + } + }, + "GetReportSchedule": { + "tag": "Report Schedules", + "undo": { + "type": "safe" + } + }, "PatchReportSchedule": { "tag": "Report Schedules", "undo": { @@ -6284,6 +6315,13 @@ "type": "idempotent" } }, + "ToggleReportSchedule": { + "tag": "Report Schedules", + "undo": { + "operationId": "ToggleReportSchedule", + "type": "idempotent" + } + }, "DeleteRestrictionPolicy": { "tag": "Restriction Policies", "undo": {