From 4f8525f43fb7d2a45acb9021f44ba90b90ecbb7f Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 25 Jun 2026 09:59:09 +0000 Subject: [PATCH] Regenerate client from commit cc0b353 of spec repo --- .generator/schemas/v2/openapi.yaml | 797 ++++++++++++++- .../report-schedules/CreateReportSchedule.ts | 2 +- .../report-schedules/DeleteReportSchedule.ts | 21 + .../v2/report-schedules/GetReportSchedule.ts | 21 + .../GetReportSchedulesForResource.ts | 22 + .../report-schedules/ListReportSchedules.ts | 17 + .../report-schedules/PatchReportSchedule.ts | 2 +- .../report-schedules/ToggleReportSchedule.ts | 29 + features/support/scenarios_model_mapping.ts | 59 ++ features/v2/report_schedules.feature | 120 ++- features/v2/undo.json | 38 + .../apis/ReportSchedulesApi.ts | 911 +++++++++++++++++- packages/datadog-api-client-v2/index.ts | 22 + .../models/ObjectSerializer.ts | 40 +- .../models/ReportScheduleIncludedResource.ts | 2 + .../ReportScheduleIncludedResourceType.ts | 16 + .../ReportScheduleIndexTemplateVariable.ts | 76 ++ .../ReportScheduleListResourceRelationship.ts | 54 ++ ...ortScheduleListResourceRelationshipData.ts | 63 ++ .../models/ReportScheduleListResponse.ts | 81 ++ .../ReportScheduleListResponseAttributes.ts | 156 +++ .../models/ReportScheduleListResponseData.ts | 83 ++ .../models/ReportScheduleListResponseLinks.ts | 84 ++ .../models/ReportScheduleListResponseMeta.ts | 53 + .../ReportScheduleListResponsePagination.ts | 116 +++ ...eportScheduleListResponsePaginationType.ts | 16 + ...ReportScheduleListResponseRelationships.ts | 63 ++ .../models/ReportScheduleResource.ts | 73 ++ .../ReportScheduleResourceAttributes.ts | 71 ++ .../models/ReportScheduleToggleRequest.ts | 54 ++ .../ReportScheduleToggleRequestAttributes.ts | 54 ++ .../models/ReportScheduleToggleRequestData.ts | 64 ++ 32 files changed, 3232 insertions(+), 48 deletions(-) create mode 100644 examples/v2/report-schedules/DeleteReportSchedule.ts create mode 100644 examples/v2/report-schedules/GetReportSchedule.ts create mode 100644 examples/v2/report-schedules/GetReportSchedulesForResource.ts create mode 100644 examples/v2/report-schedules/ListReportSchedules.ts create mode 100644 examples/v2/report-schedules/ToggleReportSchedule.ts create mode 100644 packages/datadog-api-client-v2/models/ReportScheduleIncludedResourceType.ts create mode 100644 packages/datadog-api-client-v2/models/ReportScheduleIndexTemplateVariable.ts create mode 100644 packages/datadog-api-client-v2/models/ReportScheduleListResourceRelationship.ts create mode 100644 packages/datadog-api-client-v2/models/ReportScheduleListResourceRelationshipData.ts create mode 100644 packages/datadog-api-client-v2/models/ReportScheduleListResponse.ts create mode 100644 packages/datadog-api-client-v2/models/ReportScheduleListResponseAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/ReportScheduleListResponseData.ts create mode 100644 packages/datadog-api-client-v2/models/ReportScheduleListResponseLinks.ts create mode 100644 packages/datadog-api-client-v2/models/ReportScheduleListResponseMeta.ts create mode 100644 packages/datadog-api-client-v2/models/ReportScheduleListResponsePagination.ts create mode 100644 packages/datadog-api-client-v2/models/ReportScheduleListResponsePaginationType.ts create mode 100644 packages/datadog-api-client-v2/models/ReportScheduleListResponseRelationships.ts create mode 100644 packages/datadog-api-client-v2/models/ReportScheduleResource.ts create mode 100644 packages/datadog-api-client-v2/models/ReportScheduleResourceAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/ReportScheduleToggleRequest.ts create mode 100644 packages/datadog-api-client-v2/models/ReportScheduleToggleRequestAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/ReportScheduleToggleRequestData.ts diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4dd4eb9c3140..979c2d661e97 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -78126,7 +78126,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. @@ -78178,6 +78178,269 @@ 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 + 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 + - 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: @@ -78227,7 +78490,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. @@ -78259,6 +78522,41 @@ components: - type - attributes type: object + 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: @@ -78315,7 +78613,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" @@ -78425,6 +78723,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: @@ -165095,7 +165420,384 @@ 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 + 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: "66666666-7777-8888-9999-000000000000" + 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: 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: inactive + tab_id: "66666666-7777-8888-9999-000000000000" + 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: "66666666-7777-8888-9999-000000000000" + 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 @@ -165209,6 +165911,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: 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: inactive + tab_id: "66666666-7777-8888-9999-000000000000" + 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. diff --git a/examples/v2/report-schedules/CreateReportSchedule.ts b/examples/v2/report-schedules/CreateReportSchedule.ts index 38f9869ac9f4..8b82108e2c35 100644 --- a/examples/v2/report-schedules/CreateReportSchedule.ts +++ b/examples/v2/report-schedules/CreateReportSchedule.ts @@ -30,7 +30,7 @@ const params: v2.ReportSchedulesApiCreateReportScheduleRequest = { values: ["prod"], }, ], - timeframe: "calendar_month", + timeframe: "1w", timezone: "America/New_York", title: "Weekly Infrastructure Report", }, diff --git a/examples/v2/report-schedules/DeleteReportSchedule.ts b/examples/v2/report-schedules/DeleteReportSchedule.ts new file mode 100644 index 000000000000..8f8079f536fd --- /dev/null +++ b/examples/v2/report-schedules/DeleteReportSchedule.ts @@ -0,0 +1,21 @@ +/** + * Delete a report schedule returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.ReportSchedulesApi(configuration); + +const params: v2.ReportSchedulesApiDeleteReportScheduleRequest = { + scheduleUuid: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", +}; + +apiInstance + .deleteReportSchedule(params) + .then((data: v2.ReportScheduleResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/report-schedules/GetReportSchedule.ts b/examples/v2/report-schedules/GetReportSchedule.ts new file mode 100644 index 000000000000..7451c3d467ca --- /dev/null +++ b/examples/v2/report-schedules/GetReportSchedule.ts @@ -0,0 +1,21 @@ +/** + * Get a report schedule returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.ReportSchedulesApi(configuration); + +const params: v2.ReportSchedulesApiGetReportScheduleRequest = { + scheduleUuid: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", +}; + +apiInstance + .getReportSchedule(params) + .then((data: v2.ReportScheduleResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/report-schedules/GetReportSchedulesForResource.ts b/examples/v2/report-schedules/GetReportSchedulesForResource.ts new file mode 100644 index 000000000000..ce47435f45b4 --- /dev/null +++ b/examples/v2/report-schedules/GetReportSchedulesForResource.ts @@ -0,0 +1,22 @@ +/** + * Get report schedules for a resource returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.ReportSchedulesApi(configuration); + +const params: v2.ReportSchedulesApiGetReportSchedulesForResourceRequest = { + resourceType: "dashboard", + resourceId: "resource_id", +}; + +apiInstance + .getReportSchedulesForResource(params) + .then((data: v2.ReportScheduleListResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/report-schedules/ListReportSchedules.ts b/examples/v2/report-schedules/ListReportSchedules.ts new file mode 100644 index 000000000000..2c626490cc70 --- /dev/null +++ b/examples/v2/report-schedules/ListReportSchedules.ts @@ -0,0 +1,17 @@ +/** + * List report schedules returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.ReportSchedulesApi(configuration); + +apiInstance + .listReportSchedules() + .then((data: v2.ReportScheduleListResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/report-schedules/PatchReportSchedule.ts b/examples/v2/report-schedules/PatchReportSchedule.ts index 59089a01f506..275cfffb9cc1 100644 --- a/examples/v2/report-schedules/PatchReportSchedule.ts +++ b/examples/v2/report-schedules/PatchReportSchedule.ts @@ -28,7 +28,7 @@ const params: v2.ReportSchedulesApiPatchReportScheduleRequest = { values: ["prod"], }, ], - timeframe: "calendar_month", + timeframe: "1w", timezone: "America/New_York", title: "Weekly Infrastructure Report", }, diff --git a/examples/v2/report-schedules/ToggleReportSchedule.ts b/examples/v2/report-schedules/ToggleReportSchedule.ts new file mode 100644 index 000000000000..e6c2f967ec84 --- /dev/null +++ b/examples/v2/report-schedules/ToggleReportSchedule.ts @@ -0,0 +1,29 @@ +/** + * Toggle a report schedule returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.ReportSchedulesApi(configuration); + +const params: v2.ReportSchedulesApiToggleReportScheduleRequest = { + body: { + data: { + attributes: { + status: "active", + }, + type: "schedule", + }, + }, + scheduleUuid: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", +}; + +apiInstance + .toggleReportSchedule(params) + .then((data: v2.ReportScheduleResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 22191bf53207..edc04970d8d5 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -13775,6 +13775,54 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "ReportScheduleResponse", }, + "v2.ListReportSchedules": { + "pageLimit": { + "type": "number", + "format": "int64", + }, + "pageOffset": { + "type": "number", + "format": "int64", + }, + "filterTitle": { + "type": "string", + "format": "", + }, + "filterAuthorUuid": { + "type": "string", + "format": "uuid", + }, + "filterRecipients": { + "type": "string", + "format": "", + }, + "operationResponseType": "ReportScheduleListResponse", + }, + "v2.GetReportSchedulesForResource": { + "resourceType": { + "type": "ReportScheduleResourceType", + "format": "", + }, + "resourceId": { + "type": "string", + "format": "", + }, + "operationResponseType": "ReportScheduleListResponse", + }, + "v2.GetReportSchedule": { + "scheduleUuid": { + "type": "string", + "format": "uuid", + }, + "operationResponseType": "ReportScheduleResponse", + }, + "v2.DeleteReportSchedule": { + "scheduleUuid": { + "type": "string", + "format": "uuid", + }, + "operationResponseType": "ReportScheduleResponse", + }, "v2.PatchReportSchedule": { "scheduleUuid": { "type": "string", @@ -13786,6 +13834,17 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "ReportScheduleResponse", }, + "v2.ToggleReportSchedule": { + "scheduleUuid": { + "type": "string", + "format": "uuid", + }, + "body": { + "type": "ReportScheduleToggleRequest", + "format": "", + }, + "operationResponseType": "ReportScheduleResponse", + }, "v2.GetRestrictionPolicy": { "resourceId": { "type": "string", diff --git a/features/v2/report_schedules.feature b/features/v2/report_schedules.feature index 7d2ffafbc65b..aa62a5e35063 100644 --- a/features/v2/report_schedules.feature +++ b/features/v2/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/features/v2/undo.json b/features/v2/undo.json index 22dc7ad77fe4..c07e3792ac55 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -6396,9 +6396,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": { @@ -6406,6 +6437,13 @@ "type": "idempotent" } }, + "ToggleReportSchedule": { + "tag": "Report Schedules", + "undo": { + "operationId": "ToggleReportSchedule", + "type": "idempotent" + } + }, "DeleteRestrictionPolicy": { "tag": "Restriction Policies", "undo": { diff --git a/packages/datadog-api-client-v2/apis/ReportSchedulesApi.ts b/packages/datadog-api-client-v2/apis/ReportSchedulesApi.ts index da10b0c229fd..db375d753fcc 100644 --- a/packages/datadog-api-client-v2/apis/ReportSchedulesApi.ts +++ b/packages/datadog-api-client-v2/apis/ReportSchedulesApi.ts @@ -19,8 +19,11 @@ import { ApiException } from "../../datadog-api-client-common/exception"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { JSONAPIErrorResponse } from "../models/JSONAPIErrorResponse"; import { ReportScheduleCreateRequest } from "../models/ReportScheduleCreateRequest"; +import { ReportScheduleListResponse } from "../models/ReportScheduleListResponse"; import { ReportSchedulePatchRequest } from "../models/ReportSchedulePatchRequest"; +import { ReportScheduleResourceType } from "../models/ReportScheduleResourceType"; import { ReportScheduleResponse } from "../models/ReportScheduleResponse"; +import { ReportScheduleToggleRequest } from "../models/ReportScheduleToggleRequest"; export class ReportSchedulesApiRequestFactory extends BaseAPIRequestFactory { public async createReportSchedule( @@ -69,6 +72,177 @@ export class ReportSchedulesApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async deleteReportSchedule( + scheduleUuid: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'scheduleUuid' is not null or undefined + if (scheduleUuid === null || scheduleUuid === undefined) { + throw new RequiredError("scheduleUuid", "deleteReportSchedule"); + } + + // Path Params + const localVarPath = "/api/v2/reporting/schedule/{schedule_uuid}".replace( + "{schedule_uuid}", + encodeURIComponent(String(scheduleUuid)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.ReportSchedulesApi.deleteReportSchedule") + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getReportSchedule( + scheduleUuid: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'scheduleUuid' is not null or undefined + if (scheduleUuid === null || scheduleUuid === undefined) { + throw new RequiredError("scheduleUuid", "getReportSchedule"); + } + + // Path Params + const localVarPath = "/api/v2/reporting/schedule/{schedule_uuid}".replace( + "{schedule_uuid}", + encodeURIComponent(String(scheduleUuid)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.ReportSchedulesApi.getReportSchedule") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getReportSchedulesForResource( + resourceType: ReportScheduleResourceType, + resourceId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'resourceType' is not null or undefined + if (resourceType === null || resourceType === undefined) { + throw new RequiredError("resourceType", "getReportSchedulesForResource"); + } + + // verify required parameter 'resourceId' is not null or undefined + if (resourceId === null || resourceId === undefined) { + throw new RequiredError("resourceId", "getReportSchedulesForResource"); + } + + // Path Params + const localVarPath = + "/api/v2/reporting/schedule/{resource_type}/{resource_id}" + .replace("{resource_type}", encodeURIComponent(String(resourceType))) + .replace("{resource_id}", encodeURIComponent(String(resourceId))); + + // Make Request Context + const requestContext = _config + .getServer("v2.ReportSchedulesApi.getReportSchedulesForResource") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async listReportSchedules( + pageLimit?: number, + pageOffset?: number, + filterTitle?: string, + filterAuthorUuid?: string, + filterRecipients?: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // Path Params + const localVarPath = "/api/v2/reporting/schedule/list"; + + // Make Request Context + const requestContext = _config + .getServer("v2.ReportSchedulesApi.listReportSchedules") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (pageLimit !== undefined) { + requestContext.setQueryParam( + "page[limit]", + ObjectSerializer.serialize(pageLimit, "number", "int64"), + "" + ); + } + if (pageOffset !== undefined) { + requestContext.setQueryParam( + "page[offset]", + ObjectSerializer.serialize(pageOffset, "number", "int64"), + "" + ); + } + if (filterTitle !== undefined) { + requestContext.setQueryParam( + "filter[title]", + ObjectSerializer.serialize(filterTitle, "string", ""), + "" + ); + } + if (filterAuthorUuid !== undefined) { + requestContext.setQueryParam( + "filter[author_uuid]", + ObjectSerializer.serialize(filterAuthorUuid, "string", "uuid"), + "" + ); + } + if (filterRecipients !== undefined) { + requestContext.setQueryParam( + "filter[recipients]", + ObjectSerializer.serialize(filterRecipients, "string", ""), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async patchReportSchedule( scheduleUuid: string, body: ReportSchedulePatchRequest, @@ -86,60 +260,536 @@ export class ReportSchedulesApiRequestFactory extends BaseAPIRequestFactory { throw new RequiredError("scheduleUuid", "patchReportSchedule"); } - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError("body", "patchReportSchedule"); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "patchReportSchedule"); + } + + // Path Params + const localVarPath = "/api/v2/reporting/schedule/{schedule_uuid}".replace( + "{schedule_uuid}", + encodeURIComponent(String(scheduleUuid)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.ReportSchedulesApi.patchReportSchedule") + .makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "ReportSchedulePatchRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async toggleReportSchedule( + scheduleUuid: string, + body: ReportScheduleToggleRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'scheduleUuid' is not null or undefined + if (scheduleUuid === null || scheduleUuid === undefined) { + throw new RequiredError("scheduleUuid", "toggleReportSchedule"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "toggleReportSchedule"); + } + + // Path Params + const localVarPath = + "/api/v2/reporting/schedule/{schedule_uuid}/toggle".replace( + "{schedule_uuid}", + encodeURIComponent(String(scheduleUuid)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.ReportSchedulesApi.toggleReportSchedule") + .makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "ReportScheduleToggleRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } +} + +export class ReportSchedulesApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createReportSchedule + * @throws ApiException if the response code was not in [200, 299] + */ + public async createReportSchedule( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 201) { + const body: ReportScheduleResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ReportScheduleResponse" + ) as ReportScheduleResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ReportScheduleResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ReportScheduleResponse", + "" + ) as ReportScheduleResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteReportSchedule + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteReportSchedule( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: ReportScheduleResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ReportScheduleResponse" + ) as ReportScheduleResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ReportScheduleResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ReportScheduleResponse", + "" + ) as ReportScheduleResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getReportSchedule + * @throws ApiException if the response code was not in [200, 299] + */ + public async getReportSchedule( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: ReportScheduleResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ReportScheduleResponse" + ) as ReportScheduleResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ReportScheduleResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ReportScheduleResponse", + "" + ) as ReportScheduleResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getReportSchedulesForResource + * @throws ApiException if the response code was not in [200, 299] + */ + public async getReportSchedulesForResource( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: ReportScheduleListResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ReportScheduleListResponse" + ) as ReportScheduleListResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ReportScheduleListResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ReportScheduleListResponse", + "" + ) as ReportScheduleListResponse; + return body; } - // Path Params - const localVarPath = "/api/v2/reporting/schedule/{schedule_uuid}".replace( - "{schedule_uuid}", - encodeURIComponent(String(scheduleUuid)) + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' ); + } - // Make Request Context - const requestContext = _config - .getServer("v2.ReportSchedulesApi.patchReportSchedule") - .makeRequestContext(localVarPath, HttpMethod.PATCH); - requestContext.setHeaderParam("Accept", "application/json"); - requestContext.setHttpConfig(_config.httpConfig); - - // Body Params - const contentType = ObjectSerializer.getPreferredMediaType([ - "application/json", - ]); - requestContext.setHeaderParam("Content-Type", contentType); - const serializedBody = ObjectSerializer.stringify( - ObjectSerializer.serialize(body, "ReportSchedulePatchRequest", ""), - contentType + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listReportSchedules + * @throws ApiException if the response code was not in [200, 299] + */ + public async listReportSchedules( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] ); - requestContext.setBody(serializedBody); + if (response.httpStatusCode === 200) { + const body: ReportScheduleListResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ReportScheduleListResponse" + ) as ReportScheduleListResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } - // Apply auth methods - applySecurityAuthentication(_config, requestContext, [ - "apiKeyAuth", - "appKeyAuth", - ]); + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ReportScheduleListResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ReportScheduleListResponse", + "" + ) as ReportScheduleListResponse; + return body; + } - return requestContext; + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); } -} -export class ReportSchedulesApiResponseProcessor { /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to createReportSchedule + * @params response Response returned by the server for a request to patchReportSchedule * @throws ApiException if the response code was not in [200, 299] */ - public async createReportSchedule( + public async patchReportSchedule( response: ResponseContext ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (response.httpStatusCode === 201) { + if (response.httpStatusCode === 200) { const body: ReportScheduleResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "ReportScheduleResponse" @@ -215,10 +865,10 @@ export class ReportSchedulesApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to patchReportSchedule + * @params response Response returned by the server for a request to toggleReportSchedule * @throws ApiException if the response code was not in [200, 299] */ - public async patchReportSchedule( + public async toggleReportSchedule( response: ResponseContext ): Promise { const contentType = ObjectSerializer.normalizeMediaType( @@ -304,6 +954,63 @@ export interface ReportSchedulesApiCreateReportScheduleRequest { body: ReportScheduleCreateRequest; } +export interface ReportSchedulesApiDeleteReportScheduleRequest { + /** + * The unique identifier of the report schedule to delete. + * @type string + */ + scheduleUuid: string; +} + +export interface ReportSchedulesApiGetReportScheduleRequest { + /** + * The unique identifier of the report schedule to fetch. + * @type string + */ + scheduleUuid: string; +} + +export interface ReportSchedulesApiGetReportSchedulesForResourceRequest { + /** + * The type of resource to fetch report schedules for. + * @type ReportScheduleResourceType + */ + resourceType: ReportScheduleResourceType; + /** + * The identifier of the resource to fetch report schedules for. + * @type string + */ + resourceId: string; +} + +export interface ReportSchedulesApiListReportSchedulesRequest { + /** + * The maximum number of schedules to return. The maximum value is 50. + * @type number + */ + pageLimit?: number; + /** + * The offset from which to start returning schedules. + * @type number + */ + pageOffset?: number; + /** + * Filter schedules by report title. + * @type string + */ + filterTitle?: string; + /** + * Filter schedules by author UUID. + * @type string + */ + filterAuthorUuid?: string; + /** + * Filter schedules by a comma-separated list of recipients. + * @type string + */ + filterRecipients?: string; +} + export interface ReportSchedulesApiPatchReportScheduleRequest { /** * The unique identifier of the report schedule to update. @@ -316,6 +1023,18 @@ export interface ReportSchedulesApiPatchReportScheduleRequest { body: ReportSchedulePatchRequest; } +export interface ReportSchedulesApiToggleReportScheduleRequest { + /** + * The unique identifier of the report schedule to toggle. + * @type string + */ + scheduleUuid: string; + /** + * @type ReportScheduleToggleRequest + */ + body: ReportScheduleToggleRequest; +} + export class ReportSchedulesApi { private requestFactory: ReportSchedulesApiRequestFactory; private responseProcessor: ReportSchedulesApiResponseProcessor; @@ -357,6 +1076,103 @@ export class ReportSchedulesApi { }); } + /** + * 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 param The request object + */ + public deleteReportSchedule( + param: ReportSchedulesApiDeleteReportScheduleRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.deleteReportSchedule( + param.scheduleUuid, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteReportSchedule(responseContext); + }); + }); + } + + /** + * Get a report schedule by its unique identifier. + * Requires a reporting read permission appropriate to the targeted resource type. + * @param param The request object + */ + public getReportSchedule( + param: ReportSchedulesApiGetReportScheduleRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.getReportSchedule( + param.scheduleUuid, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getReportSchedule(responseContext); + }); + }); + } + + /** + * Get all report schedules that target a dashboard or integration dashboard resource. + * Requires a reporting read permission appropriate to the targeted resource type. + * @param param The request object + */ + public getReportSchedulesForResource( + param: ReportSchedulesApiGetReportSchedulesForResourceRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.getReportSchedulesForResource( + param.resourceType, + param.resourceId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getReportSchedulesForResource( + responseContext + ); + }); + }); + } + + /** + * 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 param The request object + */ + public listReportSchedules( + param: ReportSchedulesApiListReportSchedulesRequest = {}, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.listReportSchedules( + param.pageLimit, + param.pageOffset, + param.filterTitle, + param.filterAuthorUuid, + param.filterRecipients, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listReportSchedules(responseContext); + }); + }); + } + /** * Update an existing scheduled report by its identifier. The editable attributes * are replaced with the supplied values; the targeted resource (`resource_id` and @@ -381,4 +1197,27 @@ export class ReportSchedulesApi { }); }); } + + /** + * 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 param The request object + */ + public toggleReportSchedule( + param: ReportSchedulesApiToggleReportScheduleRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.toggleReportSchedule( + param.scheduleUuid, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.toggleReportSchedule(responseContext); + }); + }); + } } diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index ce9d4fb74f04..589eb6b176d4 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -1167,7 +1167,12 @@ export { export { ReportSchedulesApiCreateReportScheduleRequest, + ReportSchedulesApiDeleteReportScheduleRequest, + ReportSchedulesApiGetReportScheduleRequest, + ReportSchedulesApiGetReportSchedulesForResourceRequest, + ReportSchedulesApiListReportSchedulesRequest, ReportSchedulesApiPatchReportScheduleRequest, + ReportSchedulesApiToggleReportScheduleRequest, ReportSchedulesApi, } from "./apis/ReportSchedulesApi"; @@ -6440,9 +6445,23 @@ export { ReportScheduleCreateRequestAttributes } from "./models/ReportScheduleCr export { ReportScheduleCreateRequestData } from "./models/ReportScheduleCreateRequestData"; export { ReportScheduleDeliveryFormat } from "./models/ReportScheduleDeliveryFormat"; export { ReportScheduleIncludedResource } from "./models/ReportScheduleIncludedResource"; +export { ReportScheduleIncludedResourceType } from "./models/ReportScheduleIncludedResourceType"; +export { ReportScheduleIndexTemplateVariable } from "./models/ReportScheduleIndexTemplateVariable"; +export { ReportScheduleListResourceRelationship } from "./models/ReportScheduleListResourceRelationship"; +export { ReportScheduleListResourceRelationshipData } from "./models/ReportScheduleListResourceRelationshipData"; +export { ReportScheduleListResponse } from "./models/ReportScheduleListResponse"; +export { ReportScheduleListResponseAttributes } from "./models/ReportScheduleListResponseAttributes"; +export { ReportScheduleListResponseData } from "./models/ReportScheduleListResponseData"; +export { ReportScheduleListResponseLinks } from "./models/ReportScheduleListResponseLinks"; +export { ReportScheduleListResponseMeta } from "./models/ReportScheduleListResponseMeta"; +export { ReportScheduleListResponsePagination } from "./models/ReportScheduleListResponsePagination"; +export { ReportScheduleListResponsePaginationType } from "./models/ReportScheduleListResponsePaginationType"; +export { ReportScheduleListResponseRelationships } from "./models/ReportScheduleListResponseRelationships"; export { ReportSchedulePatchRequest } from "./models/ReportSchedulePatchRequest"; export { ReportSchedulePatchRequestAttributes } from "./models/ReportSchedulePatchRequestAttributes"; export { ReportSchedulePatchRequestData } from "./models/ReportSchedulePatchRequestData"; +export { ReportScheduleResource } from "./models/ReportScheduleResource"; +export { ReportScheduleResourceAttributes } from "./models/ReportScheduleResourceAttributes"; export { ReportScheduleResourceType } from "./models/ReportScheduleResourceType"; export { ReportScheduleResponse } from "./models/ReportScheduleResponse"; export { ReportScheduleResponseAttributes } from "./models/ReportScheduleResponseAttributes"; @@ -6451,6 +6470,9 @@ export { ReportScheduleResponseData } from "./models/ReportScheduleResponseData" export { ReportScheduleResponseRelationships } from "./models/ReportScheduleResponseRelationships"; export { ReportScheduleStatus } from "./models/ReportScheduleStatus"; export { ReportScheduleTemplateVariable } from "./models/ReportScheduleTemplateVariable"; +export { ReportScheduleToggleRequest } from "./models/ReportScheduleToggleRequest"; +export { ReportScheduleToggleRequestAttributes } from "./models/ReportScheduleToggleRequestAttributes"; +export { ReportScheduleToggleRequestData } from "./models/ReportScheduleToggleRequestData"; export { ReportScheduleType } from "./models/ReportScheduleType"; export { ResolveVulnerableSymbolsRequest } from "./models/ResolveVulnerableSymbolsRequest"; export { ResolveVulnerableSymbolsRequestData } from "./models/ResolveVulnerableSymbolsRequestData"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index a5e38af08788..bf1714953054 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -3615,14 +3615,29 @@ import { ReportScheduleAuthorRelationshipData } from "./ReportScheduleAuthorRela import { ReportScheduleCreateRequest } from "./ReportScheduleCreateRequest"; import { ReportScheduleCreateRequestAttributes } from "./ReportScheduleCreateRequestAttributes"; import { ReportScheduleCreateRequestData } from "./ReportScheduleCreateRequestData"; +import { ReportScheduleIndexTemplateVariable } from "./ReportScheduleIndexTemplateVariable"; +import { ReportScheduleListResourceRelationship } from "./ReportScheduleListResourceRelationship"; +import { ReportScheduleListResourceRelationshipData } from "./ReportScheduleListResourceRelationshipData"; +import { ReportScheduleListResponse } from "./ReportScheduleListResponse"; +import { ReportScheduleListResponseAttributes } from "./ReportScheduleListResponseAttributes"; +import { ReportScheduleListResponseData } from "./ReportScheduleListResponseData"; +import { ReportScheduleListResponseLinks } from "./ReportScheduleListResponseLinks"; +import { ReportScheduleListResponseMeta } from "./ReportScheduleListResponseMeta"; +import { ReportScheduleListResponsePagination } from "./ReportScheduleListResponsePagination"; +import { ReportScheduleListResponseRelationships } from "./ReportScheduleListResponseRelationships"; import { ReportSchedulePatchRequest } from "./ReportSchedulePatchRequest"; import { ReportSchedulePatchRequestAttributes } from "./ReportSchedulePatchRequestAttributes"; import { ReportSchedulePatchRequestData } from "./ReportSchedulePatchRequestData"; +import { ReportScheduleResource } from "./ReportScheduleResource"; +import { ReportScheduleResourceAttributes } from "./ReportScheduleResourceAttributes"; import { ReportScheduleResponse } from "./ReportScheduleResponse"; import { ReportScheduleResponseAttributes } from "./ReportScheduleResponseAttributes"; import { ReportScheduleResponseData } from "./ReportScheduleResponseData"; import { ReportScheduleResponseRelationships } from "./ReportScheduleResponseRelationships"; import { ReportScheduleTemplateVariable } from "./ReportScheduleTemplateVariable"; +import { ReportScheduleToggleRequest } from "./ReportScheduleToggleRequest"; +import { ReportScheduleToggleRequestAttributes } from "./ReportScheduleToggleRequestAttributes"; +import { ReportScheduleToggleRequestData } from "./ReportScheduleToggleRequestData"; import { ResolveVulnerableSymbolsRequest } from "./ResolveVulnerableSymbolsRequest"; import { ResolveVulnerableSymbolsRequestData } from "./ResolveVulnerableSymbolsRequestData"; import { ResolveVulnerableSymbolsRequestDataAttributes } from "./ResolveVulnerableSymbolsRequestDataAttributes"; @@ -7086,6 +7101,8 @@ const enumsMap: { [key: string]: any[] } = { ReorderRulesetResourceDataType: ["ruleset"], ReportScheduleAuthorType: ["users"], ReportScheduleDeliveryFormat: ["pdf", "png", "pdf_and_png"], + ReportScheduleIncludedResourceType: ["resource"], + ReportScheduleListResponsePaginationType: ["offset_limit"], ReportScheduleResourceType: ["dashboard", "integration_dashboard"], ReportScheduleResponseAttributesDeliveryFormat: ["pdf", "png", "pdf_and_png"], ReportScheduleStatus: ["active", "inactive"], @@ -12354,14 +12371,32 @@ const typeMap: { [index: string]: any } = { ReportScheduleCreateRequest: ReportScheduleCreateRequest, ReportScheduleCreateRequestAttributes: ReportScheduleCreateRequestAttributes, ReportScheduleCreateRequestData: ReportScheduleCreateRequestData, + ReportScheduleIndexTemplateVariable: ReportScheduleIndexTemplateVariable, + ReportScheduleListResourceRelationship: + ReportScheduleListResourceRelationship, + ReportScheduleListResourceRelationshipData: + ReportScheduleListResourceRelationshipData, + ReportScheduleListResponse: ReportScheduleListResponse, + ReportScheduleListResponseAttributes: ReportScheduleListResponseAttributes, + ReportScheduleListResponseData: ReportScheduleListResponseData, + ReportScheduleListResponseLinks: ReportScheduleListResponseLinks, + ReportScheduleListResponseMeta: ReportScheduleListResponseMeta, + ReportScheduleListResponsePagination: ReportScheduleListResponsePagination, + ReportScheduleListResponseRelationships: + ReportScheduleListResponseRelationships, ReportSchedulePatchRequest: ReportSchedulePatchRequest, ReportSchedulePatchRequestAttributes: ReportSchedulePatchRequestAttributes, ReportSchedulePatchRequestData: ReportSchedulePatchRequestData, + ReportScheduleResource: ReportScheduleResource, + ReportScheduleResourceAttributes: ReportScheduleResourceAttributes, ReportScheduleResponse: ReportScheduleResponse, ReportScheduleResponseAttributes: ReportScheduleResponseAttributes, ReportScheduleResponseData: ReportScheduleResponseData, ReportScheduleResponseRelationships: ReportScheduleResponseRelationships, ReportScheduleTemplateVariable: ReportScheduleTemplateVariable, + ReportScheduleToggleRequest: ReportScheduleToggleRequest, + ReportScheduleToggleRequestAttributes: ReportScheduleToggleRequestAttributes, + ReportScheduleToggleRequestData: ReportScheduleToggleRequestData, ResolveVulnerableSymbolsRequest: ResolveVulnerableSymbolsRequest, ResolveVulnerableSymbolsRequestData: ResolveVulnerableSymbolsRequestData, ResolveVulnerableSymbolsRequestDataAttributes: @@ -14792,7 +14827,10 @@ const oneOfMap: { [index: string]: string[] } = { ], RUMGroupByMissing: ["string", "number"], RUMGroupByTotal: ["boolean", "string", "number"], - ReportScheduleIncludedResource: ["ReportScheduleAuthor"], + ReportScheduleIncludedResource: [ + "ReportScheduleAuthor", + "ReportScheduleResource", + ], RestrictionQueryResponseIncludedItem: ["RestrictionQueryRole"], RoutingRuleAction: [ "SendSlackMessageAction", diff --git a/packages/datadog-api-client-v2/models/ReportScheduleIncludedResource.ts b/packages/datadog-api-client-v2/models/ReportScheduleIncludedResource.ts index 46de84d5b79b..f743e62fcee6 100644 --- a/packages/datadog-api-client-v2/models/ReportScheduleIncludedResource.ts +++ b/packages/datadog-api-client-v2/models/ReportScheduleIncludedResource.ts @@ -4,6 +4,7 @@ * Copyright 2020-Present Datadog, Inc. */ import { ReportScheduleAuthor } from "./ReportScheduleAuthor"; +import { ReportScheduleResource } from "./ReportScheduleResource"; import { UnparsedObject } from "../../datadog-api-client-common/util"; @@ -13,4 +14,5 @@ import { UnparsedObject } from "../../datadog-api-client-common/util"; export type ReportScheduleIncludedResource = | ReportScheduleAuthor + | ReportScheduleResource | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/ReportScheduleIncludedResourceType.ts b/packages/datadog-api-client-v2/models/ReportScheduleIncludedResourceType.ts new file mode 100644 index 000000000000..288a0e2ea4ab --- /dev/null +++ b/packages/datadog-api-client-v2/models/ReportScheduleIncludedResourceType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * JSON:API resource type for an included report resource. + */ + +export type ReportScheduleIncludedResourceType = + | typeof RESOURCE + | UnparsedObject; +export const RESOURCE = "resource"; diff --git a/packages/datadog-api-client-v2/models/ReportScheduleIndexTemplateVariable.ts b/packages/datadog-api-client-v2/models/ReportScheduleIndexTemplateVariable.ts new file mode 100644 index 000000000000..475bb88204a9 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ReportScheduleIndexTemplateVariable.ts @@ -0,0 +1,76 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Template variable metadata from a dashboard index. + */ +export class ReportScheduleIndexTemplateVariable { + /** + * Available values for the template variable. + */ + "availableValues"?: Array; + /** + * Default values for the template variable. + */ + "defaults"?: Array; + /** + * The template variable name. + */ + "name"?: string; + /** + * The tag prefix for the template variable, when available. + */ + "prefix"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + availableValues: { + baseName: "available_values", + type: "Array", + }, + defaults: { + baseName: "defaults", + type: "Array", + }, + name: { + baseName: "name", + type: "string", + }, + prefix: { + baseName: "prefix", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ReportScheduleIndexTemplateVariable.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ReportScheduleListResourceRelationship.ts b/packages/datadog-api-client-v2/models/ReportScheduleListResourceRelationship.ts new file mode 100644 index 000000000000..41755fde4059 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ReportScheduleListResourceRelationship.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ReportScheduleListResourceRelationshipData } from "./ReportScheduleListResourceRelationshipData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationship to the report target resource. + */ +export class ReportScheduleListResourceRelationship { + /** + * Relationship data for the report target resource. + */ + "data": ReportScheduleListResourceRelationshipData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "ReportScheduleListResourceRelationshipData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ReportScheduleListResourceRelationship.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ReportScheduleListResourceRelationshipData.ts b/packages/datadog-api-client-v2/models/ReportScheduleListResourceRelationshipData.ts new file mode 100644 index 000000000000..3b3403e520ac --- /dev/null +++ b/packages/datadog-api-client-v2/models/ReportScheduleListResourceRelationshipData.ts @@ -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 2020-Present Datadog, Inc. + */ +import { ReportScheduleIncludedResourceType } from "./ReportScheduleIncludedResourceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationship data for the report target resource. + */ +export class ReportScheduleListResourceRelationshipData { + /** + * The resource identifier. + */ + "id": string; + /** + * JSON:API resource type for an included report resource. + */ + "type": ReportScheduleIncludedResourceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "ReportScheduleIncludedResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ReportScheduleListResourceRelationshipData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ReportScheduleListResponse.ts b/packages/datadog-api-client-v2/models/ReportScheduleListResponse.ts new file mode 100644 index 000000000000..603b41f0faf1 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ReportScheduleListResponse.ts @@ -0,0 +1,81 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ReportScheduleIncludedResource } from "./ReportScheduleIncludedResource"; +import { ReportScheduleListResponseData } from "./ReportScheduleListResponseData"; +import { ReportScheduleListResponseLinks } from "./ReportScheduleListResponseLinks"; +import { ReportScheduleListResponseMeta } from "./ReportScheduleListResponseMeta"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing a list of report schedules. + */ +export class ReportScheduleListResponse { + /** + * The list of report schedules. + */ + "data": Array; + /** + * Related resources included with the report schedules, such as authors and rendered resources. + */ + "included"?: Array; + /** + * Pagination links for navigating a report schedule list response. + */ + "links"?: ReportScheduleListResponseLinks; + /** + * Metadata for a paginated report schedule list response. + */ + "meta"?: ReportScheduleListResponseMeta; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + included: { + baseName: "included", + type: "Array", + }, + links: { + baseName: "links", + type: "ReportScheduleListResponseLinks", + }, + meta: { + baseName: "meta", + type: "ReportScheduleListResponseMeta", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ReportScheduleListResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ReportScheduleListResponseAttributes.ts b/packages/datadog-api-client-v2/models/ReportScheduleListResponseAttributes.ts new file mode 100644 index 000000000000..b80974a94e70 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ReportScheduleListResponseAttributes.ts @@ -0,0 +1,156 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ReportScheduleResourceType } from "./ReportScheduleResourceType"; +import { ReportScheduleResponseAttributesDeliveryFormat } from "./ReportScheduleResponseAttributesDeliveryFormat"; +import { ReportScheduleStatus } from "./ReportScheduleStatus"; +import { ReportScheduleTemplateVariable } from "./ReportScheduleTemplateVariable"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The configuration and derived state of a report schedule in a list response. + */ +export class ReportScheduleListResponseAttributes { + /** + * The delivery format for dashboard report schedules, or `null` if not set. + */ + "deliveryFormat"?: ReportScheduleResponseAttributesDeliveryFormat; + /** + * The description of the report. + */ + "description": string; + /** + * The Unix timestamp, in milliseconds, of the next scheduled delivery, or `null` if none is scheduled. + */ + "nextRecurrence": number | null; + /** + * The recipients of the report (email addresses, Slack channel references, or Microsoft Teams channel references). + */ + "recipients": Array; + /** + * The identifier of the resource rendered in the report. + */ + "resourceId": string; + /** + * The type of dashboard resource the report schedule targets. + */ + "resourceType": ReportScheduleResourceType; + /** + * The recurrence rule for the schedule, expressed as an iCalendar `RRULE` string. + */ + "rrule": string; + /** + * Whether the schedule is currently delivering reports (`active`) or paused (`inactive`). + */ + "status": ReportScheduleStatus; + /** + * The dashboard template variables applied when rendering the report. + */ + "templateVariables": Array; + /** + * The relative timeframe of data included in the report, or `null` if not set. + */ + "timeframe": string | null; + /** + * The IANA time zone identifier the recurrence rule is evaluated in. + */ + "timezone": string; + /** + * The title of the report. + */ + "title": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + deliveryFormat: { + baseName: "delivery_format", + type: "ReportScheduleResponseAttributesDeliveryFormat", + }, + description: { + baseName: "description", + type: "string", + required: true, + }, + nextRecurrence: { + baseName: "next_recurrence", + type: "number", + required: true, + format: "int64", + }, + recipients: { + baseName: "recipients", + type: "Array", + required: true, + }, + resourceId: { + baseName: "resource_id", + type: "string", + required: true, + }, + resourceType: { + baseName: "resource_type", + type: "ReportScheduleResourceType", + required: true, + }, + rrule: { + baseName: "rrule", + type: "string", + required: true, + }, + status: { + baseName: "status", + type: "ReportScheduleStatus", + required: true, + }, + templateVariables: { + baseName: "template_variables", + type: "Array", + required: true, + }, + timeframe: { + baseName: "timeframe", + type: "string", + required: true, + }, + timezone: { + baseName: "timezone", + type: "string", + required: true, + }, + title: { + baseName: "title", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ReportScheduleListResponseAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ReportScheduleListResponseData.ts b/packages/datadog-api-client-v2/models/ReportScheduleListResponseData.ts new file mode 100644 index 000000000000..90451fe882c2 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ReportScheduleListResponseData.ts @@ -0,0 +1,83 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ReportScheduleListResponseAttributes } from "./ReportScheduleListResponseAttributes"; +import { ReportScheduleListResponseRelationships } from "./ReportScheduleListResponseRelationships"; +import { ReportScheduleType } from "./ReportScheduleType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The JSON:API data object representing a report schedule in a list response. + */ +export class ReportScheduleListResponseData { + /** + * The configuration and derived state of a report schedule in a list response. + */ + "attributes": ReportScheduleListResponseAttributes; + /** + * The unique identifier of the report schedule. + */ + "id": string; + /** + * Relationships for a report schedule in a list response. + */ + "relationships": ReportScheduleListResponseRelationships; + /** + * JSON:API resource type for report schedules. + */ + "type": ReportScheduleType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ReportScheduleListResponseAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + relationships: { + baseName: "relationships", + type: "ReportScheduleListResponseRelationships", + required: true, + }, + type: { + baseName: "type", + type: "ReportScheduleType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ReportScheduleListResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ReportScheduleListResponseLinks.ts b/packages/datadog-api-client-v2/models/ReportScheduleListResponseLinks.ts new file mode 100644 index 000000000000..fff7d6f8bc39 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ReportScheduleListResponseLinks.ts @@ -0,0 +1,84 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Pagination links for navigating a report schedule list response. + */ +export class ReportScheduleListResponseLinks { + /** + * Link to the first page. + */ + "first"?: string; + /** + * Link to the last page, or `null` if it is unavailable. + */ + "last"?: string; + /** + * Link to the next page, or `null` if it is unavailable. + */ + "next"?: string; + /** + * Link to the previous page, or `null` if it is unavailable. + */ + "prev"?: string; + /** + * Link to the current page. + */ + "self"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + first: { + baseName: "first", + type: "string", + }, + last: { + baseName: "last", + type: "string", + }, + next: { + baseName: "next", + type: "string", + }, + prev: { + baseName: "prev", + type: "string", + }, + self: { + baseName: "self", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ReportScheduleListResponseLinks.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ReportScheduleListResponseMeta.ts b/packages/datadog-api-client-v2/models/ReportScheduleListResponseMeta.ts new file mode 100644 index 000000000000..bdaef75d106f --- /dev/null +++ b/packages/datadog-api-client-v2/models/ReportScheduleListResponseMeta.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ReportScheduleListResponsePagination } from "./ReportScheduleListResponsePagination"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Metadata for a paginated report schedule list response. + */ +export class ReportScheduleListResponseMeta { + /** + * Offset and limit pagination metadata for a report schedule list response. + */ + "pagination"?: ReportScheduleListResponsePagination; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + pagination: { + baseName: "pagination", + type: "ReportScheduleListResponsePagination", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ReportScheduleListResponseMeta.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ReportScheduleListResponsePagination.ts b/packages/datadog-api-client-v2/models/ReportScheduleListResponsePagination.ts new file mode 100644 index 000000000000..b2b776051355 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ReportScheduleListResponsePagination.ts @@ -0,0 +1,116 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ReportScheduleListResponsePaginationType } from "./ReportScheduleListResponsePaginationType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Offset and limit pagination metadata for a report schedule list response. + */ +export class ReportScheduleListResponsePagination { + /** + * The first offset. + */ + "firstOffset"?: number; + /** + * The last offset when the total count is known, or `null` if it is unavailable. + */ + "lastOffset"?: number; + /** + * The maximum number of schedules returned. + */ + "limit"?: number; + /** + * The next offset. + */ + "nextOffset"?: number; + /** + * The current offset. + */ + "offset"?: number; + /** + * The previous offset. + */ + "prevOffset"?: number; + /** + * The total number of matching schedules. + */ + "total"?: number; + /** + * The pagination type. + */ + "type"?: ReportScheduleListResponsePaginationType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + firstOffset: { + baseName: "first_offset", + type: "number", + format: "int64", + }, + lastOffset: { + baseName: "last_offset", + type: "number", + format: "int64", + }, + limit: { + baseName: "limit", + type: "number", + format: "int64", + }, + nextOffset: { + baseName: "next_offset", + type: "number", + format: "int64", + }, + offset: { + baseName: "offset", + type: "number", + format: "int64", + }, + prevOffset: { + baseName: "prev_offset", + type: "number", + format: "int64", + }, + total: { + baseName: "total", + type: "number", + format: "int64", + }, + type: { + baseName: "type", + type: "ReportScheduleListResponsePaginationType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ReportScheduleListResponsePagination.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ReportScheduleListResponsePaginationType.ts b/packages/datadog-api-client-v2/models/ReportScheduleListResponsePaginationType.ts new file mode 100644 index 000000000000..c15617750cda --- /dev/null +++ b/packages/datadog-api-client-v2/models/ReportScheduleListResponsePaginationType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The pagination type. + */ + +export type ReportScheduleListResponsePaginationType = + | typeof OFFSET_LIMIT + | UnparsedObject; +export const OFFSET_LIMIT = "offset_limit"; diff --git a/packages/datadog-api-client-v2/models/ReportScheduleListResponseRelationships.ts b/packages/datadog-api-client-v2/models/ReportScheduleListResponseRelationships.ts new file mode 100644 index 000000000000..624d61193ad5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ReportScheduleListResponseRelationships.ts @@ -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 2020-Present Datadog, Inc. + */ +import { ReportScheduleAuthorRelationship } from "./ReportScheduleAuthorRelationship"; +import { ReportScheduleListResourceRelationship } from "./ReportScheduleListResourceRelationship"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationships for a report schedule in a list response. + */ +export class ReportScheduleListResponseRelationships { + /** + * Relationship to the author of the report schedule. + */ + "author": ReportScheduleAuthorRelationship; + /** + * Relationship to the report target resource. + */ + "resource"?: ReportScheduleListResourceRelationship; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + author: { + baseName: "author", + type: "ReportScheduleAuthorRelationship", + required: true, + }, + resource: { + baseName: "resource", + type: "ReportScheduleListResourceRelationship", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ReportScheduleListResponseRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ReportScheduleResource.ts b/packages/datadog-api-client-v2/models/ReportScheduleResource.ts new file mode 100644 index 000000000000..14950f4f2fd1 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ReportScheduleResource.ts @@ -0,0 +1,73 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ReportScheduleIncludedResourceType } from "./ReportScheduleIncludedResourceType"; +import { ReportScheduleResourceAttributes } from "./ReportScheduleResourceAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A report target resource included as a related JSON:API resource. + */ +export class ReportScheduleResource { + /** + * Attributes of an included report target resource. + */ + "attributes": ReportScheduleResourceAttributes; + /** + * The resource identifier. + */ + "id": string; + /** + * JSON:API resource type for an included report resource. + */ + "type": ReportScheduleIncludedResourceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ReportScheduleResourceAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "ReportScheduleIncludedResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ReportScheduleResource.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ReportScheduleResourceAttributes.ts b/packages/datadog-api-client-v2/models/ReportScheduleResourceAttributes.ts new file mode 100644 index 000000000000..be63d663b2d9 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ReportScheduleResourceAttributes.ts @@ -0,0 +1,71 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ReportScheduleIndexTemplateVariable } from "./ReportScheduleIndexTemplateVariable"; +import { ReportScheduleResourceType } from "./ReportScheduleResourceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of an included report target resource. + */ +export class ReportScheduleResourceAttributes { + /** + * The type of dashboard resource the report schedule targets. + */ + "resourceType": ReportScheduleResourceType; + /** + * Template variable metadata from the dashboard resource, when available. + */ + "templateVariables"?: Array; + /** + * The title of the dashboard or integration dashboard resource, when available. + */ + "title"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + resourceType: { + baseName: "resource_type", + type: "ReportScheduleResourceType", + required: true, + }, + templateVariables: { + baseName: "template_variables", + type: "Array", + }, + title: { + baseName: "title", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ReportScheduleResourceAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ReportScheduleToggleRequest.ts b/packages/datadog-api-client-v2/models/ReportScheduleToggleRequest.ts new file mode 100644 index 000000000000..8567ac219382 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ReportScheduleToggleRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ReportScheduleToggleRequestData } from "./ReportScheduleToggleRequestData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request body for toggling a report schedule. + */ +export class ReportScheduleToggleRequest { + /** + * The JSON:API data object for a report schedule toggle request. + */ + "data": ReportScheduleToggleRequestData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "ReportScheduleToggleRequestData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ReportScheduleToggleRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ReportScheduleToggleRequestAttributes.ts b/packages/datadog-api-client-v2/models/ReportScheduleToggleRequestAttributes.ts new file mode 100644 index 000000000000..55e27040f860 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ReportScheduleToggleRequestAttributes.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ReportScheduleStatus } from "./ReportScheduleStatus"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The status to set on the report schedule. + */ +export class ReportScheduleToggleRequestAttributes { + /** + * Whether the schedule is currently delivering reports (`active`) or paused (`inactive`). + */ + "status": ReportScheduleStatus; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + status: { + baseName: "status", + type: "ReportScheduleStatus", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ReportScheduleToggleRequestAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ReportScheduleToggleRequestData.ts b/packages/datadog-api-client-v2/models/ReportScheduleToggleRequestData.ts new file mode 100644 index 000000000000..f3468304edb9 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ReportScheduleToggleRequestData.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ReportScheduleToggleRequestAttributes } from "./ReportScheduleToggleRequestAttributes"; +import { ReportScheduleType } from "./ReportScheduleType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The JSON:API data object for a report schedule toggle request. + */ +export class ReportScheduleToggleRequestData { + /** + * The status to set on the report schedule. + */ + "attributes": ReportScheduleToggleRequestAttributes; + /** + * JSON:API resource type for report schedules. + */ + "type": ReportScheduleType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ReportScheduleToggleRequestAttributes", + required: true, + }, + type: { + baseName: "type", + type: "ReportScheduleType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ReportScheduleToggleRequestData.attributeTypeMap; + } + + public constructor() {} +}